diff options
author | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com> | 2011-08-23 07:52:13 (GMT) |
---|---|---|
committer | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com> | 2011-08-23 07:52:13 (GMT) |
commit | 4748be8f436e2bc13b5755f2ffe2428a338f7239 (patch) | |
tree | 16a5eb509930c5696e01b62c4f71146fd262296a | |
parent | 090ff76845ca5b9c61319f359a94cc239b18846b (diff) | |
download | Qt-4748be8f436e2bc13b5755f2ffe2428a338f7239.zip Qt-4748be8f436e2bc13b5755f2ffe2428a338f7239.tar.gz Qt-4748be8f436e2bc13b5755f2ffe2428a338f7239.tar.bz2 |
Revert "Avoid calling QInputMethod update when adding or removing QGraphicsItems that don't have focus"
This reverts commit 090ff76845ca5b9c61319f359a94cc239b18846b ... due to failing unit tests.
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 14 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 4 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 7925c69..27639f9 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2688,11 +2688,10 @@ void QGraphicsScene::addItem(QGraphicsItem *item) // Ensure that newly added items that have subfocus set, gain // focus automatically if there isn't a focus item already. - if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) { + if (!d->focusItem && item != d->lastFocusItem && item->focusItem() == item) item->focusItem()->setFocus(); - // Update input method only if added item got focus - d->updateInputMethodSensitivityInViews(); - } + + d->updateInputMethodSensitivityInViews(); } /*! @@ -2943,9 +2942,6 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) { // ### Refactoring: This function shares much functionality with _q_removeItemLater() Q_D(QGraphicsScene); - - bool wasFocused(item == focusItem()); - if (!item) { qWarning("QGraphicsScene::removeItem: cannot remove 0-item"); return; @@ -2972,9 +2968,7 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) // Deliver post-change notification item->itemChange(QGraphicsItem::ItemSceneHasChanged, newSceneVariant); - // Avoid calling input method update if removed item wasn't focused - if (wasFocused) - d->updateInputMethodSensitivityInViews(); + d->updateInputMethodSensitivityInViews(); } /*! diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 4bfcbb2..41b07c4 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1101,8 +1101,8 @@ void QGraphicsViewPrivate::updateInputMethodSensitivity() if (!proxy) { q->setInputMethodHints(focusItem->inputMethodHints()); } else if (QWidget *widget = proxy->widget()) { - if (QWidget *fw = widget->focusWidget()) - widget = fw; + if (QWidget *fw = widget->focusWidget()) + widget = fw; q->setInputMethodHints(widget->inputMethodHints()); } else { q->setInputMethodHints(0); |