summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-11 14:12:42 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-13 08:46:36 (GMT)
commit2107870f75362eed07d353b6b171878713c7cfd3 (patch)
tree201a9a7156eb693ae8d4e2934f3b6985dac2495a
parent2f9222f87e6fe6ee9a61d0bee453fb3f51357c78 (diff)
downloadQt-2107870f75362eed07d353b6b171878713c7cfd3.zip
Qt-2107870f75362eed07d353b6b171878713c7cfd3.tar.gz
Qt-2107870f75362eed07d353b6b171878713c7cfd3.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
-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 2685b86..cf2e2b1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -10046,9 +10046,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 dcad8e1..6c32138 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -4074,8 +4074,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);