forked from qt-creator/qt-creator
Qt5InformationNodeInstanceServer: Avoid using sender()
Get rid of some unused includes. Change-Id: Ib8dd5f9672c446c5c571e79ed1f26f3f4af2b65d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -10,13 +10,10 @@
|
|||||||
#include <QMatrix4x4>
|
#include <QMatrix4x4>
|
||||||
|
|
||||||
#include "servernodeinstance.h"
|
#include "servernodeinstance.h"
|
||||||
#include "childrenchangeeventfilter.h"
|
|
||||||
#include "propertyabstractcontainer.h"
|
#include "propertyabstractcontainer.h"
|
||||||
#include "propertybindingcontainer.h"
|
#include "propertybindingcontainer.h"
|
||||||
#include "propertyvaluecontainer.h"
|
#include "propertyvaluecontainer.h"
|
||||||
#include "instancecontainer.h"
|
#include "instancecontainer.h"
|
||||||
#include "createinstancescommand.h"
|
|
||||||
#include "changefileurlcommand.h"
|
|
||||||
#include "clearscenecommand.h"
|
#include "clearscenecommand.h"
|
||||||
#include "reparentinstancescommand.h"
|
#include "reparentinstancescommand.h"
|
||||||
#include "update3dviewstatecommand.h"
|
#include "update3dviewstatecommand.h"
|
||||||
@@ -28,8 +25,7 @@
|
|||||||
#include "removepropertiescommand.h"
|
#include "removepropertiescommand.h"
|
||||||
#include "valueschangedcommand.h"
|
#include "valueschangedcommand.h"
|
||||||
#include "informationchangedcommand.h"
|
#include "informationchangedcommand.h"
|
||||||
#include "pixmapchangedcommand.h"
|
#include "imagecontainer.h"
|
||||||
#include "commondefines.h"
|
|
||||||
#include "changestatecommand.h"
|
#include "changestatecommand.h"
|
||||||
#include "childrenchangedcommand.h"
|
#include "childrenchangedcommand.h"
|
||||||
#include "completecomponentcommand.h"
|
#include "completecomponentcommand.h"
|
||||||
@@ -44,7 +40,6 @@
|
|||||||
#include "requestmodelnodepreviewimagecommand.h"
|
#include "requestmodelnodepreviewimagecommand.h"
|
||||||
#include "changeauxiliarycommand.h"
|
#include "changeauxiliarycommand.h"
|
||||||
|
|
||||||
#include "dummycontextobject.h"
|
|
||||||
#include "../editor3d/generalhelper.h"
|
#include "../editor3d/generalhelper.h"
|
||||||
#include "../editor3d/mousearea3d.h"
|
#include "../editor3d/mousearea3d.h"
|
||||||
#include "../editor3d/camerageometry.h"
|
#include "../editor3d/camerageometry.h"
|
||||||
@@ -2775,15 +2770,21 @@ void Qt5InformationNodeInstanceServer::handlePickTarget(
|
|||||||
if (checkNode->property("_pickTarget").isNull()) {
|
if (checkNode->property("_pickTarget").isNull()) {
|
||||||
if (checkRepeater) {
|
if (checkRepeater) {
|
||||||
QObject::connect(checkRepeater, &QQuick3DRepeater::objectAdded,
|
QObject::connect(checkRepeater, &QQuick3DRepeater::objectAdded,
|
||||||
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
this, [this, checkNode] {
|
||||||
|
handleDynamicAddObject(checkNode);
|
||||||
|
});
|
||||||
#if defined(QUICK3D_ASSET_UTILS_MODULE)
|
#if defined(QUICK3D_ASSET_UTILS_MODULE)
|
||||||
} else if (checkRunLoader) {
|
} else if (checkRunLoader) {
|
||||||
QObject::connect(checkRunLoader, &QQuick3DRuntimeLoader::statusChanged,
|
QObject::connect(checkRunLoader, &QQuick3DRuntimeLoader::statusChanged,
|
||||||
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
this, [this, checkNode] {
|
||||||
|
handleDynamicAddObject(checkNode);
|
||||||
|
});
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
QObject::connect(checkLoader, &QQuick3DLoader::loaded,
|
QObject::connect(checkLoader, &QQuick3DLoader::loaded,
|
||||||
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
this, [this, checkNode] {
|
||||||
|
handleDynamicAddObject(checkNode);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkNode->setProperty("_pickTarget", QVariant::fromValue(obj));
|
checkNode->setProperty("_pickTarget", QVariant::fromValue(obj));
|
||||||
@@ -2804,9 +2805,9 @@ bool Qt5InformationNodeInstanceServer::isInformationServer() const
|
|||||||
|
|
||||||
// This method should be connected to signals indicating a new object has been constructed outside
|
// This method should be connected to signals indicating a new object has been constructed outside
|
||||||
// normal scene creation. E.g. QQuick3DRepeater::objectAdded.
|
// normal scene creation. E.g. QQuick3DRepeater::objectAdded.
|
||||||
void Qt5InformationNodeInstanceServer::handleDynamicAddObject()
|
void Qt5InformationNodeInstanceServer::handleDynamicAddObject(QObject *object)
|
||||||
{
|
{
|
||||||
m_dynamicObjectConstructors.insert(sender());
|
m_dynamicObjectConstructors.insert(object);
|
||||||
m_dynamicAddObjectTimer.start();
|
m_dynamicAddObjectTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
#include "valueschangedcommand.h"
|
#include "valueschangedcommand.h"
|
||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
#include "requestmodelnodepreviewimagecommand.h"
|
#include "requestmodelnodepreviewimagecommand.h"
|
||||||
#include "propertybindingcontainer.h"
|
|
||||||
#include "propertyabstractcontainer.h"
|
|
||||||
#include "animationdriver.h"
|
#include "animationdriver.h"
|
||||||
|
|
||||||
#ifdef QUICK3D_PARTICLES_MODULE
|
#ifdef QUICK3D_PARTICLES_MODULE
|
||||||
@@ -61,7 +59,7 @@ public:
|
|||||||
void handlePickTarget(const ServerNodeInstance &instance) override;
|
void handlePickTarget(const ServerNodeInstance &instance) override;
|
||||||
|
|
||||||
bool isInformationServer() const override;
|
bool isInformationServer() const override;
|
||||||
void handleDynamicAddObject();
|
void handleDynamicAddObject(QObject *object);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleSelectionChanged(const QVariant &objs);
|
void handleSelectionChanged(const QVariant &objs);
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "quick3dnodeinstance.h"
|
#include "quick3dnodeinstance.h"
|
||||||
#include "qt5nodeinstanceserver.h"
|
|
||||||
#include "qt5informationnodeinstanceserver.h"
|
#include "qt5informationnodeinstanceserver.h"
|
||||||
|
|
||||||
#ifdef QUICK3D_MODULE
|
#ifdef QUICK3D_MODULE
|
||||||
@@ -50,16 +49,16 @@ void Quick3DNodeInstance::initialize(
|
|||||||
#endif
|
#endif
|
||||||
if (auto infoServer = qobject_cast<Qt5InformationNodeInstanceServer *>(nodeInstanceServer())) {
|
if (auto infoServer = qobject_cast<Qt5InformationNodeInstanceServer *>(nodeInstanceServer())) {
|
||||||
if (repObj) {
|
if (repObj) {
|
||||||
QObject::connect(repObj, &QQuick3DRepeater::objectAdded,
|
QObject::connect(repObj, &QQuick3DRepeater::objectAdded, infoServer,
|
||||||
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
[infoServer, obj] { infoServer->handleDynamicAddObject(obj); });
|
||||||
#if defined(QUICK3D_ASSET_UTILS_MODULE)
|
#if defined(QUICK3D_ASSET_UTILS_MODULE)
|
||||||
} else if (runLoadObj) {
|
} else if (runLoadObj) {
|
||||||
QObject::connect(runLoadObj, &QQuick3DRuntimeLoader::statusChanged,
|
QObject::connect(runLoadObj, &QQuick3DRuntimeLoader::statusChanged, infoServer,
|
||||||
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
[infoServer, obj] { infoServer->handleDynamicAddObject(obj); });
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
QObject::connect(loadObj, &QQuick3DLoader::loaded,
|
QObject::connect(loadObj, &QQuick3DLoader::loaded, infoServer,
|
||||||
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
|
[infoServer, obj] { infoServer->handleDynamicAddObject(obj); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user