Commit 1312a042 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Add component complete feature

This notifies the views if the instance has be really instanced.
parent c04797fd
...@@ -435,6 +435,11 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const QString & ...@@ -435,6 +435,11 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const QString &
} }
} }
void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeList)
{
}
void FormEditorView::customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data) void FormEditorView::customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data)
{ {
if (identifier == "__start rewriter transaction__") { if (identifier == "__start rewriter transaction__") {
......
...@@ -101,6 +101,8 @@ public: ...@@ -101,6 +101,8 @@ public:
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data); void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data); void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
double margins() const; double margins() const;
double spacing() const; double spacing() const;
void deActivateItemCreator(); void deActivateItemCreator();
......
...@@ -161,6 +161,7 @@ void ComponentView::bindingPropertiesChanged(const QList<BindingProperty>& /*pro ...@@ -161,6 +161,7 @@ void ComponentView::bindingPropertiesChanged(const QList<BindingProperty>& /*pro
void ComponentView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/) {} void ComponentView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/) {}
void ComponentView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/) {} void ComponentView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/) {}
void ComponentView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &/*propertyList*/) {}; void ComponentView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &/*propertyList*/) {};
void ComponentView::instancesCompleted(const QVector<ModelNode> &/*completedNodeList*/) {}
void ComponentView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeList*/, void ComponentView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeList*/,
...@@ -170,7 +171,6 @@ void ComponentView::fileUrlChanged(const QUrl &/*oldUrl*/, const QUrl &/*newUrl* ...@@ -170,7 +171,6 @@ void ComponentView::fileUrlChanged(const QUrl &/*oldUrl*/, const QUrl &/*newUrl*
void ComponentView::nodeOrderChanged(const NodeListProperty &/*listProperty*/, const ModelNode & /*movedNode*/, int /*oldIndex*/) {} void ComponentView::nodeOrderChanged(const NodeListProperty &/*listProperty*/, const ModelNode & /*movedNode*/, int /*oldIndex*/) {}
void ComponentView::importsChanged() {}
void ComponentView::auxiliaryDataChanged(const ModelNode &/*node*/, const QString &/*name*/, const QVariant &/*data*/) {} void ComponentView::auxiliaryDataChanged(const ModelNode &/*node*/, const QString &/*name*/, const QVariant &/*data*/) {}
......
...@@ -69,6 +69,7 @@ public: ...@@ -69,6 +69,7 @@ public:
void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion); void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList); const QList<ModelNode> &lastSelectedNodeList);
...@@ -77,8 +78,6 @@ public: ...@@ -77,8 +78,6 @@ public:
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex); void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
void importsChanged();
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data); void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data); void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
......
...@@ -65,6 +65,11 @@ void DesignDocumentControllerView::instancePropertyChange(const QList<QPair<Mode ...@@ -65,6 +65,11 @@ void DesignDocumentControllerView::instancePropertyChange(const QList<QPair<Mode
{ {
} }
void DesignDocumentControllerView::instancesCompleted(const QVector<ModelNode> &/*completedNodeList*/)
{
}
static QStringList arrayToStringList(const QByteArray &byteArray) static QStringList arrayToStringList(const QByteArray &byteArray)
{ {
QString str(QString::fromLatin1(byteArray)); QString str(QString::fromLatin1(byteArray));
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
virtual void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex); virtual void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
virtual void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); virtual void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
ModelNode insertModel(const ModelNode &modelNode) ModelNode insertModel(const ModelNode &modelNode)
{ return m_modelMerger.insertModel(modelNode); } { return m_modelMerger.insertModel(modelNode); }
......
...@@ -198,6 +198,10 @@ void NavigatorView::instancePropertyChange(const QList<QPair<ModelNode, QString> ...@@ -198,6 +198,10 @@ void NavigatorView::instancePropertyChange(const QList<QPair<ModelNode, QString>
{ {
} }
void NavigatorView::instancesCompleted(const QVector<ModelNode> &/*completedNodeList*/)
{
}
void NavigatorView::nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &node, int oldIndex) void NavigatorView::nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &node, int oldIndex)
{ {
if (m_treeModel->isInTree(node)) if (m_treeModel->isInTree(node))
......
...@@ -82,6 +82,7 @@ public: ...@@ -82,6 +82,7 @@ public:
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data); void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
private slots: private slots:
// void handleChangedItem(QStandardItem * item); // void handleChangedItem(QStandardItem * item);
......
...@@ -119,7 +119,9 @@ SOURCES += $$PWD/model/abstractview.cpp \ ...@@ -119,7 +119,9 @@ SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/instances/addimportcommand.cpp \ $$PWD/instances/addimportcommand.cpp \
$$PWD/instances/childrenchangedcommand.cpp \ $$PWD/instances/childrenchangedcommand.cpp \
$$PWD/instances/statepreviewimagechangedcommand.cpp \ $$PWD/instances/statepreviewimagechangedcommand.cpp \
$$PWD/instances/imagecontainer.cpp $$PWD/instances/imagecontainer.cpp \
$$PWD/instances/completecomponentcommand.cpp \
$$PWD/instances/componentcompletedcommand.cpp
HEADERS += $$PWD/include/corelib_global.h \ HEADERS += $$PWD/include/corelib_global.h \
$$PWD/include/abstractview.h \ $$PWD/include/abstractview.h \
$$PWD/include/nodeinstanceview.h \ $$PWD/include/nodeinstanceview.h \
...@@ -237,7 +239,9 @@ HEADERS += $$PWD/include/corelib_global.h \ ...@@ -237,7 +239,9 @@ HEADERS += $$PWD/include/corelib_global.h \
$$PWD/instances/addimportcommand.h \ $$PWD/instances/addimportcommand.h \
$$PWD/instances/childrenchangedcommand.h \ $$PWD/instances/childrenchangedcommand.h \
$$PWD/instances/statepreviewimagechangedcommand.h \ $$PWD/instances/statepreviewimagechangedcommand.h \
$$PWD/instances/imagecontainer.h $$PWD/instances/imagecontainer.h \
$$PWD/instances/completecomponentcommand.h \
$$PWD/instances/componentcompletedcommand.h
contains(CONFIG, plugin) { contains(CONFIG, plugin) {
# If core.pri has been included in the qmldesigner plugin # If core.pri has been included in the qmldesigner plugin
SOURCES += $$PWD/model/basetexteditmodifier.cpp SOURCES += $$PWD/model/basetexteditmodifier.cpp
......
...@@ -107,6 +107,7 @@ public: ...@@ -107,6 +107,7 @@ public:
void emitCustomNotification(const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data); void emitCustomNotification(const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
void emitInstancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void emitInstancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void emitInstancesCompleted(const QVector<ModelNode> &nodeList);
virtual void modelAttached(Model *model); virtual void modelAttached(Model *model);
virtual void modelAboutToBeDetached(Model *model); virtual void modelAboutToBeDetached(Model *model);
...@@ -124,6 +125,8 @@ public: ...@@ -124,6 +125,8 @@ public:
virtual void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion) = 0; virtual void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion) = 0;
virtual void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList) = 0; virtual void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList) = 0;
virtual void instancesCompleted(const QVector<ModelNode> &completedNodeList) = 0;
virtual void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, virtual void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList) = 0; const QList<ModelNode> &lastSelectedNodeList) = 0;
......
...@@ -10,6 +10,7 @@ class PixmapChangedCommand; ...@@ -10,6 +10,7 @@ class PixmapChangedCommand;
class InformationChangedCommand; class InformationChangedCommand;
class ChildrenChangedCommand; class ChildrenChangedCommand;
class StatePreviewImageChangedCommand; class StatePreviewImageChangedCommand;
class ComponentCompletedCommand;
class NodeInstanceClientInterface class NodeInstanceClientInterface
{ {
...@@ -19,6 +20,7 @@ public: ...@@ -19,6 +20,7 @@ public:
virtual void pixmapChanged(const PixmapChangedCommand &command) = 0; virtual void pixmapChanged(const PixmapChangedCommand &command) = 0;
virtual void childrenChanged(const ChildrenChangedCommand &command) = 0; virtual void childrenChanged(const ChildrenChangedCommand &command) = 0;
virtual void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command) = 0; virtual void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command) = 0;
virtual void componentCompleted(const ComponentCompletedCommand &command) = 0;
virtual void flush() {}; virtual void flush() {};
virtual qint64 bytesToWrite() const {return 0;} virtual qint64 bytesToWrite() const {return 0;}
......
...@@ -21,6 +21,7 @@ class RemoveInstancesCommand; ...@@ -21,6 +21,7 @@ class RemoveInstancesCommand;
class RemovePropertiesCommand; class RemovePropertiesCommand;
class ChangeStateCommand; class ChangeStateCommand;
class AddImportCommand; class AddImportCommand;
class CompleteComponentCommand;
class NodeInstanceServerInterface : public QObject class NodeInstanceServerInterface : public QObject
{ {
...@@ -40,6 +41,7 @@ public: ...@@ -40,6 +41,7 @@ public:
virtual void changeIds(const ChangeIdsCommand &command) = 0; virtual void changeIds(const ChangeIdsCommand &command) = 0;
virtual void changeState(const ChangeStateCommand &command) = 0; virtual void changeState(const ChangeStateCommand &command) = 0;
virtual void addImport(const AddImportCommand &command) = 0; virtual void addImport(const AddImportCommand &command) = 0;
virtual void completeComponent(const CompleteComponentCommand &command) = 0;
virtual void setBlockUpdates(bool /*block*/) {} virtual void setBlockUpdates(bool /*block*/) {}
......
...@@ -63,6 +63,7 @@ class ChangeIdsCommand; ...@@ -63,6 +63,7 @@ class ChangeIdsCommand;
class RemoveInstancesCommand; class RemoveInstancesCommand;
class RemovePropertiesCommand; class RemovePropertiesCommand;
class AddImportCommand; class AddImportCommand;
class CompleteComponentCommand;
class CORESHARED_EXPORT NodeInstanceView : public AbstractView, public NodeInstanceClientInterface class CORESHARED_EXPORT NodeInstanceView : public AbstractView, public NodeInstanceClientInterface
{ {
...@@ -94,6 +95,7 @@ public: ...@@ -94,6 +95,7 @@ public:
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList); void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
void importAdded(const Import &import); void importAdded(const Import &import);
void importRemoved(const Import &import); void importRemoved(const Import &import);
...@@ -118,6 +120,7 @@ public: ...@@ -118,6 +120,7 @@ public:
void informationChanged(const InformationChangedCommand &command); void informationChanged(const InformationChangedCommand &command);
void childrenChanged(const ChildrenChangedCommand &command); void childrenChanged(const ChildrenChangedCommand &command);
void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command); void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command);
void componentCompleted(const ComponentCompletedCommand &command);
private: // functions private: // functions
NodeInstance rootNodeInstance() const; NodeInstance rootNodeInstance() const;
...@@ -143,6 +146,8 @@ private: // functions ...@@ -143,6 +146,8 @@ private: // functions
CreateSceneCommand createCreateSceneCommand() const; CreateSceneCommand createCreateSceneCommand() const;
ClearSceneCommand createClearSceneCommand() const; ClearSceneCommand createClearSceneCommand() const;
CreateInstancesCommand createCreateInstancesCommand(const QList<NodeInstance> &instanceList) const; CreateInstancesCommand createCreateInstancesCommand(const QList<NodeInstance> &instanceList) const;
CompleteComponentCommand createComponentCompleteCommand(const QList<NodeInstance> &instanceList) const;
ComponentCompletedCommand createComponentCompletedCommand(const QList<NodeInstance> &instanceList) const;
ReparentInstancesCommand createReparentInstancesCommand(const QList<NodeInstance> &instanceList) const; ReparentInstancesCommand createReparentInstancesCommand(const QList<NodeInstance> &instanceList) const;
ReparentInstancesCommand createReparentInstancesCommand(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent) const; ReparentInstancesCommand createReparentInstancesCommand(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent) const;
ChangeFileUrlCommand createChangeFileUrlCommand(const QUrl &fileUrl) const; ChangeFileUrlCommand createChangeFileUrlCommand(const QUrl &fileUrl) const;
......
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
virtual void nodeInstancePropertyChanged(const ModelNode &node, const QString &propertyName); virtual void nodeInstancePropertyChanged(const ModelNode &node, const QString &propertyName);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
void nodeCreated(const ModelNode &createdNode); void nodeCreated(const ModelNode &createdNode);
void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange); void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange);
......
...@@ -135,6 +135,7 @@ public: ...@@ -135,6 +135,7 @@ public:
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList); void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
void importAdded(const Import &import); void importAdded(const Import &import);
void importRemoved(const Import &import); void importRemoved(const Import &import);
......
#include "completecomponentcommand.h"
namespace QmlDesigner {
CompleteComponentCommand::CompleteComponentCommand()
{
}
CompleteComponentCommand::CompleteComponentCommand(const QVector<qint32> &container)
: m_instanceVector(container)
{
}
QVector<qint32> CompleteComponentCommand::instances() const
{
return m_instanceVector;
}
QDataStream &operator<<(QDataStream &out, const CompleteComponentCommand &command)
{
out << command.instances();
return out;
}
QDataStream &operator>>(QDataStream &in, CompleteComponentCommand &command)
{
in >> command.m_instanceVector;
return in;
}
} // namespace QmlDesigner
#ifndef COMPLETECOMPONENT_H
#define COMPLETECOMPONENT_H
#include <QMetaType>
#include <QVector>
namespace QmlDesigner {
class CompleteComponentCommand
{
friend QDataStream &operator>>(QDataStream &in, CompleteComponentCommand &command);
public:
CompleteComponentCommand();
CompleteComponentCommand(const QVector<qint32> &container);
QVector<qint32> instances() const;
private:
QVector<qint32> m_instanceVector;
};
QDataStream &operator<<(QDataStream &out, const CompleteComponentCommand &command);
QDataStream &operator>>(QDataStream &in, CompleteComponentCommand &command);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::CompleteComponentCommand);
#endif // COMPLETECOMPONENT_H
#include "componentcompletedcommand.h"
namespace QmlDesigner {
ComponentCompletedCommand::ComponentCompletedCommand()
{
}
ComponentCompletedCommand::ComponentCompletedCommand(const QVector<qint32> &container)
: m_instanceVector(container)
{
}
QVector<qint32> ComponentCompletedCommand::instances() const
{
return m_instanceVector;
}
QDataStream &operator<<(QDataStream &out, const ComponentCompletedCommand &command)
{
out << command.instances();
return out;
}
QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command)
{
in >> command.m_instanceVector;
return in;
}
} // namespace QmlDesigner
#ifndef COMPONENTCOMPLETEDCOMMAND_H
#define COMPONENTCOMPLETEDCOMMAND_H
#include <QMetaType>
#include <QVector>
namespace QmlDesigner {
class ComponentCompletedCommand
{
friend QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command);
public:
ComponentCompletedCommand();
ComponentCompletedCommand(const QVector<qint32> &container);
QVector<qint32> instances() const;
private:
QVector<qint32> m_instanceVector;
};
QDataStream &operator<<(QDataStream &out, const ComponentCompletedCommand &command);
QDataStream &operator>>(QDataStream &in, ComponentCompletedCommand &command);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ComponentCompletedCommand);
#endif // COMPONENTCOMPLETEDCOMMAND_H
...@@ -3,6 +3,8 @@ INCLUDEPATH += $$PWD/../include ...@@ -3,6 +3,8 @@ INCLUDEPATH += $$PWD/../include
HEADERS += $$PWD/behaviornodeinstance.h HEADERS += $$PWD/behaviornodeinstance.h
HEADERS += $$PWD/componentcompletedcommand.h
HEADERS += $$PWD//completecomponentcommand.h
HEADERS += $$PWDstatepreviewimagechangedcommand.h HEADERS += $$PWDstatepreviewimagechangedcommand.h
HEADERS += $$PWD//imagecontainer.h HEADERS += $$PWD//imagecontainer.h
HEADERS += $$PWD/childrenchangedcommand.h HEADERS += $$PWD/childrenchangedcommand.h
...@@ -45,6 +47,8 @@ HEADERS += $$PWD/../include/nodeinstanceserverinterface.h ...@@ -45,6 +47,8 @@ HEADERS += $$PWD/../include/nodeinstanceserverinterface.h
SOURCES += $$PWD/behaviornodeinstance.cpp SOURCES += $$PWD/behaviornodeinstance.cpp
SOURCES += $$PWD/componentcompletedcommand.cpp
SOURCES += $$PWD/completecomponentcommand.cpp
SOURCES += $$PWD/statepreviewimagechangedcommand.cpp SOURCES += $$PWD/statepreviewimagechangedcommand.cpp
SOURCES += $$PWD/imagecontainer.cpp SOURCES += $$PWD/imagecontainer.cpp
SOURCES += $$PWD/childrenchangedcommand.cpp SOURCES += $$PWD/childrenchangedcommand.cpp
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "changeidscommand.h" #include "changeidscommand.h"
#include "changestatecommand.h" #include "changestatecommand.h"
#include "addimportcommand.h" #include "addimportcommand.h"
#include "completecomponentcommand.h"
#include "informationchangedcommand.h" #include "informationchangedcommand.h"
#include "pixmapchangedcommand.h" #include "pixmapchangedcommand.h"
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
#include "childrenchangedcommand.h" #include "childrenchangedcommand.h"
#include "imagecontainer.h" #include "imagecontainer.h"
#include "statepreviewimagechangedcommand.h" #include "statepreviewimagechangedcommand.h"
#include "componentcompletedcommand.h"
namespace QmlDesigner { namespace QmlDesigner {
...@@ -83,6 +85,11 @@ void NodeInstanceClientProxy::statePreviewImagesChanged(const StatePreviewImageC ...@@ -83,6 +85,11 @@ void NodeInstanceClientProxy::statePreviewImagesChanged(const StatePreviewImageC
writeCommand(QVariant::fromValue(command)); writeCommand(QVariant::fromValue(command));
} }
void NodeInstanceClientProxy::componentCompleted(const ComponentCompletedCommand &command)
{
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::flush() void NodeInstanceClientProxy::flush()
{ {
} }
...@@ -142,6 +149,7 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command) ...@@ -142,6 +149,7 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
static const int changeIdsCommandType = QMetaType::type("ChangeIdsCommand"); static const int changeIdsCommandType = QMetaType::type("ChangeIdsCommand");
static const int changeStateCommandType = QMetaType::type("ChangeStateCommand"); static const int changeStateCommandType = QMetaType::type("ChangeStateCommand");
static const int addImportCommandType = QMetaType::type("AddImportCommand"); static const int addImportCommandType = QMetaType::type("AddImportCommand");
static const int completeComponentCommandType = QMetaType::type("CompleteComponentCommand");
if (command.userType() == createInstancesCommandType) if (command.userType() == createInstancesCommandType)
nodeInstanceServer()->createInstances(command.value<CreateInstancesCommand>()); nodeInstanceServer()->createInstances(command.value<CreateInstancesCommand>());
...@@ -167,6 +175,8 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command) ...@@ -167,6 +175,8 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
nodeInstanceServer()->changeState(command.value<ChangeStateCommand>()); nodeInstanceServer()->changeState(command.value<ChangeStateCommand>());
else if (command.userType() == addImportCommandType) else if (command.userType() == addImportCommandType)
nodeInstanceServer()->addImport(command.value<AddImportCommand>()); nodeInstanceServer()->addImport(command.value<AddImportCommand>());
else if (command.userType() == completeComponentCommandType)
nodeInstanceServer()->completeComponent(command.value<CompleteComponentCommand>());
else else
Q_ASSERT(false); Q_ASSERT(false);
} }
......
...@@ -25,6 +25,8 @@ public: ...@@ -25,6 +25,8 @@ public:
void pixmapChanged(const PixmapChangedCommand &command); void pixmapChanged(const PixmapChangedCommand &command);
void childrenChanged(const ChildrenChangedCommand &command); void childrenChanged(const ChildrenChangedCommand &command);
void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command); void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command);
void componentCompleted(const ComponentCompletedCommand &command);
void flush(); void flush();
qint64 bytesToWrite() const; qint64 bytesToWrite() const;
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include "changestatecommand.h" #include "changestatecommand.h"
#include "addimportcommand.h" #include "addimportcommand.h"
#include "childrenchangedcommand.h" #include "childrenchangedcommand.h"