Renamed signal to windowActiveAboutToChange()

Added the 'aboutTo', as the event hasn't been caught by the top-level
window yet
This commit is contained in:
Sergio Martins
2020-11-09 13:46:16 +00:00
parent b93f115b53
commit e9a321039f
3 changed files with 6 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
- Wayland support
- Added Flag_KeepAboveIfNotUtilityWindow, so you can have keep above even if
floating window is shown in the task-bar.
- Added DockWidget::windowActiveChanged() signal
- Added DockWidget::windowActiveAboutToChange() signal
* v1.1.0 (26 October 2020)
- New drop indicator style type: Segmented Indicators

View File

@@ -602,7 +602,7 @@ bool DockWidgetBase::eventFilter(QObject *watched, QEvent *event)
const bool isWindowActivate = event->type() == QEvent::WindowActivate;
const bool isWindowDeactivate = event->type() == QEvent::WindowDeactivate;
if (isWindowActivate || isWindowDeactivate)
Q_EMIT windowActiveChanged(isWindowActivate);
Q_EMIT windowActiveAboutToChange(isWindowActivate);
return QWidgetAdapter::eventFilter(watched, event);
}

View File

@@ -410,7 +410,10 @@ Q_SIGNALS:
///@brief Emitted when the top-level window this dock widget is in is activated or deactivated
///This is convenience to replace tracking dockWidget->window(), since the window changes when
///docking and undocking
void windowActiveChanged(bool activated);
///
/// It's called 'aboutTo' because it's done in an event filter and the target window doesn't
/// have it's 'activeWindow' property updated yet at this point.
void windowActiveAboutToChange(bool activated);
protected:
void onParentChanged();