Add CDockWidget::releaseWidget()

This commit is contained in:
Tibo Clausen 2019-05-16 11:53:31 +01:00
parent e2c5204d00
commit b9b8ff9c76
2 changed files with 14 additions and 0 deletions

View File

@ -262,6 +262,15 @@ void CDockWidget::setWidget(QWidget* widget, eInsertMode InsertMode)
}
//============================================================================
void CDockWidget::releaseWidget()
{
d->ScrollArea->takeWidget();
d->Layout->removeWidget(d->Widget);
d->Widget->setParent(nullptr);
}
//============================================================================
QWidget* CDockWidget::widget() const
{

View File

@ -238,6 +238,11 @@ public:
*/
void setWidget(QWidget* widget, eInsertMode InsertMode = AutoScrollArea);
/**
* Remove the widget from the dock and give ownership back to the caller
*/
void releaseWidget();
/**
* Returns the widget for the dock widget. This function returns zero if
* the widget has not been set.