QmlDesigner: Refactor isSubClass

IsSubClass is renamed to isBasedOn and takes now NodeMetaInfo as a
parameter. But for most cases there are is... functions as short cut.
The model is providing shortcut NodeMetaInfos too. This is done in the
sake of caching.

Task-number: QDS-7445
Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2022-08-24 13:11:33 +02:00
committed by Thomas Hartmann
parent fa033876e6
commit da36459759
65 changed files with 1536 additions and 487 deletions

View File

@@ -12,6 +12,7 @@
#include <easingcurve.h>
#include <nodeabstractproperty.h>
#include <nodelistproperty.h>
#include <nodemetainfo.h>
#include <variantproperty.h>
#include <qmlstate.h>
#include <qmltimeline.h>
@@ -181,7 +182,7 @@ QmlTimeline CurveEditorView::activeTimeline() const
QmlModelState state = currentState();
if (state.isBaseState()) {
for (const ModelNode &node : allModelNodesOfType("QtQuick.Timeline.Timeline")) {
for (const ModelNode &node : allModelNodesOfType(model()->qtQuickTimelineTimelineMetaInfo())) {
if (QmlTimeline::isValidQmlTimeline(node)) {
if (node.hasVariantProperty("enabled")
&& node.variantProperty("enabled").value().toBool())
@@ -191,7 +192,7 @@ QmlTimeline CurveEditorView::activeTimeline() const
return {};
}
for (const ModelNode &node : allModelNodesOfType("QtQuick.Timeline.Timeline")) {
for (const ModelNode &node : allModelNodesOfType(model()->qtQuickTimelineTimelineMetaInfo())) {
if (QmlTimeline::isValidQmlTimeline(node) && state.affectsModelNode(node)) {
QmlPropertyChanges propertyChanges(state.propertyChanges(node));
if (!propertyChanges.isValid())