summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-04-21 17:10:54 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2009-04-24 08:05:54 (GMT)
commit6cff4b9dcc3095cb2dfc1dc9653a7bf958fe91d3 (patch)
tree73df58dd759fa30be7730d56f9689038ef891a47
parent2c0e87db61c4f5e31585b7b0d4d6f5f7ad25a5f5 (diff)
downloadQt-6cff4b9dcc3095cb2dfc1dc9653a7bf958fe91d3.zip
Qt-6cff4b9dcc3095cb2dfc1dc9653a7bf958fe91d3.tar.gz
Qt-6cff4b9dcc3095cb2dfc1dc9653a7bf958fe91d3.tar.bz2
experiment with treating State and Transition slightly special: they are automatically added to the states resp. transitions property. This allows us to make the [...,...,...,...] list syntax superfluous.
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp10
-rw-r--r--tools/qmlconv/qmlconv.cpp8
2 files changed, 14 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 22169a5..03e6165 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -397,6 +397,16 @@ Object *ProcessAST::defineObjectBinding(int line,
}
return 0;
+ } else if(!currentProperty() && objectType == QLatin1String("State")) {
+ _stateStack.pushProperty(QLatin1String("states"), line);
+ Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer);
+ _stateStack.pop();
+ return obj;
+ } else if (!currentProperty() && objectType == QLatin1String("Transition")) {
+ _stateStack.pushProperty(QLatin1String("transitions"), line);
+ Object *obj = defineObjectBinding_helper(line, 0, objectType, initializer);
+ _stateStack.pop();
+ return obj;
}
return defineObjectBinding_helper(line, qualifiedId, objectType, initializer);
diff --git a/tools/qmlconv/qmlconv.cpp b/tools/qmlconv/qmlconv.cpp
index 6448414..f18ac75 100644
--- a/tools/qmlconv/qmlconv.cpp
+++ b/tools/qmlconv/qmlconv.cpp
@@ -88,10 +88,10 @@ public:
startDeclareProperties();
else if (xml.name() == "signals")
startDeclareSignals();
-// else if (xml.name() == "states")
-// loop(); // ignore
-// else if (xml.name() == "transitions")
-// loop(); // ignore
+ else if (xml.name() == "states")
+ loop(); // ignore
+ else if (xml.name() == "transitions")
+ loop(); // ignore
else if (knownListProperties.contains(xml.name().toString()))
startList();
else if (xml.name() == "SetProperties")