diff options
author | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-18 07:41:09 (GMT) |
---|---|---|
committer | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-18 07:41:09 (GMT) |
commit | 9cacde74f7de702689725882633073e60c0a2baa (patch) | |
tree | 330d22dadbd28b14a7d8896823d1c33597e9993e /src/gui/kernel/qwidget_mac.mm | |
parent | 006c8e22075112eff6230d8168d716e44a9e29d5 (diff) | |
parent | 2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff) | |
download | Qt-9cacde74f7de702689725882633073e60c0a2baa.zip Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.gz Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
Conflicts:
doc/src/examples/wheel.qdoc
src/gui/util/qflickgesture.cpp
src/gui/util/qflickgesture_p.h
src/gui/util/qscroller.cpp
src/gui/util/qscroller.h
src/gui/util/qscroller_p.h
src/gui/util/qscrollerproperties.cpp
src/gui/util/qscrollerproperties.h
tests/auto/qscroller/tst_qscroller.cpp
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 387d00c..778f1f1 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2733,7 +2733,7 @@ QWidget::macCGHandle() const return handle(); } -void qt_mac_repaintParentUnderAlienWidget(QWidget *alienWidget) +void qt_mac_updateParentUnderAlienWidget(QWidget *alienWidget) { QWidget *nativeParent = alienWidget->nativeParentWidget(); if (!nativeParent) @@ -2741,7 +2741,7 @@ void qt_mac_repaintParentUnderAlienWidget(QWidget *alienWidget) QPoint globalPos = alienWidget->mapToGlobal(QPoint(0, 0)); QRect dirtyRect = QRect(nativeParent->mapFromGlobal(globalPos), alienWidget->size()); - nativeParent->repaint(dirtyRect); + nativeParent->update(dirtyRect); } void QWidget::destroy(bool destroyWindow, bool destroySubWindows) @@ -2752,7 +2752,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (!isWindow() && parentWidget()) parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); if (!internalWinId()) - qt_mac_repaintParentUnderAlienWidget(this); + qt_mac_updateParentUnderAlienWidget(this); d->deactivateWidgetCleanup(); qt_mac_event_release(this); if(testAttribute(Qt::WA_WState_Created)) { @@ -3032,6 +3032,16 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) q->setAttribute(Qt::WA_WState_Hidden); q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden); +#ifdef QT_MAC_USE_COCOA + // If we add a child to the unified toolbar, we have to redirect the painting. + if (parent && parent->d_func() && parent->d_func()->isInUnifiedToolbar) { + if (parent->d_func()->unifiedSurface) { + QWidget *toolbar = parent->d_func()->toolbar_ancestor; + parent->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset); + } + } +#endif // QT_MAC_USE_COCOA + if (wasCreated) { transferChildren(); #ifndef QT_MAC_USE_COCOA @@ -3526,8 +3536,8 @@ void QWidgetPrivate::show_sys() // INVARIANT: q is native. Just show the view: [view setHidden:NO]; } else { - // INVARIANT: q is alien. Repaint q instead: - q->repaint(); + // INVARIANT: q is alien. Update q instead: + q->update(); } #endif } @@ -3683,7 +3693,7 @@ void QWidgetPrivate::hide_sys() [view setHidden:YES]; } else { // INVARIANT: q is alien. Repaint where q is placed instead: - qt_mac_repaintParentUnderAlienWidget(q); + qt_mac_updateParentUnderAlienWidget(q); } #endif } |