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:
Sergio Martins
2022-09-10 11:37:32 +01:00
parent 3a280ae377
commit b5a9c03c21
4 changed files with 3 additions and 14 deletions

View File

@@ -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();
}