Don't handle QEvent::Hide anymore
Update the buttons in DockWidget::setIsOpen() instead. This makes the controllers self-contained and not depending on the "view technology". Other frameworks might not even have the concept of show/hidden events
This commit is contained in:
@@ -866,21 +866,12 @@ void DockWidget::Private::onParentChanged()
|
||||
|
||||
void DockWidget::onShown()
|
||||
{
|
||||
d->updateToggleAction();
|
||||
d->updateFloatAction();
|
||||
|
||||
d->maybeRestoreToPreviousPosition();
|
||||
|
||||
// Transform into a FloatingWindow if this will be a regular floating dock widget.
|
||||
QTimer::singleShot(0, d, &DockWidget::Private::maybeMorphIntoFloatingWindow);
|
||||
}
|
||||
|
||||
void DockWidget::onHidden()
|
||||
{
|
||||
d->updateToggleAction();
|
||||
d->updateFloatAction();
|
||||
}
|
||||
|
||||
void DockWidget::onResize(QSize)
|
||||
{
|
||||
if (isOverlayed()) {
|
||||
@@ -1069,4 +1060,7 @@ void DockWidget::Private::setIsOpen(bool is)
|
||||
close();
|
||||
|
||||
m_isOpen = is;
|
||||
|
||||
updateToggleAction();
|
||||
updateFloatAction();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user