diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-23 08:46:23 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-23 08:46:23 (GMT) |
commit | 2c64d13886d3e9b165c61af3094b1df9a6b53a63 (patch) | |
tree | b73dbbc6ab27cf47a5a785626751d16c65e66734 | |
parent | 80f14fb7b13eac4b6ae4cdf11795723254103a58 (diff) | |
parent | 21af9f0be1dd0d9be6c3767074fdfbd54e3b8372 (diff) | |
download | Qt-2c64d13886d3e9b165c61af3094b1df9a6b53a63.zip Qt-2c64d13886d3e9b165c61af3094b1df9a6b53a63.tar.gz Qt-2c64d13886d3e9b165c61af3094b1df9a6b53a63.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team:
qmlplugindump: For extended types, remove exports of the base object.
qmlplugindump: Build debug version if possible.
-rw-r--r-- | tools/qmlplugindump/main.cpp | 47 | ||||
-rw-r--r-- | tools/qmlplugindump/qmlplugindump.pro | 17 |
2 files changed, 44 insertions, 20 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 403e3b6..b414c3f 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -160,29 +160,36 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, collectReachableMetaObjects(ty, &metas); } - // Adjust ids of extended objects. - // The chain ends up being: - // __extended__.originalname - the base object - // __extension_0_.originalname - first extension - // .. - // __extension_n-2_.originalname - second to last extension - // originalname - last extension - // ### does this actually work for multiple extensions? it seems like the prototypes might be wrong - foreach (const QByteArray &extendedCpp, extensions.keys()) { - cppToId.remove(extendedCpp); - const QByteArray extendedId = convertToId(extendedCpp); - cppToId.insert(extendedCpp, "__extended__." + extendedId); - QSet<QByteArray> extensionCppNames = extensions.value(extendedCpp); - int c = 0; + // Adjust exports of the base object if there are extensions. + // For each export of a base object there can be a single extension object overriding it. + // Example: QDeclarativeGraphicsWidget overrides the QtQuick/QGraphicsWidget export + // of QGraphicsWidget. + foreach (const QByteArray &baseCpp, extensions.keys()) { + QSet<const QDeclarativeType *> baseExports = qmlTypesByCppName.value(baseCpp); + + const QSet<QByteArray> extensionCppNames = extensions.value(baseCpp); foreach (const QByteArray &extensionCppName, extensionCppNames) { - if (c != extensionCppNames.size() - 1) { - QByteArray adjustedName = QString("__extension__%1.%2").arg(QString::number(c), QString(extendedId)).toAscii(); - cppToId.insert(extensionCppName, adjustedName); - } else { - cppToId.insert(extensionCppName, extendedId); + const QSet<const QDeclarativeType *> extensionExports = qmlTypesByCppName.value(extensionCppName); + + // remove extension exports from base imports + // unfortunately the QDeclarativeType pointers don't match, so can't use QSet::substract + QSet<const QDeclarativeType *> newBaseExports; + foreach (const QDeclarativeType *baseExport, baseExports) { + bool match = false; + foreach (const QDeclarativeType *extensionExport, extensionExports) { + if (baseExport->module() == extensionExport->module() + && baseExport->majorVersion() == extensionExport->majorVersion() + && baseExport->minorVersion() == extensionExport->minorVersion()) { + match = true; + break; + } + } + if (!match) + newBaseExports.insert(baseExport); } - ++c; + baseExports = newBaseExports; } + qmlTypesByCppName[baseCpp] = baseExports; } // find even more QMetaObjects by instantiating QML types and running diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro index 53827e2..e9fcdc7 100644 --- a/tools/qmlplugindump/qmlplugindump.pro +++ b/tools/qmlplugindump/qmlplugindump.pro @@ -16,5 +16,22 @@ HEADERS += \ OTHER_FILES += Info.plist macx: QMAKE_INFO_PLIST = Info.plist +# Build debug and release versions of the tool on Windows - +# if debug and release versions of Qt have been built. +!build_pass:win32 { + CONFIG -= debug release debug_and_release build_all + + contains(QT_CONFIG,debug):contains(QT_CONFIG,release) { + CONFIG += debug_and_release build_all + } else { + contains(QT_CONFIG,debug): CONFIG += debug + contains(QT_CONFIG,release): CONFIG += release + } +} + +CONFIG(debug, debug|release) { + win32: TARGET = $$join(TARGET,,,d) +} + target.path = $$[QT_INSTALL_BINS] INSTALLS += target |