summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-03 09:41:38 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-08-03 09:41:38 +1000
commit98bb5c8cbdef20d060c45a399068580eacf93ae4 (patch)
treeb16faf2c64bb76945b75c4000c234457e5261a6e /src/tools/moc/moc.cpp
parentaa9cf406d62004519ad54596e1c391f9a6439210 (diff)
parent5aed3db0a4084f470769ad4b965001f17b878c79 (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 0ba7d538b..74b1a67d1 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -908,6 +908,15 @@ void Moc::parseProperty(ClassDef *def)
propDef.name = lexem();
while (test(IDENTIFIER)) {
QByteArray l = lexem();
+
+ if (l[0] == 'C' && l == "CONSTANT") {
+ propDef.constant = true;
+ continue;
+ } else if(l[0] == 'F' && l == "FINAL") {
+ propDef.final = true;
+ continue;
+ }
+
QByteArray v, v2;
if (test(LPAREN)) {
v = lexemUntil(RPAREN);
@@ -963,6 +972,23 @@ void Moc::parseProperty(ClassDef *def)
msg += " has no READ accessor function. The property will be invalid.";
warning(msg.constData());
}
+ if (propDef.constant && !propDef.write.isNull()) {
+ QByteArray msg;
+ msg += "Property declaration ";
+ msg += propDef.name;
+ msg += " is both WRITEable and CONSTANT. CONSTANT will be ignored.";
+ propDef.constant = false;
+ warning(msg.constData());
+ }
+ if (propDef.constant && !propDef.notify.isNull()) {
+ QByteArray msg;
+ msg += "Property declaration ";
+ msg += propDef.name;
+ msg += " is both NOTIFYable and CONSTANT. CONSTANT will be ignored.";
+ propDef.constant = false;
+ warning(msg.constData());
+ }
+
if(!propDef.notify.isEmpty())
def->notifyableProperties++;