Commit e499d7eb authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.autoTests: added testMetaInfoEnums()

parent b5262c9b
......@@ -3192,6 +3192,30 @@ void TestCore::testMetaInfo()
// QVERIFY(graphicsWidgetInfo.hasProperty("enabled")); // from QGraphicsItem
}
void TestCore::testMetaInfoEnums()
{
QScopedPointer<Model> model(Model::create("Qt/Text"));
QVERIFY(model.data());
QScopedPointer<TestView> view(new TestView);
QVERIFY(view.data());
model->attachView(view.data());
QCOMPARE(view->rootModelNode().metaInfo().typeName(), QString("Qt/Text"));
QVERIFY(view->rootModelNode().metaInfo().hasProperty("transformOrigin"));
QVERIFY(view->rootModelNode().metaInfo().property("transformOrigin").isEnumType());
QCOMPARE(view->rootModelNode().metaInfo().property("transformOrigin").type(), QLatin1String("TransformOrigin"));
QVERIFY(view->rootModelNode().metaInfo().property("transformOrigin").enumerator().elementNames().contains(QLatin1String("Bottom")));
QVERIFY(view->rootModelNode().metaInfo().property("transformOrigin").enumerator().elementNames().contains(QLatin1String("Top")));
QVERIFY(view->rootModelNode().metaInfo().property("horizontalAlignment").isEnumType());
QCOMPARE(view->rootModelNode().metaInfo().property("horizontalAlignment").type(), QLatin1String("HAlignment"));
QVERIFY(view->rootModelNode().metaInfo().property("horizontalAlignment").enumerator().elementNames().contains(QLatin1String("AlignLeft")));
QVERIFY(view->rootModelNode().metaInfo().property("horizontalAlignment").enumerator().elementNames().contains(QLatin1String("AlignRight")));
}
void TestCore::testMetaInfoDotProperties()
{
QScopedPointer<Model> model(Model::create("Qt/Text"));
......
......@@ -72,6 +72,7 @@ private slots:
// unit tests MetaInfo, NodeMetaInfo, PropertyMetaInfo
//
void testMetaInfo();
void testMetaInfoEnums();
void testMetaInfoDotProperties();
void testMetaInfoListProperties();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment