diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2022-07-11 14:10:13 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2022-07-12 09:20:04 +0000 |
commit | d6c10e775d7535a177e069d4b86ed1330b0666dc (patch) | |
tree | d13c60151d145c13d77eca1aee8d04116dbd327a /share/qtcreator/qml/qmlpuppet/qml2puppet | |
parent | a74582a9d399d83386757ac160ce1090f97a490a (diff) |
qmlpuppet: remove qmlprivategate DesignerSupport < Qt 5.6
Task-number: QTCREATORBUG-26600
Change-Id: I629c8cd1f497ed2dd354ff461aa890a77bdc2a01
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet')
15 files changed, 94 insertions, 87 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp index 76deb3a3b3..ed9be0d3d5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp @@ -24,9 +24,11 @@ ****************************************************************************/ #include "iconrenderer.h" + #include "../editor3d/selectionboxgeometry.h" #include "../editor3d/generalhelper.h" +#include <private/qquickdesignersupport_p.h> #include <QtQml/qqmlcomponent.h> #include <QtQml/qqmlengine.h> #include <QtQml/qqmlproperty.h> @@ -63,7 +65,7 @@ IconRenderer::IconRenderer(int size, const QString &filePath, const QString &sou void IconRenderer::setupRender() { - DesignerSupport::activateDesignerMode(); + QQuickDesignerSupport::activateDesignerMode(); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) DesignerSupport::activateDesignerWindowManager(); #endif diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.h index 6488024930..f7917ba41f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.h @@ -28,11 +28,10 @@ #include <QtCore/qobject.h> #include <QtCore/qstring.h> -#include <designersupportdelegate.h> - QT_BEGIN_NAMESPACE class QQuickWindow; class QQuickItem; +class QQuickDesignerSupport; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class QQuickRenderControl; class QRhi; @@ -66,7 +65,7 @@ private: QQuickWindow *m_window = nullptr; QQuickItem *m_contentItem = nullptr; QQuickItem *m_containerItem = nullptr; - DesignerSupport m_designerSupport; + std::unique_ptr<QQuickDesignerSupport> m_designerSupport; bool m_is3D = false; int m_focusStep = 0; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index ad46fc86c3..53e42b0a71 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -80,7 +80,6 @@ #define NANOTRACE_SCOPE(cat, name) #endif -#include <designersupportdelegate.h> #include <QAbstractAnimation> #include <QDebug> #include <QDir> diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp index 8bd21d9e9f..563b3a4702 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp @@ -28,7 +28,7 @@ #include "qmlpropertychangesnodeinstance.h" #include <qmlprivategate.h> -#include <designersupportdelegate.h> +#include <private/qquickdesignersupport_p.h> namespace QmlDesigner { namespace Internal { @@ -62,7 +62,7 @@ void setAllNodesDirtyRecursive([[maybe_unused]] QQuickItem *parentItem) const QList<QQuickItem *> children = parentItem->childItems(); for (QQuickItem *childItem : children) setAllNodesDirtyRecursive(childItem); - DesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); + QQuickDesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); #endif } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5captureimagenodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5captureimagenodeinstanceserver.cpp index dccfb19d57..b6ac90a002 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5captureimagenodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5captureimagenodeinstanceserver.cpp @@ -34,6 +34,8 @@ #include <QQuickItem> #include <QQuickView> +#include <private/qquickdesignersupport_p.h> + namespace QmlDesigner { namespace { @@ -77,7 +79,7 @@ void Qt5CaptureImageNodeInstanceServer::collectItemChangesAndSendChangeCommands( if (QQuickItem *qitem = rooNodeInstance.rootQuickItem()) qitem->setClip(true); - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); QImage image = renderImage(rooNodeInstance, m_minimumSize, m_maximumSize); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp index 53c82ccc8b..1c29cfb102 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp @@ -33,6 +33,8 @@ #include <QImage> #include <QQuickView> +#include <private/qquickdesignersupport_p.h> + namespace QmlDesigner { namespace { @@ -92,7 +94,7 @@ void Qt5CapturePreviewNodeInstanceServer::collectItemChangesAndSendChangeCommand if (!inFunction) { inFunction = true; - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); QVector<CapturedDataCommand::StateData> stateDatas; stateDatas.push_back(collectStateData(rootNodeInstance(), nodeInstances(), 0)); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 12fba4d048..7d6c39e6f1 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -75,7 +75,7 @@ #include "../editor3d/linegeometry.h" #include "../editor3d/icongizmoimageprovider.h" -#include <designersupportdelegate.h> +#include <private/qquickdesignersupport_p.h> #include <qmlprivategate.h> #include <quickitemnodeinstance.h> @@ -195,7 +195,7 @@ void Qt5InformationNodeInstanceServer::createAuxiliaryQuickView(const QUrl &url, #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) viewData.window = new QQuickView(quickView()->engine(), quickView()); viewData.window->setFormat(quickView()->format()); - DesignerSupport::createOpenGLContext(static_cast<QQuickView *>(viewData.window.data())); + QQuickDesignerSupport::createOpenGLContext(static_cast<QQuickView *>(viewData.window.data())); #else viewData.renderControl = new QQuickRenderControl; viewData.window = new QQuickWindow(viewData.renderControl); @@ -211,7 +211,7 @@ void Qt5InformationNodeInstanceServer::createAuxiliaryQuickView(const QUrl &url, } #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - DesignerSupport::setRootItem(static_cast<QQuickView *>(viewData.window.data()), viewData.rootItem); + QQuickDesignerSupport::setRootItem(static_cast<QQuickView *>(viewData.window.data()), viewData.rootItem); #else viewData.window->contentItem()->setSize(viewData.rootItem->size()); viewData.window->setGeometry(0, 0, viewData.rootItem->width(), viewData.rootItem->height()); @@ -957,7 +957,7 @@ void Qt5InformationNodeInstanceServer::updateNodesRecursive(QQuickItem *item) if (item->flags() & QQuickItem::ItemHasContents) item->update(); } else { - DesignerSupport::updateDirtyNode(item); + QQuickDesignerSupport::updateDirtyNode(item); } } @@ -1394,18 +1394,18 @@ void Qt5InformationNodeInstanceServer::token(const TokenCommand &command) bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const { - static DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask - | DesignerSupport::ContentUpdateMask - | DesignerSupport::Visible - | DesignerSupport::ZValue - | DesignerSupport::OpacityValue); + static QQuickDesignerSupport::DirtyType informationsDirty = QQuickDesignerSupport::DirtyType(QQuickDesignerSupport::TransformUpdateMask + | QQuickDesignerSupport::ContentUpdateMask + | QQuickDesignerSupport::Visible + | QQuickDesignerSupport::ZValue + | QQuickDesignerSupport::OpacityValue); - if (DesignerSupport::isDirty(item, informationsDirty)) + if (QQuickDesignerSupport::isDirty(item, informationsDirty)) return true; foreach (QQuickItem *childItem, item->childItems()) { if (!hasInstanceForObject(childItem)) { - if (DesignerSupport::isDirty(childItem, informationsDirty)) + if (QQuickDesignerSupport::isDirty(childItem, informationsDirty)) return true; else if (isDirtyRecursiveForNonInstanceItems(childItem)) return true; @@ -1417,7 +1417,7 @@ bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuic bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForParentInstances(QQuickItem *item) const { - if (DesignerSupport::isDirty(item, DesignerSupport::TransformUpdateMask)) + if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::TransformUpdateMask)) return true; QQuickItem *parentItem = item->parentItem(); @@ -1883,7 +1883,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() if (!inFunction) { inFunction = true; - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); QSet<ServerNodeInstance> informationChangedInstanceSet; QVector<InstancePropertyPair> propertyChangedList; @@ -1898,7 +1898,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() else if (isDirtyRecursiveForParentInstances(item)) informationChangedInstanceSet.insert(instance); - if (DesignerSupport::isDirty(item, DesignerSupport::ParentChanged)) { + if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::ParentChanged)) { m_parentChangedSet.insert(instance); informationChangedInstanceSet.insert(instance); } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp index 8b1221a4f4..2dd18c58d8 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp @@ -36,8 +36,6 @@ #include "qt5testnodeinstanceserver.h" #include "quickitemnodeinstance.h" -#include <designersupportdelegate.h> - #if defined(Q_OS_UNIX) #include <unistd.h> #elif defined(Q_OS_WIN) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp index 18ba701ecc..9f2bb28d4a 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp @@ -33,7 +33,7 @@ #include <QQuickView> #include <QQuickWindow> -#include <designersupportdelegate.h> +#include <private/qquickdesignersupport_p.h> #include <addimportcontainer.h> #include <createscenecommand.h> #include <reparentinstancescommand.h> @@ -69,7 +69,7 @@ Qt5NodeInstanceServer::Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeIn : NodeInstanceServer(nodeInstanceClient) { if (!ViewConfig::isParticleViewMode()) - DesignerSupport::activateDesignerMode(); + QQuickDesignerSupport::activateDesignerMode(); } Qt5NodeInstanceServer::~Qt5NodeInstanceServer() @@ -106,7 +106,7 @@ void Qt5NodeInstanceServer::initializeView() QSurfaceFormat::setDefaultFormat(surfaceFormat); view->setFormat(surfaceFormat); - DesignerSupport::createOpenGLContext(view); + QQuickDesignerSupport::createOpenGLContext(view); m_qmlEngine = view->engine(); #else m_viewData.renderControl = new QQuickRenderControl; @@ -138,7 +138,7 @@ void Qt5NodeInstanceServer::setRootItem(QQuickItem *item) { m_viewData.rootItem = item; #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - DesignerSupport::setRootItem(quickView(), item); + QQuickDesignerSupport::setRootItem(quickView(), item); #else quickWindow()->setGeometry(0, 0, item->width(), item->height()); // Insert an extra item above the root to adjust root item position to 0,0 to make entire @@ -163,13 +163,13 @@ void Qt5NodeInstanceServer::resizeCanvasToRootItem() m_viewData.contentItem->setPosition(-m_viewData.rootItem->position()); #endif quickWindow()->resize(rootNodeInstance().boundingRect().size().toSize()); - DesignerSupport::addDirty(rootNodeInstance().rootQuickItem(), QQuickDesignerSupport::Size); + QQuickDesignerSupport::addDirty(rootNodeInstance().rootQuickItem(), QQuickDesignerSupport::Size); } void Qt5NodeInstanceServer::resetAllItems() { foreach (QQuickItem *item, allItems()) - DesignerSupport::resetDirty(item); + QQuickDesignerSupport::resetDirty(item); } void Qt5NodeInstanceServer::setupScene(const CreateSceneCommand &command) @@ -524,12 +524,12 @@ QImage Qt5NodeInstanceServer::grabItem([[maybe_unused]] QQuickItem *item) void Qt5NodeInstanceServer::refreshBindings() { - DesignerSupport::refreshExpressions(context()); + QQuickDesignerSupport::refreshExpressions(context()); } -DesignerSupport *Qt5NodeInstanceServer::designerSupport() +QQuickDesignerSupport *Qt5NodeInstanceServer::designerSupport() { - return &m_designerSupport; + return m_designerSupport.get(); } void Qt5NodeInstanceServer::createScene(const CreateSceneCommand &command) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h index 4c6dd2c743..6558e4f74c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h @@ -29,11 +29,11 @@ #include <QtQuick/qquickwindow.h> #include "nodeinstanceserver.h" -#include <designersupportdelegate.h> QT_BEGIN_NAMESPACE class QQuickItem; class QQmlEngine; +class QQuickDesignerSupport; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class QQuickRenderControl; class QRhi; @@ -62,7 +62,7 @@ public: QQmlEngine *engine() const override; void refreshBindings() override; - DesignerSupport *designerSupport(); + QQuickDesignerSupport *designerSupport(); void createScene(const CreateSceneCommand &command) override; void clearScene(const ClearSceneCommand &command) override; @@ -102,7 +102,7 @@ protected: private: RenderViewData m_viewData; - DesignerSupport m_designerSupport; + std::unique_ptr<QQuickDesignerSupport> m_designerSupport; QQmlEngine *m_qmlEngine = nullptr; }; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp index f61ba1a342..e2889350f1 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp @@ -33,7 +33,7 @@ #include <QQuickView> #include <QQuickItem> -#include <designersupportdelegate.h> +#include <private/qquickdesignersupport_p.h> namespace QmlDesigner { @@ -72,7 +72,7 @@ void Qt5PreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands() if (!inFunction && nodeInstanceClient()->bytesToWrite() < 10000) { inFunction = true; - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); QVector<ImageContainer> imageContainerVector; imageContainerVector.append(ImageContainer(0, renderPreviewImage(), -1)); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp index 59e7a4aa82..5ec06bf033 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp @@ -58,7 +58,7 @@ #include "dummycontextobject.h" -#include <designersupportdelegate.h> +#include <private/qquickdesignersupport_p.h> namespace QmlDesigner { @@ -74,33 +74,33 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands() if (!inFunction) { inFunction = true; - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) { bool windowDirty = false; foreach (QQuickItem *item, allItems()) { if (item) { if (Internal::QuickItemNodeInstance::unifiedRenderPath()) { - if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) { + if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::AllMask)) { windowDirty = true; break; } } else { if (hasInstanceForObject(item)) { - if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask)) + if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::ContentUpdateMask)) m_dirtyInstanceSet.insert(instanceForObject(item)); if (QQuickItem *effectParent = parentEffectItem(item)) { - if ((DesignerSupport::isDirty( + if ((QQuickDesignerSupport::isDirty( item, - DesignerSupport::DirtyType( - DesignerSupport::TransformUpdateMask - | DesignerSupport::Visible - | DesignerSupport::ContentUpdateMask))) + QQuickDesignerSupport::DirtyType( + QQuickDesignerSupport::TransformUpdateMask + | QQuickDesignerSupport::Visible + | QQuickDesignerSupport::ContentUpdateMask))) && hasInstanceForObject(effectParent)) { m_dirtyInstanceSet.insert(instanceForObject(effectParent)); } } - } else if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) { + } else if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::AllMask)) { ServerNodeInstance ancestorInstance = findNodeInstanceForItem( item->parentItem()); if (ancestorInstance.isValid()) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp index 9edb567d5b..f6f8149162 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp @@ -25,9 +25,6 @@ #include "qt5testnodeinstanceserver.h" -#include <QQuickItem> -#include <QQuickView> - #include "servernodeinstance.h" #include "childrenchangeeventfilter.h" #include "propertyabstractcontainer.h" @@ -60,7 +57,10 @@ #include "dummycontextobject.h" -#include <designersupportdelegate.h> +#include <QQuickItem> +#include <QQuickView> + +#include <private/qquickdesignersupport_p.h> namespace QmlDesigner { @@ -257,7 +257,7 @@ void Qt5TestNodeInstanceServer::removeSharedMemory(const RemoveSharedMemoryComma void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeCommands() { - DesignerSupport::polishItems(quickWindow()); + QQuickDesignerSupport::polishItems(quickWindow()); QSet<ServerNodeInstance> informationChangedInstanceSet; QVector<InstancePropertyPair> propertyChangedList; @@ -272,7 +272,7 @@ void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeComm informationChangedInstanceSet.insert(instance); - if (DesignerSupport::isDirty(item, DesignerSupport::ParentChanged)) { + if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::ParentChanged)) { parentChangedSet.insert(instance); informationChangedInstanceSet.insert(instance); } @@ -342,18 +342,18 @@ void Qt5TestNodeInstanceServer::sendChildrenChangedCommand(const QList<ServerNod bool Qt5TestNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const { - static DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask - | DesignerSupport::ContentUpdateMask - | DesignerSupport::Visible - | DesignerSupport::ZValue - | DesignerSupport::OpacityValue); + static QQuickDesignerSupport::DirtyType informationsDirty = QQuickDesignerSupport::DirtyType(QQuickDesignerSupport::TransformUpdateMask + | QQuickDesignerSupport::ContentUpdateMask + | QQuickDesignerSupport::Visible + | QQuickDesignerSupport::ZValue + | QQuickDesignerSupport::OpacityValue); - if (DesignerSupport::isDirty(item, informationsDirty)) + if (QQuickDesignerSupport::isDirty(item, informationsDirty)) return true; foreach (QQuickItem *childItem, item->childItems()) { if (!hasInstanceForObject(childItem)) { - if (DesignerSupport::isDirty(childItem, informationsDirty)) + if (QQuickDesignerSupport::isDirty(childItem, informationsDirty)) return true; else if (isDirtyRecursiveForNonInstanceItems(childItem)) return true; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 60d9060325..76fb43a598 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -31,6 +31,8 @@ #include <QtQuick/private/qquickitem_p.h> #include <QtQuick/private/qquickshadereffectsource_p.h> +#include <private/qquickdesignersupport_p.h> + #include <QQmlProperty> #include <QQmlExpression> #include <QQuickView> @@ -86,7 +88,7 @@ static QTransform transformForItem(QQuickItem *item, NodeInstanceServer *nodeIns if (isContentItem(item, nodeInstanceServer)) return QTransform(); - QTransform toParentTransform = DesignerSupport::parentTransform(item); + QTransform toParentTransform = QQuickDesignerSupport::parentTransform(item); if (item->parentItem() && !nodeInstanceServer->hasInstanceForObject(item->parentItem())) { return transformForItem(item->parentItem(), nodeInstanceServer) * toParentTransform; @@ -97,7 +99,7 @@ static QTransform transformForItem(QQuickItem *item, NodeInstanceServer *nodeIns QTransform QuickItemNodeInstance::transform() const { if (quickItem()->parentItem()) - return DesignerSupport::parentTransform(quickItem()); + return QQuickDesignerSupport::parentTransform(quickItem()); return QTransform(); } @@ -262,7 +264,7 @@ QStringList QuickItemNodeInstance::allStates() const { QStringList list; - QList<QObject*> stateList = DesignerSupport::statesForItem(quickItem()); + QList<QObject*> stateList = QQuickDesignerSupport::statesForItem(quickItem()); for (QObject *state : stateList) { QQmlProperty property(state, "name"); if (property.isValid()) @@ -277,7 +279,7 @@ void QuickItemNodeInstance::updateDirtyNode([[maybe_unused]] QQuickItem *item) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (s_unifiedRenderPath) return; - DesignerSupport::updateDirtyNode(item); + QQuickDesignerSupport::updateDirtyNode(item); #endif } @@ -319,7 +321,7 @@ void QuickItemNodeInstance::setHiddenInEditor(bool hide) QRectF QuickItemNodeInstance::contentItemBoundingBox() const { if (contentItem()) { - QTransform contentItemTransform = DesignerSupport::parentTransform(contentItem()); + QTransform contentItemTransform = QQuickDesignerSupport::parentTransform(contentItem()); return contentItemTransform.mapRect(contentItem()->boundingRect()); } @@ -367,7 +369,7 @@ static QTransform contentTransformForItem(QQuickItem *item, NodeInstanceServer * { QTransform contentTransform; if (item->parentItem() && !nodeInstanceServer->hasInstanceForObject(item->parentItem())) { - contentTransform = DesignerSupport::parentTransform(item->parentItem()); + contentTransform = QQuickDesignerSupport::parentTransform(item->parentItem()); return contentTransformForItem(item->parentItem(), nodeInstanceServer) * contentTransform; } @@ -381,7 +383,7 @@ QTransform QuickItemNodeInstance::contentTransform() const QTransform QuickItemNodeInstance::sceneTransform() const { - return DesignerSupport::windowTransform(quickItem()); + return QQuickDesignerSupport::windowTransform(quickItem()); } double QuickItemNodeInstance::opacity() const @@ -418,7 +420,7 @@ QSizeF QuickItemNodeInstance::size() const { double width; - if (DesignerSupport::isValidHeight(quickItem())) { // isValidHeight is QQuickItemPrivate::get(item)->widthValid + if (QQuickDesignerSupport::isValidHeight(quickItem())) { // isValidHeight is QQuickItemPrivate::get(item)->widthValid width = quickItem()->width(); } else { width = quickItem()->implicitWidth(); @@ -426,7 +428,7 @@ QSizeF QuickItemNodeInstance::size() const double height; - if (DesignerSupport::isValidWidth(quickItem())) { // isValidWidth is QQuickItemPrivate::get(item)->heightValid + if (QQuickDesignerSupport::isValidWidth(quickItem())) { // isValidWidth is QQuickItemPrivate::get(item)->heightValid height = quickItem()->height(); } else { height = quickItem()->implicitHeight(); @@ -438,7 +440,7 @@ QSizeF QuickItemNodeInstance::size() const static QTransform contentItemTransformForItem(QQuickItem *item, NodeInstanceServer *nodeInstanceServer) { - QTransform toParentTransform = DesignerSupport::parentTransform(item); + QTransform toParentTransform = QQuickDesignerSupport::parentTransform(item); if (item->parentItem() && !nodeInstanceServer->hasInstanceForObject(item->parentItem())) { return transformForItem(item->parentItem(), nodeInstanceServer) * toParentTransform; @@ -457,7 +459,7 @@ QTransform QuickItemNodeInstance::contentItemTransform() const int QuickItemNodeInstance::penWidth() const { - return DesignerSupport::borderWidth(quickItem()); + return QQuickDesignerSupport::borderWidth(quickItem()); } double QuickItemNodeInstance::x() const @@ -576,7 +578,7 @@ bool QuickItemNodeInstance::isRenderable() const QList<ServerNodeInstance> QuickItemNodeInstance::stateInstances() const { QList<ServerNodeInstance> instanceList; - QList<QObject*> stateList = DesignerSupport::statesForItem(quickItem()); + QList<QObject*> stateList = QQuickDesignerSupport::statesForItem(quickItem()); foreach (QObject *state, stateList) { if (state && nodeInstanceServer()->hasInstanceForObject(state)) @@ -604,7 +606,7 @@ void QuickItemNodeInstance::setHasContent(bool hasContent) m_hasContent = hasContent; } -DesignerSupport *QuickItemNodeInstance::designerSupport() const +QQuickDesignerSupport *QuickItemNodeInstance::designerSupport() const { return qt5NodeInstanceServer()->designerSupport(); } @@ -623,7 +625,7 @@ void QuickItemNodeInstance::updateDirtyNodesRecursive(QQuickItem *parentItem) co QmlPrivateGate::disableNativeTextRendering(parentItem); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - DesignerSupport::updateDirtyNode(parentItem); + QQuickDesignerSupport::updateDirtyNode(parentItem); #endif } @@ -642,7 +644,7 @@ void QuickItemNodeInstance::setAllNodesDirtyRecursive([[maybe_unused]] QQuickIte const QList<QQuickItem *> children = parentItem->childItems(); for (QQuickItem *childItem : children) setAllNodesDirtyRecursive(childItem); - DesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); + QQuickDesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); #endif } @@ -930,7 +932,7 @@ void QuickItemNodeInstance::resetProperty(const PropertyName &name) if (name == "layer.enabled" || name == "layer.effect") setAllNodesDirtyRecursive(quickItem()); - DesignerSupport::resetAnchor(quickItem(), QString::fromUtf8(name)); + QQuickDesignerSupport::resetAnchor(quickItem(), QString::fromUtf8(name)); if (name == "anchors.fill") { resetHorizontal(); @@ -964,12 +966,12 @@ void QuickItemNodeInstance::resetProperty(const PropertyName &name) bool QuickItemNodeInstance::isAnchoredByChildren() const { - return DesignerSupport::areChildrenAnchoredTo(quickItem(), quickItem()); + return QQuickDesignerSupport::areChildrenAnchoredTo(quickItem(), quickItem()); } bool QuickItemNodeInstance::hasAnchor(const PropertyName &name) const { - return DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name)); + return QQuickDesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name)); } static bool isValidAnchorName(const PropertyName &name) @@ -989,11 +991,11 @@ static bool isValidAnchorName(const PropertyName &name) QPair<PropertyName, ServerNodeInstance> QuickItemNodeInstance::anchor(const PropertyName &name) const { - if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name))) + if (!isValidAnchorName(name) || !QQuickDesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name))) return ObjectNodeInstance::anchor(name); QPair<QString, QObject*> nameObjectPair = - DesignerSupport::anchorLineTarget(quickItem(), QString::fromUtf8(name), context()); + QQuickDesignerSupport::anchorLineTarget(quickItem(), QString::fromUtf8(name), context()); QObject *targetObject = nameObjectPair.second; PropertyName targetName = nameObjectPair.first.toUtf8(); @@ -1013,7 +1015,7 @@ bool QuickItemNodeInstance::isAnchoredBySibling() const if (quickItem()->parentItem()) { foreach (QQuickItem *siblingItem, quickItem()->parentItem()->childItems()) { // search in siblings for a anchor to this item if (siblingItem) { - if (DesignerSupport::isAnchoredTo(siblingItem, quickItem())) + if (QQuickDesignerSupport::isAnchoredTo(siblingItem, quickItem())) return true; } } @@ -1049,13 +1051,13 @@ void QuickItemNodeInstance::markRepeaterParentDirty() const // If a Repeater instance was changed in any way, the parent must be marked dirty to rerender it const QByteArray type("QQuickRepeater"); if (ServerNodeInstance::isSubclassOf(item, type)) - DesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); + QQuickDesignerSupport::addDirty(parentItem, QQuickDesignerSupport::Content); // Repeater's parent must also be dirtied when a child of a repeater was changed if (ServerNodeInstance::isSubclassOf(parentItem, type)) { QQuickItem *parentsParent = parentItem->parentItem(); if (parentsParent) - DesignerSupport::addDirty(parentsParent, QQuickDesignerSupport::Content); + QQuickDesignerSupport::addDirty(parentsParent, QQuickDesignerSupport::Content); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h index 50cf494e8e..f2ee6f3aac 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h @@ -30,7 +30,10 @@ #include "objectnodeinstance.h" #include <QQuickItem> -#include <designersupportdelegate.h> + +QT_BEGIN_NAMESPACE +class QQuickDesignerSupport; +QT_END_NAMESPACE namespace QmlDesigner { namespace Internal { @@ -115,7 +118,7 @@ protected: void setMovable(bool movable); void setResizable(bool resizable); void setHasContent(bool hasContent); - DesignerSupport *designerSupport() const; + QQuickDesignerSupport *designerSupport() const; Qt5NodeInstanceServer *qt5NodeInstanceServer() const; void updateDirtyNodesRecursive(QQuickItem *parentItem) const; void updateAllDirtyNodesRecursive(QQuickItem *parentItem) const; |