summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoawindowdelegate_mac.mm
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-03-15 13:48:49 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2011-03-15 13:48:49 (GMT)
commitd524e983c60ba59f3c65d811ec92f02c97d1a8ab (patch)
tree6157eb8a3f3123c5dbebbc07591da81653f3331a /src/gui/kernel/qcocoawindowdelegate_mac.mm
parent2b9e7bcede5ca6ba9de2534839244cc621f17e1c (diff)
downloadQt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.zip
Qt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.tar.gz
Qt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.tar.bz2
Change the way the unified toolbar is flushed.
The flushing of the unified toolbar is no longer tied to the main window, making it more flexible. Task-number: QTBUG-17754 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qcocoawindowdelegate_mac.mm')
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac.mm18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm
index 9e7aa58..1faf068 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac.mm
+++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm
@@ -48,6 +48,9 @@
#include <qlayout.h>
#include <qcoreapplication.h>
#include <qmenubar.h>
+#include <QMainWindow>
+#include <QToolBar>
+#include <private/qmainwindowlayout_p.h>
QT_BEGIN_NAMESPACE
extern QWidgetData *qt_qwidget_data(QWidget *); // qwidget.cpp
@@ -218,8 +221,21 @@ static void cleanupCocoaWindowDelegate()
// We force the repaint to be synchronized with the resize of the window.
// Otherwise, the resize looks sluggish because we paint one event loop later.
- if ([[window contentView] inLiveResize])
+ if ([[window contentView] inLiveResize]) {
qwidget->repaint();
+
+ // We need to repaint the toolbar as well.
+ QMainWindow* mWindow = qobject_cast<QMainWindow*>(qwidget->window());
+ if (mWindow) {
+ QMainWindowLayout *mLayout = qobject_cast<QMainWindowLayout*>(mWindow->layout());
+ QList<QToolBar *> toolbarList = mLayout->qtoolbarsInUnifiedToolbarList;
+
+ for (int i = 0; i < toolbarList.size(); ++i) {
+ QToolBar* toolbar = toolbarList.at(i);
+ toolbar->repaint();
+ }
+ }
+ }
}
- (void)windowDidMove:(NSNotification *)notification