summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmainwindowlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/gui/widgets/qmainwindowlayout.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp
index eade633..526e7a5 100644
--- a/src/gui/widgets/qmainwindowlayout.cpp
+++ b/src/gui/widgets/qmainwindowlayout.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -490,10 +490,10 @@ void QMainWindowLayoutState::clear()
#ifndef QT_NO_DOCKWIDGET
dockAreaLayout.clear();
#else
- centralWidgetRect = QRect(0, 0, -1, -1);
+ centralWidgetRect = QRect();
#endif
- rect = QRect(0, 0, -1, -1);
+ rect = QRect();
}
bool QMainWindowLayoutState::isValid() const
@@ -1304,30 +1304,15 @@ bool QMainWindowLayout::separatorMove(const QPoint &pos)
if (movingSeparator.isEmpty())
return false;
movingSeparatorPos = pos;
- separatorMoveTimer->start();
+ separatorMoveTimer.start(0, this);
return true;
}
-void QMainWindowLayout::doSeparatorMove()
-{
- if (movingSeparator.isEmpty())
- return;
- if (movingSeparatorOrigin == movingSeparatorPos)
- return;
-
- layoutState = savedState;
- layoutState.dockAreaLayout.separatorMove(movingSeparator, movingSeparatorOrigin,
- movingSeparatorPos,
- &separatorMoveCache);
- movingSeparatorPos = movingSeparatorOrigin;
-}
-
bool QMainWindowLayout::endSeparatorMove(const QPoint&)
{
bool result = !movingSeparator.isEmpty();
movingSeparator.clear();
savedState.clear();
- separatorMoveCache.clear();
return result;
}
@@ -1687,10 +1672,6 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow)
#ifndef QT_NO_TABBAR
sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow);
#endif
- separatorMoveTimer = new QTimer(this);
- separatorMoveTimer->setSingleShot(true);
- separatorMoveTimer->setInterval(0);
- connect(separatorMoveTimer, SIGNAL(timeout()), this, SLOT(doSeparatorMove()));
#ifndef QT_NO_TABWIDGET
for (int i = 0; i < QInternal::DockCount; ++i)
@@ -1982,6 +1963,27 @@ bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const
#endif
}
+void QMainWindowLayout::timerEvent(QTimerEvent *e)
+{
+#ifndef QT_NO_DOCKWIDGET
+ if (e->timerId() == separatorMoveTimer.timerId()) {
+ //let's move the separators
+ separatorMoveTimer.stop();
+ if (movingSeparator.isEmpty())
+ return;
+ if (movingSeparatorOrigin == movingSeparatorPos)
+ return;
+
+ layoutState = savedState;
+ layoutState.dockAreaLayout.separatorMove(movingSeparator, movingSeparatorOrigin,
+ movingSeparatorPos);
+ movingSeparatorPos = movingSeparatorOrigin;
+ }
+#endif
+ QLayout::timerEvent(e);
+}
+
+
QT_END_NAMESPACE
#endif // QT_NO_MAINWINDOW