summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-21 05:33:07 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-21 05:33:07 (GMT)
commit5beddba73a7b2890f775d45aeb2f21407f8c3d0d (patch)
tree1c7627b716a387015494cb982e63f6f668f0ed93 /src/declarative
parentbb334b925483a9b8bda70e40cfae8a2d26e43757 (diff)
downloadQt-5beddba73a7b2890f775d45aeb2f21407f8c3d0d.zip
Qt-5beddba73a7b2890f775d45aeb2f21407f8c3d0d.tar.gz
Qt-5beddba73a7b2890f775d45aeb2f21407f8c3d0d.tar.bz2
Don't allow properties in Component elements
QTBUG-10082
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 10e4746..10cd886 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -1191,6 +1191,13 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
(obj->defaultProperty->values.count() == 1 && !obj->defaultProperty->values.first()->object)))
COMPILE_EXCEPTION(obj, tr("Invalid component body specification"));
+ if (!obj->dynamicProperties.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new properties."));
+ if (!obj->dynamicSignals.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new signals."));
+ if (!obj->dynamicSlots.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions."));
+
Object *root = 0;
if (obj->defaultProperty && obj->defaultProperty->values.count())
root = obj->defaultProperty->values.first()->object;