diff options
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 16 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbar.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 40c0b02..5596ca4 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -183,6 +183,9 @@ void QToolBarPrivate::setWindowState(bool floating, bool unplug, const QRect &re if (visible) q->show(); + + if (floating != wasFloating) + emit q->topLevelChanged(floating); } void QToolBarPrivate::initDrag(const QPoint &pos) @@ -518,6 +521,19 @@ void QToolBarPrivate::plug(const QRect &r) */ /*! + \since 4.6 + + \fn void QToolBar::topLevelChanged(bool topLevel) + + This signal is emitted when the \l floating property changes. + The \a topLevel parameter is true if the toolbar is now floating; + otherwise it is false. + + \sa isWindow() +*/ + + +/*! Constructs a QToolBar with the given \a parent. */ QToolBar::QToolBar(QWidget *parent) diff --git a/src/gui/widgets/qtoolbar.h b/src/gui/widgets/qtoolbar.h index a084673..a1a24f0 100644 --- a/src/gui/widgets/qtoolbar.h +++ b/src/gui/widgets/qtoolbar.h @@ -142,6 +142,7 @@ Q_SIGNALS: void orientationChanged(Qt::Orientation orientation); void iconSizeChanged(const QSize &iconSize); void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle); + void topLevelChanged(bool topLevel); protected: void actionEvent(QActionEvent *event); |