qt5-qtdeclarative/0020-DesignerSupport-Don-t-skip-already-inspected-objects.patch
2021-06-01 09:49:33 -05:00

59 lines
2.1 KiB
Diff

From 5e0ba6b797ca7843609fc19d8c4c96f6f26aacd2 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@qt.io>
Date: Tue, 15 Dec 2020 12:43:40 +0200
Subject: [PATCH 20/28] DesignerSupport: Don't skip already inspected objects
Already inspected objects should not be skipped when determining their
properties, as recursive call will always have different base name for
the properties.
Internally we don't need inspectedObjects list at all anymore, but
it's kept to avoid changing API and in case the caller is interested
in inspected objects.
Fixes: QDS-3301
Change-Id: I76198b96d420e2a5ae6b13cfee65df4bce22d8f5
Pick-to: dev
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
---
.../designer/qquickdesignersupportproperties.cpp | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/quick/designer/qquickdesignersupportproperties.cpp b/src/quick/designer/qquickdesignersupportproperties.cpp
index 335795acf1..fb6a5fb324 100644
--- a/src/quick/designer/qquickdesignersupportproperties.cpp
+++ b/src/quick/designer/qquickdesignersupportproperties.cpp
@@ -137,11 +137,8 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::propert
if (inspectedObjects == nullptr)
inspectedObjects = &localObjectList;
-
- if (inspectedObjects->contains(object))
- return propertyNameList;
-
- inspectedObjects->append(object);
+ if (!inspectedObjects->contains(object))
+ inspectedObjects->append(object);
const QMetaObject *metaObject = object->metaObject();
for (int index = 0; index < metaObject->propertyCount(); ++index) {
@@ -194,12 +191,8 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::allProp
if (inspectedObjects == nullptr)
inspectedObjects = &localObjectList;
-
- if (inspectedObjects->contains(object))
- return propertyNameList;
-
- inspectedObjects->append(object);
-
+ if (!inspectedObjects->contains(object))
+ inspectedObjects->append(object);
const QMetaObject *metaObject = object->metaObject();
--
2.31.1