diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp index e901808..08c47e4 100644 --- a/src/DockWidget.cpp +++ b/src/DockWidget.cpp @@ -263,11 +263,12 @@ void CDockWidget::setWidget(QWidget* widget, eInsertMode InsertMode) //============================================================================ -void CDockWidget::releaseWidget() +QWidget* CDockWidget::takeWidget() { d->ScrollArea->takeWidget(); d->Layout->removeWidget(d->Widget); d->Widget->setParent(nullptr); + return d->Widget; } diff --git a/src/DockWidget.h b/src/DockWidget.h index 3decfc6..658372f 100644 --- a/src/DockWidget.h +++ b/src/DockWidget.h @@ -241,7 +241,7 @@ public: /** * Remove the widget from the dock and give ownership back to the caller */ - void releaseWidget(); + QWidget* takeWidget(); /** * Returns the widget for the dock widget. This function returns zero if