diff --git a/src/QDetachTabWidget.cpp b/src/QDetachTabWidget.cpp index 256ce56..0905073 100644 --- a/src/QDetachTabWidget.cpp +++ b/src/QDetachTabWidget.cpp @@ -76,6 +76,7 @@ void QDetachTabWidget::detachTab (int tabIndex, Qt::WindowState windowState) { // Notify listeners the tab was detached. emit tabDetached(tabIndex); + emit tabDetached(w); } void QDetachTabWidget::reattachTab (int tabIndex, Qt::WindowState windowState) { @@ -109,11 +110,15 @@ void QDetachTabWidget::reattachTab (int tabIndex, Qt::WindowState windowState) { // Insert the real tab in the same position. insertTab(tabIndex, it->_widget, it->_title); + // Save the real tab's widget before we delete the entry. + w = it->_widget; + // Delete the entry from the tab cache. _tabInfo.erase(it); // Notify listeners the tab was reattached. emit tabReattached(tabIndex); + emit tabReattached(w); } void QDetachTabWidget::closeEvent (QCloseEvent* e) { diff --git a/src/QDetachTabWidget.h b/src/QDetachTabWidget.h index db335a4..0c1329a 100644 --- a/src/QDetachTabWidget.h +++ b/src/QDetachTabWidget.h @@ -29,7 +29,9 @@ class QDetachTabWidget : public QTabWidget { signals: void tabDetached (int tabIndex); + void tabDetached (QWidget* widget); void tabReattached (int tabIndex); + void tabReattached (QWidget* widget); protected: void closeEvent (QCloseEvent* e);