Added DockWidget::windowActiveChanged() signal

Tracking the top-level window's 'isActiveWindow' property is difficult
since the dock widget's top-level window is changing all the time
when docking and undocking. So added a convenience signal
This commit is contained in:
Sergio Martins
2020-11-09 13:33:44 +00:00
parent 7faaf2cc69
commit b93f115b53
3 changed files with 21 additions and 1 deletions

View File

@@ -407,6 +407,11 @@ Q_SIGNALS:
///Only relevant for the auto-hide/sidebar feature
void removedFromSideBar();
///@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);
protected:
void onParentChanged();
void onShown(bool spontaneous);
@@ -478,6 +483,9 @@ private:
///@brief Updates the floatAction state
void updateFloatAction();
///@reimp
bool eventFilter(QObject *, QEvent *) override;
class Private;
Private *const d;
};