diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-17 06:26:20 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-17 06:26:20 (GMT) |
commit | 1c4bb7a951ae50983a38acaf633eab272d3603b9 (patch) | |
tree | 09adb6ee05b253858447192bac9991554e3675e6 /src/declarative/qml/qdeclarativecustomparser.cpp | |
parent | 0a52765f1c7fbd7d5286bcaab32cff35feb89a95 (diff) | |
download | Qt-1c4bb7a951ae50983a38acaf633eab272d3603b9.zip Qt-1c4bb7a951ae50983a38acaf633eab272d3603b9.tar.gz Qt-1c4bb7a951ae50983a38acaf633eab272d3603b9.tar.bz2 |
Allow enum constants as list element properties.
Task-number: QTBUG-5974
Diffstat (limited to 'src/declarative/qml/qdeclarativecustomparser.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativecustomparser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp index 67f0963..a3a511c 100644 --- a/src/declarative/qml/qdeclarativecustomparser.cpp +++ b/src/declarative/qml/qdeclarativecustomparser.cpp @@ -43,6 +43,7 @@ #include "qdeclarativecustomparser_p_p.h" #include "qdeclarativeparser_p.h" +#include "qdeclarativecompiler_p.h" #include <QtCore/qdebug.h> @@ -260,4 +261,15 @@ void QDeclarativeCustomParser::error(const QDeclarativeCustomParserNode& node, c exceptions << error; } +/*! + If \a script is a simply enum expression (eg. Text.AlignLeft), + returns the integer equivalent (eg. 1). + + Otherwise, returns -1. +*/ +int QDeclarativeCustomParser::evaluateEnum(const QByteArray& script) const +{ + return compiler->evaluateEnum(script); +} + QT_END_NAMESPACE |