src/gui/widgets/qtoolbar.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
--- a/src/gui/widgets/qtoolbar.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/widgets/qtoolbar.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -183,6 +183,9 @@
 
     if (visible)
         q->show();
+
+    if (floating != wasFloating)
+        emit q->topLevelChanged(floating);
 }
 
 void QToolBarPrivate::initDrag(const QPoint &pos)
@@ -393,10 +396,10 @@
 void QToolBarPrivate::unplug(const QRect &_r)
 {
     Q_Q(QToolBar);
-    layout->setExpanded(false, false);
     QRect r = _r;
     r.moveTopLeft(q->mapToGlobal(QPoint(0, 0)));
     setWindowState(true, true, r);
+    layout->setExpanded(false);
 }
 
 void QToolBarPrivate::plug(const QRect &r)
@@ -518,6 +521,19 @@
 */
 
 /*!
+    \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)