Add CDockWidget::releaseWidget()
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user