summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-16 02:35:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-31 01:17:15 (GMT)
commit7ebd2024f49bdaf798f0beaaa35946dfa890f276 (patch)
treef68cad7641b1f0aa6242acadb480a6cb6969002e /src/tools/moc
parent29202f033c87b5efe305e606805a26c59886875b (diff)
downloadQt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.zip
Qt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.tar.gz
Qt-7ebd2024f49bdaf798f0beaaa35946dfa890f276.tar.bz2
Add FINAL attribute to Q_PROPERTY()
This will be used by the declarative module to optimize property bindings. Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/generator.cpp5
-rw-r--r--src/tools/moc/moc.cpp3
-rw-r--r--src/tools/moc/moc.h3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index e4086e6..fbc434d 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -68,7 +68,8 @@ enum PropertyFlags {
ResolveUser = 0x00200000,
Notify = 0x00400000,
Dynamic = 0x00800000,
- Constant = 0x00000400
+ Constant = 0x00000400,
+ Final = 0x00000800
};
enum MethodFlags {
AccessPrivate = 0x00,
@@ -601,6 +602,8 @@ void Generator::generateProperties()
if (p.constant)
flags |= Constant;
+ if (p.final)
+ flags |= Final;
fprintf(out, " %4d, %4d, ",
strreg(p.name),
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 66012ca..aa11d0e 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -912,6 +912,9 @@ void Moc::parseProperty(ClassDef *def)
if (l[0] == 'C' && l == "CONSTANT") {
propDef.constant = true;
continue;
+ } else if(l[0] == 'F' && l == "FINAL") {
+ propDef.final = true;
+ continue;
}
QByteArray v, v2;
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 494d53e..767f84e 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -115,10 +115,11 @@ struct FunctionDef
struct PropertyDef
{
- PropertyDef():notifyId(-1), constant(false), gspec(ValueSpec){}
+ PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec){}
QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify;
int notifyId;
bool constant;
+ bool final;
enum Specification { ValueSpec, ReferenceSpec, PointerSpec };
Specification gspec;
bool stdCppSet() const {