From bede24ee04fa611a5be5ae8cb96197499ec64768 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Thu, 15 Jun 2023 15:13:44 +0200 Subject: [PATCH] Update documentation of signal QDockWidget::visibilityChanged The signal can deviate from QWidget::isVisible(). This patch clarifies the signal's documentation. Since its name suggests that it is in sync with QWidget::isVisible(), A TODO comment is added to consider deprication in Qt7. It appears to be more reliable to listen to hide/show events. Fixes: QTBUG-48161 Change-Id: I43aa16c2ecb4877abd8effb7da8e07576438d6d2 Reviewed-by: Richard Moe Gustavsen (cherry picked from commit 7993321e7620941f3106acb977243c51aa27ceec) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qdockwidget.cpp | 4 ++++ src/widgets/widgets/qdockwidget.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 5b9704228b5..b2ea35305ac 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1721,6 +1721,10 @@ QAction * QDockWidget::toggleViewAction() const invisible). This happens when the widget is hidden or shown, as well as when it is docked in a tabbed dock area and its tab becomes selected or unselected. + + \note The signal can differ from QWidget::isVisible(). This can be the case, if + a dock widget is minimized or tabified and associated to a non-selected or + inactive tab. */ /*! diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h index f524a884232..8123bbb7298 100644 --- a/src/widgets/widgets/qdockwidget.h +++ b/src/widgets/widgets/qdockwidget.h @@ -72,7 +72,7 @@ Q_SIGNALS: void featuresChanged(QDockWidget::DockWidgetFeatures features); void topLevelChanged(bool topLevel); void allowedAreasChanged(Qt::DockWidgetAreas allowedAreas); - void visibilityChanged(bool visible); + void visibilityChanged(bool visible); //TODO depricate in Qt7: Better listen to hide/show events void dockLocationChanged(Qt::DockWidgetArea area); protected: