forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp Change-Id: Ieda6242b845387100022b08251283891fb0fbda7
This commit is contained in:
@@ -14,7 +14,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if (NOT QT_CREATOR_API_DEFINED)
|
||||
# standalone build
|
||||
set(DESTINATION DESTINATION $ENV{QDS_PUPPET_DESTINATION})
|
||||
set(DESTINATION DESTINATION .)
|
||||
include(QtCreatorIDEBranding)
|
||||
include(QtCreatorAPI)
|
||||
endif()
|
||||
@@ -39,13 +39,7 @@ add_qtc_executable(qml2puppet
|
||||
qmlpuppet.qrc
|
||||
)
|
||||
|
||||
set(qml2puppet_suffix $ENV{QDS_PUPPET_VERSION})
|
||||
if (NOT qml2puppet_suffix)
|
||||
set(qml2puppet_suffix ${IDE_VERSION})
|
||||
endif()
|
||||
extend_qtc_executable(qml2puppet
|
||||
PROPERTIES OUTPUT_NAME qml2puppet-${qml2puppet_suffix}
|
||||
)
|
||||
set_target_properties(qml2puppet PROPERTIES OUTPUT_NAME qml2puppet-${IDE_VERSION})
|
||||
|
||||
extend_qtc_executable(qml2puppet
|
||||
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.0.0
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
#include "gridgeometry.h"
|
||||
|
||||
#if QT_VERSION_MAJOR == 6 && QT_VERSION_MINOR == 4
|
||||
#include <private/qssgrendergeometry_p.h>
|
||||
#endif
|
||||
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
|
||||
@@ -82,6 +86,34 @@ void GridGeometry::doUpdateGeometry()
|
||||
QVector3D(vertexPtr[lastIndex][0], vertexPtr[lastIndex][1], 0.0));
|
||||
}
|
||||
|
||||
#if QT_VERSION_MAJOR == 6 && QT_VERSION_MINOR == 4
|
||||
QSSGRenderGraphObject *GridGeometry::updateSpatialNode(QSSGRenderGraphObject *node)
|
||||
{
|
||||
if (!node) {
|
||||
markAllDirty();
|
||||
auto geometryNode = new QSSGRenderGeometry();
|
||||
node = geometryNode;
|
||||
emit geometryNodeDirty();
|
||||
|
||||
// This is a work around for the issue of incorrect geometry objects getting matched for
|
||||
// cached mesh data in QSSGBufferManager::loadRenderMesh in QtQuick3D in 6.4 (see QDS-8516).
|
||||
// Each setting of stride value increments the generation id of the geometry node.
|
||||
// By incrementing generation id by different amounts for each grid geometry node we have,
|
||||
// we can ensure QSSGBufferManager cache never matches wrong mesh data.
|
||||
// The cache should be cleared of old objects after they are unused for one frame,
|
||||
// and we use 4 grid objects in total, so max of 8 different generation ids should ensure no
|
||||
// invalid cache matches.
|
||||
static int dirtyCount = 0;
|
||||
if (++dirtyCount > 8)
|
||||
dirtyCount = 0;
|
||||
for (int i = 0; i < dirtyCount; ++i)
|
||||
geometryNode->setStride(stride());
|
||||
}
|
||||
|
||||
return QQuick3DGeometry::updateSpatialNode(node);
|
||||
}
|
||||
#endif
|
||||
|
||||
void GridGeometry::fillVertexData(QByteArray &vertexData)
|
||||
{
|
||||
const int numSubdivs = 1; // number of subdivision lines (i.e. lines between main grid lines)
|
||||
|
||||
@@ -39,6 +39,9 @@ signals:
|
||||
|
||||
protected:
|
||||
void doUpdateGeometry() override;
|
||||
#if QT_VERSION_MAJOR == 6 && QT_VERSION_MINOR == 4
|
||||
QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void fillVertexData(QByteArray &vertexData);
|
||||
|
||||
@@ -129,7 +129,7 @@ void IconRenderer::setupRender()
|
||||
void IconRenderer::startCreateIcon()
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
m_designerSupport.refFromEffectItem(m_containerItem, false);
|
||||
m_designerSupport->refFromEffectItem(m_containerItem, false);
|
||||
#endif
|
||||
QQuickDesignerSupportItems::disableNativeTextRendering(m_containerItem);
|
||||
|
||||
@@ -202,7 +202,7 @@ void IconRenderer::render(const QString &fileName)
|
||||
QRect rect(QPoint(), m_contentItem->size().toSize());
|
||||
QImage renderImage;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
renderImage = m_designerSupport.renderImageForItem(m_containerItem, rect, rect.size());
|
||||
renderImage = m_designerSupport->renderImageForItem(m_containerItem, rect, rect.size());
|
||||
#else
|
||||
m_renderControl->polishItems();
|
||||
m_renderControl->beginFrame();
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <QtCore/qobject.h>
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QQuickWindow;
|
||||
class QQuickItem;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QQuickView>
|
||||
#include <QDropEvent>
|
||||
#include <QMimeData>
|
||||
#include <QMatrix4x4>
|
||||
|
||||
#include "servernodeinstance.h"
|
||||
#include "childrenchangeeventfilter.h"
|
||||
@@ -427,6 +428,9 @@ void Qt5InformationNodeInstanceServer::getNodeAtPos(const QPointF &pos)
|
||||
if (!qFuzzyCompare(planePos.z(), -1.f) && qAbs(planePos.x()) < limit && qAbs(planePos.y()) < limit)
|
||||
pos3d = {planePos.x(), 0, planePos.y()};
|
||||
}
|
||||
if (auto rootScene = qobject_cast<QQuick3DNode *>(m_active3DScene))
|
||||
pos3d = rootScene->sceneTransform().inverted().map(pos3d);
|
||||
|
||||
QVariantList data;
|
||||
data.append(instanceId);
|
||||
data.append(pos3d);
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include "qt5testnodeinstanceserver.h"
|
||||
#include "quickitemnodeinstance.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <private/qquickdesignersupport_p.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
#include <unistd.h>
|
||||
#elif defined(Q_OS_WIN)
|
||||
@@ -41,7 +45,7 @@ Qt5NodeInstanceClientProxy::Qt5NodeInstanceClientProxy(QObject *parent) :
|
||||
Internal::QuickItemNodeInstance::enableUnifiedRenderPath(true);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
else
|
||||
DesignerSupport::activateDesignerWindowManager();
|
||||
QQuickDesignerSupport::activateDesignerWindowManager();
|
||||
#endif
|
||||
|
||||
if (QCoreApplication::arguments().at(1) == QLatin1String("--readcapturedstream")) {
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace QmlDesigner {
|
||||
|
||||
Qt5NodeInstanceServer::Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient)
|
||||
: NodeInstanceServer(nodeInstanceClient)
|
||||
, m_designerSupport(new QQuickDesignerSupport)
|
||||
{
|
||||
if (!ViewConfig::isParticleViewMode())
|
||||
QQuickDesignerSupport::activateDesignerMode();
|
||||
|
||||
@@ -285,7 +285,15 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
|
||||
if (object == nullptr)
|
||||
object = new QQuickItem;
|
||||
} else {
|
||||
object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject", 2, 0, nodeInstanceServer->context());
|
||||
object = Internal::ObjectNodeInstance::createPrimitive("QML/QtObject",
|
||||
1,
|
||||
0,
|
||||
nodeInstanceServer->context());
|
||||
if (object == nullptr) //Fallback for Qt 5
|
||||
object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject",
|
||||
2,
|
||||
0,
|
||||
nodeInstanceServer->context());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
#include <private/qquick3drepeater_p.h>
|
||||
#endif
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
#include <private/qqmlvaluetype_p.h>
|
||||
#endif
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
@@ -52,10 +56,10 @@ bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
|
||||
return QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName);
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
|
||||
static void addToPropertyNameListIfNotBlackListed(
|
||||
PropertyNameList *propertyNameList, const QQuickQQuickDesignerSupport::PropertyName &propertyName)
|
||||
PropertyNameList *propertyNameList, const QQuickDesignerSupport::PropertyName &propertyName)
|
||||
{
|
||||
if (!QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName))
|
||||
propertyNameList->append(propertyName);
|
||||
@@ -66,7 +70,7 @@ PropertyNameList allPropertyNamesInline(QObject *object,
|
||||
QObjectList *inspectedObjects = nullptr,
|
||||
int depth = 0)
|
||||
{
|
||||
QQuickQQuickDesignerSupport::PropertyNameList propertyNameList;
|
||||
QQuickDesignerSupport::PropertyNameList propertyNameList;
|
||||
|
||||
QObjectList localObjectList;
|
||||
|
||||
@@ -100,7 +104,7 @@ PropertyNameList allPropertyNamesInline(QObject *object,
|
||||
propertyNameList.append(
|
||||
allPropertyNamesInline(childObject,
|
||||
baseName
|
||||
+ QQuickQQuickDesignerSupport::PropertyName(
|
||||
+ QQuickDesignerSupport::PropertyName(
|
||||
metaProperty.name())
|
||||
+ '.',
|
||||
inspectedObjects,
|
||||
@@ -110,18 +114,18 @@ PropertyNameList allPropertyNamesInline(QObject *object,
|
||||
= QQmlGadgetPtrWrapper::instance(qmlEngine(object), metaProperty.userType())) {
|
||||
valueType->setValue(metaProperty.read(object));
|
||||
propertyNameList.append(baseName
|
||||
+ QQuickQQuickDesignerSupport::PropertyName(metaProperty.name()));
|
||||
+ QQuickDesignerSupport::PropertyName(metaProperty.name()));
|
||||
propertyNameList.append(
|
||||
allPropertyNamesInline(valueType,
|
||||
baseName
|
||||
+ QQuickQQuickDesignerSupport::PropertyName(metaProperty.name())
|
||||
+ QQuickDesignerSupport::PropertyName(metaProperty.name())
|
||||
+ '.',
|
||||
inspectedObjects,
|
||||
depth + 1));
|
||||
} else {
|
||||
addToPropertyNameListIfNotBlackListed(&propertyNameList,
|
||||
baseName
|
||||
+ QQuickQQuickDesignerSupport::PropertyName(
|
||||
+ QQuickDesignerSupport::PropertyName(
|
||||
metaProperty.name()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user