diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 21:27:07 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 21:27:07 +0200 |
commit | d3a8bc803cd7c4ce106038bfc4b37cdd6bb8e177 (patch) | |
tree | 3b6db0d4869f334d0eb4559c5ae457995cbe913e /src/widgets/graphicsview | |
parent | d934ddc297f6db94dbc548fe01da64350f13577d (diff) | |
parent | 47a7628023610904c6ac52e23fa289f75f349b4e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/corelib/io/qdatastream.cpp
src/corelib/io/qdatastream.h
src/corelib/json/qjsonwriter.cpp
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/xcb/qxcbkeyboard.cpp
Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 6 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 9 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 2 |
5 files changed, 18 insertions, 5 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 62eab6a7a2..668436c1a2 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -1658,8 +1658,8 @@ const QGraphicsObject *QGraphicsItem::toGraphicsObject() const the parent. You should not \l{QGraphicsScene::addItem()}{add} the item to the scene yourself. - Calling this function on an item that is an ancestor of \a newParent - have undefined behaviour. + The behavior when calling this function on an item that is an ancestor of + \a newParent is undefined. \sa parentItem(), childItems() */ @@ -7186,7 +7186,7 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) */ void QGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (flags() & ItemIsSelectable) { + if (event->button() == Qt::LeftButton && (flags() & ItemIsSelectable)) { bool multiSelect = (event->modifiers() & Qt::ControlModifier) != 0; if (event->scenePos() == event->buttonDownScenePos(Qt::LeftButton)) { // The item didn't move diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index f84201cedf..1898ecba68 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -825,7 +825,9 @@ bool QGraphicsProxyWidget::event(QEvent *event) } case QEvent::InputMethod: { inputMethodEvent(static_cast<QInputMethodEvent *>(event)); - break; + if (event->isAccepted()) + return true; + return false; } case QEvent::ShortcutOverride: { QWidget *focusWidget = d->widget->focusWidget(); diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 8a0b983c73..88cccb5118 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -637,6 +637,15 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) if (item == lastActivePanel) lastActivePanel = 0; + // Change tabFocusFirst to the next widget in focus chain if removing the current one. + if (item == tabFocusFirst) { + QGraphicsWidgetPrivate *wd = tabFocusFirst->d_func(); + if (wd->focusNext && wd->focusNext != tabFocusFirst && wd->focusNext->scene() == q) + tabFocusFirst = wd->focusNext; + else + tabFocusFirst = 0; + } + // Cancel active touches { QMap<int, QGraphicsItem *>::iterator it = itemForTouchPointId.begin(); diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 0424517346..d78e32205f 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -2938,6 +2938,8 @@ bool QGraphicsView::viewportEvent(QEvent *event) touchEvent->setTarget(viewport()); QGraphicsViewPrivate::translateTouchEvent(d, touchEvent); (void) QApplication::sendEvent(d->scene, touchEvent); + } else { + event->ignore(); } return true; diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index ddd3ee2e68..3d902d9227 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -1673,7 +1673,7 @@ void QGraphicsWidget::hoverMoveEvent(QGraphicsSceneHoverEvent *event) */ void QGraphicsWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + QGraphicsObject::hoverLeaveEvent(event); } /*! |