summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qitemeditorfactory
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-10-02 13:01:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-19 00:44:54 +0200
commitd84f449bcde56fd2df12f82dd2ba2e1f0a4ae7c7 (patch)
tree0d982beb7be025b695e57b707b51eec1e048414c /tests/auto/widgets/itemviews/qitemeditorfactory
parent8bed283f137c14a7be1fb9027eae5eae3ce796be (diff)
Make sure uints remain uints when editing in itemviews.
Task-number: QTBUG-22974 Change-Id: I07428862c4dffc629f868f3010f663eb655922d0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qitemeditorfactory')
-rw-r--r--tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp b/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
index e0a9db3d7d..44b1cebcfb 100644
--- a/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
+++ b/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
@@ -48,6 +48,7 @@ class tst_QItemEditorFactory: public QObject
private slots:
void createEditor();
void createCustomEditor();
+ void uintValues();
};
void tst_QItemEditorFactory::createEditor()
@@ -100,6 +101,24 @@ void tst_QItemEditorFactory::createCustomEditor()
delete creator;
}
+void tst_QItemEditorFactory::uintValues()
+{
+ QItemEditorFactory editorFactory;
+
+ QWidget parent;
+
+ {
+ QWidget *editor = editorFactory.createEditor(QMetaType::UInt, &parent);
+ QCOMPARE(editor->metaObject()->className(), "QUIntSpinBox");
+ QCOMPARE(editor->metaObject()->userProperty().type(), QVariant::UInt);
+ }
+ {
+ QWidget *editor = editorFactory.createEditor(QMetaType::Int, &parent);
+ QCOMPARE(editor->metaObject()->className(), "QSpinBox");
+ QCOMPARE(editor->metaObject()->userProperty().type(), QVariant::Int);
+ }
+}
+
QTEST_MAIN(tst_QItemEditorFactory)
#include "tst_qitemeditorfactory.moc"