summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-11 14:12:42 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-11-18 05:35:38 (GMT)
commitb8c749f5d2fec14f28918ccac0bc6060079f4b18 (patch)
tree11a0dc03513eb3332369b3db80b2cf59d518b560
parentee21817d7f7bb0c8c9141f04d265bb547052c075 (diff)
downloadQt-b8c749f5d2fec14f28918ccac0bc6060079f4b18.zip
Qt-b8c749f5d2fec14f28918ccac0bc6060079f4b18.tar.gz
Qt-b8c749f5d2fec14f28918ccac0bc6060079f4b18.tar.bz2
Fix S60 input method not showing up in editable QGraphicsTextItems
Correctly set the ItemAcceptsInputMethod flag in setTextInteractionFlags. Reviewed-by: Andreas Reviewed-by: axis Reviewed-by: Janne Koskinen (cherry picked from commit ead0ab9e14603f278fcaaf4f126cdd232274fe26)
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 9d495e9..633cee1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -10177,9 +10177,10 @@ bool QGraphicsTextItemPrivate::_q_mouseOnEdge(QGraphicsSceneMouseEvent *event)
void QGraphicsTextItem::setTextInteractionFlags(Qt::TextInteractionFlags flags)
{
if (flags == Qt::NoTextInteraction)
- setFlags(this->flags() & ~QGraphicsItem::ItemIsFocusable);
+ setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod));
else
- setFlags(this->flags() | QGraphicsItem::ItemIsFocusable);
+ setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);
+
dd->textControl()->setTextInteractionFlags(flags);
}
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index d65c6ec..d848dfc 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -4077,8 +4077,11 @@ void tst_QGraphicsItem::defaultItemTest_QGraphicsTextItem()
QCOMPARE(text->pos(), QPointF(10, 10));
+ text->setTextInteractionFlags(Qt::NoTextInteraction);
+ QVERIFY(!(text->flags() & QGraphicsItem::ItemAcceptsInputMethod));
text->setTextInteractionFlags(Qt::TextEditorInteraction);
QCOMPARE(text->textInteractionFlags(), Qt::TextInteractionFlags(Qt::TextEditorInteraction));
+ QVERIFY(text->flags() & QGraphicsItem::ItemAcceptsInputMethod);
{
QGraphicsSceneMouseEvent event2(QEvent::GraphicsSceneMouseMove);