summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-08-16 02:19:56 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-28 18:30:32 +0200
commit62c2061a501563e7f2929c5883f01955af0f2fc1 (patch)
tree2a9b5d5a23496c565be38059dbfc7fe42dd92f89 /src/tools/moc/moc.cpp
parentf29896840ce9e93fde9e7c61b922ef71fa0c5590 (diff)
Add automatic metatype registration for Q_PROPERTY types.
In Qt 4, the user needs to call qRegisterMetaType if the property could otherwise be read before the type is registered with the metatype system. This patch makes that unnecessary and automatic by registering it when the first read indicates that it is not yet registered instead or when QMetaProperty::userType is called before it is registered. The types which are automatically registered exclude the built-in types, which do not need to be registered, and include metatypes which are automatically declared, such as pointers to QObject derived types and containers of existing metatypes. Change-Id: I0a06d8efdcb64121618e2378366d0142fa0771f5 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index a176b87aaa..d7c08b4608 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -849,7 +849,7 @@ void Moc::generate(FILE *out)
fprintf(out, "QT_BEGIN_MOC_NAMESPACE\n");
for (i = 0; i < classList.size(); ++i) {
- Generator generator(&classList[i], metaTypes, out);
+ Generator generator(&classList[i], metaTypes, knownQObjectClasses, out);
generator.generateCode();
}