src/tools/moc/moc.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
--- a/src/tools/moc/moc.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/tools/moc/moc.cpp	Mon May 03 13:17:34 2010 +0300
@@ -658,6 +658,9 @@
                 case Q_PRIVATE_SLOT_TOKEN:
                     parseSlotInPrivate(&def, access);
                     break;
+                case Q_PRIVATE_PROPERTY_TOKEN:
+                    parsePrivateProperty(&def);
+                    break;
                 case ENUM: {
                     EnumDef enumDef;
                     if (parseEnum(&enumDef))
@@ -872,11 +875,8 @@
     }
 }
 
-
-void Moc::parseProperty(ClassDef *def)
+void Moc::createPropertyDef(PropertyDef &propDef)
 {
-    next(LPAREN);
-    PropertyDef propDef;
     QByteArray type = parseType().name;
     if (type.isEmpty())
         error();
@@ -964,7 +964,6 @@
             error(2);
         }
     }
-    next(RPAREN);
     if (propDef.read.isNull()) {
         QByteArray msg;
         msg += "Property declaration ";
@@ -988,6 +987,41 @@
         propDef.constant = false;
         warning(msg.constData());
     }
+}
+
+void Moc::parseProperty(ClassDef *def)
+{
+    next(LPAREN);
+    PropertyDef propDef;
+    createPropertyDef(propDef);
+    next(RPAREN);
+
+
+    if(!propDef.notify.isEmpty())
+        def->notifyableProperties++;
+    def->propertyList += propDef;
+}
+
+void Moc::parsePrivateProperty(ClassDef *def)
+{
+    next(LPAREN);
+    PropertyDef propDef;
+    next(IDENTIFIER);
+    propDef.inPrivateClass = lexem();
+    while (test(SCOPE)) {
+        propDef.inPrivateClass += lexem();
+        next(IDENTIFIER);
+        propDef.inPrivateClass += lexem();
+    }
+    // also allow void functions
+    if (test(LPAREN)) {
+        next(RPAREN);
+        propDef.inPrivateClass += "()";
+    }
+
+    next(COMMA);
+
+    createPropertyDef(propDef);
 
     if(!propDef.notify.isEmpty())
         def->notifyableProperties++;