From 8c82a7bade2bef82b3cf3e38ebef2c0c4777e5fa Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 8 Dec 2011 14:15:58 +0100 Subject: [PATCH] qmlplugindump: Fix dumping of extended QGraphicsWidget. Change-Id: Id574b4ee98f7d985ef06619956b2c02cac68b553 Reviewed-by: Roberto Raggi --- tools/qmlplugindump/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index c9f6cbe..79c6fce 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -76,14 +76,15 @@ bool verbose = false; QString currentProperty; QString inObjectInstantiation; -void collectReachableMetaObjects(const QMetaObject *meta, QSet *metas) +void collectReachableMetaObjects(const QMetaObject *meta, QSet *metas, bool extended = false) { if (! meta || metas->contains(meta)) return; - // dynamic meta objects break things badly, so just ignore them + // dynamic meta objects can break things badly (like QDeclarative1VisualDataModelParts) + // but extended types are usually fine (like QDeclarative1GraphicsWidget) const QMetaObjectPrivate *mop = reinterpret_cast(meta->d.data); - if (!(mop->flags & DynamicMetaObject)) + if (extended || !(mop->flags & DynamicMetaObject)) metas->insert(meta); collectReachableMetaObjects(meta->superClass(), metas); @@ -118,7 +119,7 @@ void collectReachableMetaObjects(QObject *object, QSet *met void collectReachableMetaObjects(const QDeclarativeType *ty, QSet *metas) { - collectReachableMetaObjects(ty->metaObject(), metas); + collectReachableMetaObjects(ty->metaObject(), metas, ty->isExtendedType()); if (ty->attachedPropertiesType()) collectReachableMetaObjects(ty->attachedPropertiesType(), metas); } -- 2.7.4