Merge remote-tracking branch 'origin/4.11'

Change-Id: Ieb0bb1ebab9a5efb42d15bbeac2cd4c46a6de962
This commit is contained in:
Eike Ziller
2019-12-18 09:02:56 +01:00
30 changed files with 231 additions and 43 deletions

View File

@@ -30,6 +30,7 @@ HEADERS += $$PWD/changeselectioncommand.h
HEADERS += $$PWD/drop3dlibraryitemcommand.h
HEADERS += $$PWD/update3dviewstatecommand.h
HEADERS += $$PWD/enable3dviewcommand.h
HEADERS += $$PWD/view3dclosedcommand.h
SOURCES += $$PWD/synchronizecommand.cpp
SOURCES += $$PWD/debugoutputcommand.cpp
@@ -61,3 +62,4 @@ SOURCES += $$PWD/changeselectioncommand.cpp
SOURCES += $$PWD/drop3dlibraryitemcommand.cpp
SOURCES += $$PWD/update3dviewstatecommand.cpp
SOURCES += $$PWD/enable3dviewcommand.cpp
SOURCES += $$PWD/view3dclosedcommand.cpp

View File

@@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "view3dclosedcommand.h"
namespace QmlDesigner {
View3DClosedCommand::View3DClosedCommand() = default;
QDataStream &operator<<(QDataStream &out, const View3DClosedCommand &/*command*/)
{
return out;
}
QDataStream &operator>>(QDataStream &in, View3DClosedCommand &/*command*/)
{
return in;
}
QDebug operator<<(QDebug debug, const View3DClosedCommand &/*command*/)
{
return debug.nospace() << "View3DClosedCommand()";
}
} // namespace QmlDesigner

View File

@@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <qmetatype.h>
#include <QDataStream>
#include <QDebug>
namespace QmlDesigner {
class View3DClosedCommand
{
public:
View3DClosedCommand();
};
QDataStream &operator<<(QDataStream &out, const View3DClosedCommand &command);
QDataStream &operator>>(QDataStream &in, View3DClosedCommand &command);
QDebug operator<<(QDebug debug, const View3DClosedCommand &command);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::View3DClosedCommand)

View File

@@ -71,6 +71,7 @@
#include "puppetalivecommand.h"
#include "changeselectioncommand.h"
#include "drop3dlibraryitemcommand.h"
#include "view3dclosedcommand.h"
namespace QmlDesigner {
@@ -261,6 +262,11 @@ void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemComman
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command)
{
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::flush()
{
}

View File

@@ -60,6 +60,7 @@ class ChangeNodeSourceCommand;
class EndPuppetCommand;
class ChangeSelectionCommand;
class Drop3DLibraryItemCommand;
class View3DClosedCommand;
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
{
@@ -80,6 +81,7 @@ public:
void puppetAlive(const PuppetAliveCommand &command);
void selectionChanged(const ChangeSelectionCommand &command) override;
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
void view3DClosed(const View3DClosedCommand &command) override;
void flush() override;
void synchronizeWithClientProcess() override;

View File

@@ -42,6 +42,7 @@ class DebugOutputCommand;
class PuppetAliveCommand;
class ChangeSelectionCommand;
class Drop3DLibraryItemCommand;
class View3DClosedCommand;
class NodeInstanceClientInterface
{
@@ -57,6 +58,7 @@ public:
virtual void debugOutput(const DebugOutputCommand &command) = 0;
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0;
virtual void view3DClosed(const View3DClosedCommand &command) = 0;
virtual void flush() {}
virtual void synchronizeWithClientProcess() {}

View File

@@ -63,12 +63,13 @@
#include "endpuppetcommand.h"
#include "debugoutputcommand.h"
#include "puppetalivecommand.h"
#include "view3dclosedcommand.h"
#include <enumeration.h>
namespace QmlDesigner {
static bool isRegistered=false;
static bool isRegistered = false;
NodeInstanceServerInterface::NodeInstanceServerInterface(QObject *parent) :
QObject(parent)
@@ -205,6 +206,9 @@ void NodeInstanceServerInterface::registerCommands()
qRegisterMetaType<PuppetAliveCommand>("PuppetAliveCommand");
qRegisterMetaTypeStreamOperators<PuppetAliveCommand>("PuppetAliveCommand");
qRegisterMetaType<View3DClosedCommand>("View3DClosedCommand");
qRegisterMetaTypeStreamOperators<View3DClosedCommand>("View3DClosedCommand");
}
}

View File

@@ -571,11 +571,30 @@ QVariant ObjectNodeInstance::property(const PropertyName &name) const
return property.read();
}
void ObjectNodeInstance::ensureVector3DDotProperties(PropertyNameList &list) const
{
const PropertyNameList properties = { "rotation", "scale", "pivot" };
for (const auto &property : properties) {
if (list.contains(property) && instanceType(property) == "QVector3D") {
const PropertyNameList dotProperties = { "x", "y", "z" };
for (const auto &dotProperty : dotProperties) {
const PropertyName dotPropertyName = property + "." + dotProperty;
if (!list.contains(dotPropertyName))
list.append(dotPropertyName);
}
}
}
}
PropertyNameList ObjectNodeInstance::propertyNames() const
{
PropertyNameList list;
if (isValid())
return QmlPrivateGate::allPropertyNames(object());
return PropertyNameList();
list = QmlPrivateGate::allPropertyNames(object());
ensureVector3DDotProperties(list);
return list;
}
QString ObjectNodeInstance::instanceType(const PropertyName &name) const

View File

@@ -209,6 +209,7 @@ protected:
static QVariant enumationValue(const Enumeration &enumeration);
void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance);
void ensureVector3DDotProperties(PropertyNameList &list) const;
private:
QString m_id;

View File

@@ -61,6 +61,7 @@
#include "removesharedmemorycommand.h"
#include "objectnodeinstance.h"
#include "drop3dlibraryitemcommand.h"
#include "view3dclosedcommand.h"
#include "dummycontextobject.h"
#include "../editor3d/generalhelper.h"
@@ -97,6 +98,10 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event)
} break;
case QEvent::Close: {
nodeInstanceClient()->view3DClosed(View3DClosedCommand());
} break;
default:
break;
}