summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2009-12-18 18:08:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2009-12-18 18:08:06 (GMT)
commitac3a1e3180b10948f919645d683d967e513f8273 (patch)
tree38911f801d94a9ca908496a554aae5a0d8bfa8fd /src/gui/graphicsview
parent99e1dc904eab4b38c90803f13d73f90b9c048920 (diff)
parentf708b248aec810a1dcad1f13e1c16390244c9834 (diff)
downloadQt-ac3a1e3180b10948f919645d683d967e513f8273.zip
Qt-ac3a1e3180b10948f919645d683d967e513f8273.tar.gz
Qt-ac3a1e3180b10948f919645d683d967e513f8273.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed QPixmap::load() to not modify referenced copies. Fixes bug when using AnchorUnderMouse for GraphicsView transformation. Make the layout{,AboutToBe}Changed signals in the QSortFilterProxyModel match its source. Make sure mappings are created for columns when indexes newly become parents. NEON configure detection and initial blend function implementations. Optimize QThreadStorage with QVector Add Q_OBJECT to QBalloonTip so it can be intreospected by styles.
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index ffe64aa..3bb40fb 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -1208,6 +1208,11 @@ void QGraphicsView::setTransformationAnchor(ViewportAnchor anchor)
{
Q_D(QGraphicsView);
d->transformationAnchor = anchor;
+
+ // Ensure mouse tracking is enabled in the case we are using AnchorUnderMouse
+ // in order to have up-to-date information for centering the view.
+ if (d->transformationAnchor == AnchorUnderMouse)
+ d->viewport->setMouseTracking(true);
}
/*!
@@ -1235,6 +1240,11 @@ void QGraphicsView::setResizeAnchor(ViewportAnchor anchor)
{
Q_D(QGraphicsView);
d->resizeAnchor = anchor;
+
+ // Ensure mouse tracking is enabled in the case we are using AnchorUnderMouse
+ // in order to have up-to-date information for centering the view.
+ if (d->resizeAnchor == AnchorUnderMouse)
+ d->viewport->setMouseTracking(true);
}
/*!
@@ -2597,9 +2607,12 @@ void QGraphicsView::setupViewport(QWidget *widget)
}
// We are only interested in mouse tracking if items
- // accept hover events or use non-default cursors.
- if (d->scene && (!d->scene->d_func()->allItemsIgnoreHoverEvents
- || !d->scene->d_func()->allItemsUseDefaultCursor)) {
+ // accept hover events or use non-default cursors or if
+ // AnchorUnderMouse is used as transformation or resize anchor.
+ if ((d->scene && (!d->scene->d_func()->allItemsIgnoreHoverEvents
+ || !d->scene->d_func()->allItemsUseDefaultCursor))
+ || d->transformationAnchor == AnchorUnderMouse
+ || d->resizeAnchor == AnchorUnderMouse) {
widget->setMouseTracking(true);
}