diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-19 19:07:03 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-19 19:07:03 (GMT) |
commit | 1d10beb659bec2df28f12f98671ef47c983b76c0 (patch) | |
tree | 718a217559e9e4c70d9598fff13e66ae06b2a7df /src | |
parent | d28057dc6f282c2cc129eae40a4fb1555fef455c (diff) | |
parent | ea614c822c0075b939cc8a56bbc53aaf9c68228d (diff) | |
download | Qt-1d10beb659bec2df28f12f98671ef47c983b76c0.zip Qt-1d10beb659bec2df28f12f98671ef47c983b76c0.tar.gz Qt-1d10beb659bec2df28f12f98671ef47c983b76c0.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Enable the unified toolbar with the raster
configure: Don't use character class when looking for QMAKE_CONF_COMPILER
Moving the resetInternalData slot to QAbstractProxyModel
Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
Emit beginResetModel before updating the strings.
Send the hoverLeave not properly sent on the widget inside QGPW.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsproxywidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/itemviews/qabstractproxymodel.cpp | 24 | ||||
-rw-r--r-- | src/gui/itemviews/qabstractproxymodel.h | 3 | ||||
-rw-r--r-- | src/gui/itemviews/qstringlistmodel.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qunifiedtoolbarsurface_mac.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qunifiedtoolbarsurface_mac_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_raster.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindowlayout_mac.mm | 2 |
10 files changed, 50 insertions, 8 deletions
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 320395e..ce63659 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -266,8 +266,8 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent } if (!lastWidgetUnderMouse) { - QApplicationPrivate::dispatchEnterLeave(embeddedMouseGrabber ? embeddedMouseGrabber : widget, 0); - lastWidgetUnderMouse = widget; + QApplicationPrivate::dispatchEnterLeave(embeddedMouseGrabber ? embeddedMouseGrabber : receiver, 0); + lastWidgetUnderMouse = receiver; } // Map event position from us to the receiver diff --git a/src/gui/itemviews/qabstractproxymodel.cpp b/src/gui/itemviews/qabstractproxymodel.cpp index 51dfa7a..12c4c7b 100644 --- a/src/gui/itemviews/qabstractproxymodel.cpp +++ b/src/gui/itemviews/qabstractproxymodel.cpp @@ -121,12 +121,15 @@ QAbstractProxyModel::~QAbstractProxyModel() void QAbstractProxyModel::setSourceModel(QAbstractItemModel *sourceModel) { Q_D(QAbstractProxyModel); - if (d->model) + if (d->model) { disconnect(d->model, SIGNAL(destroyed()), this, SLOT(_q_sourceModelDestroyed())); + disconnect(d->model, SIGNAL(modelReset()), this, SLOT(resetInternalData())); + } if (sourceModel) { d->model = sourceModel; connect(d->model, SIGNAL(destroyed()), this, SLOT(_q_sourceModelDestroyed())); + connect(d->model, SIGNAL(modelReset()), this, SLOT(resetInternalData())); } else { d->model = QAbstractItemModelPrivate::staticEmptyModel(); } @@ -380,6 +383,25 @@ Qt::DropActions QAbstractProxyModel::supportedDropActions() const return d->model->supportedDropActions(); } +/* + \since 4.8 + + This slot is called just after the internal data of a model is cleared + while it is being reset. + + This slot is provided the convenience of subclasses of concrete proxy + models, such as subclasses of QSortFilterProxyModel which maintain extra + data. + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 10 + + \sa modelAboutToBeReset(), modelReset() +*/ +void QAbstractProxyModel::resetInternalData() +{ + +} + QT_END_NAMESPACE #include "moc_qabstractproxymodel.cpp" diff --git a/src/gui/itemviews/qabstractproxymodel.h b/src/gui/itemviews/qabstractproxymodel.h index a5a1168..14eaa5a 100644 --- a/src/gui/itemviews/qabstractproxymodel.h +++ b/src/gui/itemviews/qabstractproxymodel.h @@ -95,6 +95,9 @@ public: QStringList mimeTypes() const; Qt::DropActions supportedDropActions() const; +protected slots: + void resetInternalData(); + protected: QAbstractProxyModel(QAbstractProxyModelPrivate &, QObject *parent); diff --git a/src/gui/itemviews/qstringlistmodel.cpp b/src/gui/itemviews/qstringlistmodel.cpp index 8d69ee4..60ff952 100644 --- a/src/gui/itemviews/qstringlistmodel.cpp +++ b/src/gui/itemviews/qstringlistmodel.cpp @@ -290,8 +290,9 @@ QStringList QStringListModel::stringList() const */ void QStringListModel::setStringList(const QStringList &strings) { + emit beginResetModel(); lst = strings; - reset(); + emit endResetModel(); } /*! diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index a75fc38..a773e7a 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5322,12 +5322,12 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP if (rgn.isEmpty()) return; -#ifdef Q_WS_MAC +#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) // We disable the rendering of QToolBar in the backingStore if // it's supposed to be in the unified toolbar on Mac OS X. if (backingStore && isInUnifiedToolbar) return; -#endif // Q_WS_MAC +#endif // Q_WS_MAC && QT_MAC_USE_COCOA Q_Q(QWidget); diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp index 722355e..b90b061 100644 --- a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp +++ b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp @@ -39,6 +39,8 @@ ** ****************************************************************************/ +#ifdef QT_MAC_USE_COCOA + #include "qunifiedtoolbarsurface_mac_p.h" #include <private/qt_cocoa_helpers_mac_p.h> #include <private/qbackingstore_p.h> @@ -231,3 +233,5 @@ void QUnifiedToolbarSurface::prepareBuffer(QImage::Format format, QWidget *widge } QT_END_NAMESPACE + +#endif // QT_MAC_USE_COCOA diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac_p.h b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h index d7805e8..c2ec854 100644 --- a/src/gui/painting/qunifiedtoolbarsurface_mac_p.h +++ b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h @@ -53,6 +53,8 @@ // We mean it. // +#ifdef QT_MAC_USE_COCOA + #include <private/qwindowsurface_raster_p.h> #include <QWidget> #include <private/qwidget_p.h> @@ -92,4 +94,6 @@ private: QT_END_NAMESPACE +#endif // QT_MAC_USE_COCOA + #endif // QUNIFIEDTOOLBARSURFACE_MAC_P_H diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 99f8597..217723f 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -251,6 +251,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi #ifdef Q_WS_MAC +#ifdef QT_MAC_USE_COCOA // Unified toolbar hack. QMainWindow* mWindow = qobject_cast<QMainWindow*>(widget->window()); if (mWindow) { @@ -267,6 +268,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi } } } +#endif // QT_MAC_USE_COCOA Q_UNUSED(offset); // Get a context for the widget. @@ -338,7 +340,8 @@ void QRasterWindowSurface::setGeometry(const QRect &rect) prepareBuffer(QNativeImage::systemFormat(), window()); } d->inSetGeometry = false; -#ifdef Q_WS_MAC + +#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) QMainWindow* mWindow = qobject_cast<QMainWindow*>(window()); if (mWindow) { QMainWindowLayout *mLayout = qobject_cast<QMainWindowLayout*>(mWindow->layout()); @@ -354,7 +357,8 @@ void QRasterWindowSurface::setGeometry(const QRect &rect) } } } -#endif // Q_WS_MAC +#endif // Q_WS_MAC && QT_MAC_USE_COCOA + } // from qwindowsurface.cpp diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 861cfaa..d4118bd 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1524,10 +1524,12 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) d->useHIToolBar = set; createWinId(); // We need the hiview for down below. +#ifdef QT_MAC_USE_COCOA // Activate the unified toolbar with the raster engine. if (windowSurface()) { d->layout->unifiedSurface = new QUnifiedToolbarSurface(this); } +#endif // QT_MAC_USE_COCOA d->layout->updateHIToolBarStatus(); // Enabling the unified toolbar clears the opaque size grip setting, update it. diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index 21f6067..126cc4a 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -452,7 +452,9 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar for (int i = 0; i < beforeIndex; ++i) { offset.setX(offset.x() + qtoolbarsInUnifiedToolbarList.at(i)->size().width()); } +#ifdef QT_MAC_USE_COCOA unifiedSurface->insertToolbar(toolbar, offset); +#endif // QT_MAC_USE_COCOA } #ifndef QT_MAC_USE_COCOA |