summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-08-04 13:44:45 (GMT)
committerjasplin <qt-info@nokia.com>2009-08-04 13:56:03 (GMT)
commitb80a499764bf331880ff0c0d52670a419ec50feb (patch)
tree12d4e0967d35a9e2fb44f8258320ab148ef6542e /tests/auto/qgraphicsitem
parent30e3a39ca2e5e1204cc123dce2f2921d8fda620d (diff)
downloadQt-b80a499764bf331880ff0c0d52670a419ec50feb.zip
Qt-b80a499764bf331880ff0c0d52670a419ec50feb.tar.gz
Qt-b80a499764bf331880ff0c0d52670a419ec50feb.tar.bz2
Added input hints to QGraphicsItem.
This patch allows for input hints to be set on a QGraphicsItem. Input methods use such hints to define its appearance/behavior (e.g. to allow for numerical input only). Reviewed-by: ahanssen Task-number: 254493
Diffstat (limited to 'tests/auto/qgraphicsitem')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 7f6f322..ef3f0f8 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -169,6 +169,7 @@ private slots:
void setParentItem();
void children();
void flags();
+ void inputMethodHints();
void toolTip();
void visible();
void explicitlyVisible();
@@ -762,6 +763,18 @@ void tst_QGraphicsItem::flags()
}
}
+class ImhTester : public QGraphicsItem
+{
+ QRectF boundingRect() const { return QRectF(); }
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {}
+};
+
+void tst_QGraphicsItem::inputMethodHints()
+{
+ ImhTester item;
+ QCOMPARE(item.inputMethodHints(), Qt::ImhNone);
+}
+
void tst_QGraphicsItem::toolTip()
{
QString toolTip = "Qt rocks!";