summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-08-04 15:44:45 +0200
committerjasplin <qt-info@nokia.com>2009-08-04 15:56:03 +0200
commitb80a499764bf331880ff0c0d52670a419ec50feb (patch)
tree12d4e0967d35a9e2fb44f8258320ab148ef6542e /tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
parent30e3a39ca2e5e1204cc123dce2f2921d8fda620d (diff)
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/tst_qgraphicsitem.cpp')
-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 7f6f322261..ef3f0f8ff4 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!";