summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp5
-rw-r--r--src/declarative/util/qmllistmodel.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index bb7abf3..c6a5d82 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -115,7 +115,7 @@ QList<QmlError> QmlCompiler::errors() const
/*!
Returns true if \a val is a legal object id, false otherwise.
- Legal ids must start with a letter or underscore, and contain only
+ Legal ids must start with a lower-case letter or underscore, and contain only
letters, numbers and underscores.
*/
bool QmlCompiler::isValidId(const QString &val)
@@ -123,6 +123,9 @@ bool QmlCompiler::isValidId(const QString &val)
if (val.isEmpty())
return false;
+ if (val.at(0).isLetter() && !val.at(0).isLower())
+ return false;
+
QChar u(QLatin1Char('_'));
for (int ii = 0; ii < val.count(); ++ii)
if (val.at(ii) != u &&
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index 8c70539..0b19574 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -161,10 +161,10 @@ static void dump(ModelNode *node, int ind);
id: fruitDelegate
Item {
width: 200; height: 50
- Text { id: Name; text: name }
+ Text { id: name; text: name }
Text { text: '$'+cost; anchors.right: parent.right }
Row {
- anchors.top: Name.bottom
+ anchors.top: name.bottom
spacing: 5
Text { text: "Attributes:" }
Repeater {