mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Add CDockWidget::releaseWidget()
This commit is contained in:
parent
e2c5204d00
commit
b9b8ff9c76
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user