Commit d103bb7a authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann

QmlDesigner.NodeInstances: Support for Qt five scene graph

QmlPuppet only supported GraphicsView. There is now Qml2Puppet which is
supporting the new Qt Scene Graph.

Change-Id: Ia0a06639cf6852192e84f7bfc2bea60532890b08
Reviewed-on: http://codereview.qt.nokia.com/433Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 74f1c2e2
......@@ -50,7 +50,6 @@
#include <cmath>
#include <invalidmodelnodeexception.h>
#include <invalidnodestateexception.h>
namespace QmlDesigner {
......
......@@ -37,7 +37,6 @@
#include <invalididexception.h>
#include <rewritingexception.h>
#include <invalidnodestateexception.h>
#include <variantproperty.h>
#include <bindingproperty.h>
......
......@@ -7,8 +7,13 @@ QT += script \
DEFINES += TEST_EXPORTS
INCLUDEPATH += $$PWD \
$$PWD/include
include (instances/instances.pri)
include (../../../tools/qmlpuppet/interfaces/interfaces.pri)
include (../../../tools/qmlpuppet/commands/commands.pri)
include (../../../tools/qmlpuppet/container/container.pri)
SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/instances/nodeinstanceview.cpp \
$$PWD/model/rewriterview.cpp \
$$PWD/metainfo/metainfo.cpp \
$$PWD/metainfo/metainfoparser.cpp \
......@@ -25,15 +30,12 @@ SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/pluginmanager/widgetpluginmanager.cpp \
$$PWD/pluginmanager/widgetpluginpath.cpp \
$$PWD/exceptions/exception.cpp \
$$PWD/exceptions/invalidnodeinstanceexception.cpp \
$$PWD/exceptions/invalidpropertyexception.cpp \
$$PWD/exceptions/invalidmodelnodeexception.cpp \
$$PWD/exceptions/invalidreparentingexception.cpp \
$$PWD/exceptions/invalidmetainfoexception.cpp \
$$PWD/exceptions/invalidargumentexception.cpp \
$$PWD/exceptions/noanchoringpossibleexception.cpp \
$$PWD/exceptions/notimplementedexception.cpp \
$$PWD/exceptions/invalidnodestateexception.cpp \
$$PWD/model/variantparser.cpp \
$$PWD/exceptions/invalidmodelstateexception.cpp \
$$PWD/exceptions/removebasestateexception.cpp \
......@@ -73,43 +75,7 @@ SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/model/rewriteactioncompressor.cpp \
$$PWD/model/qmltextgenerator.cpp \
$$PWD/model/modelmerger.cpp \
$$PWD/exceptions/rewritingexception.cpp \
$$PWD/instances/declarativedesignercommunicationinterface.cpp \
$$PWD/instances/createinstancescommand.cpp \
$$PWD/instances/nodeinstanceserverinterface.cpp \
$$PWD/instances/nodeinstance.cpp \
$$PWD/instances/propertyvaluecontainer.cpp \
$$PWD/instances/childrenchangeeventfilter.cpp \
$$PWD/instances/propertybindingcontainer.cpp \
$$PWD/instances/propertyabstractcontainer.cpp \
$$PWD/instances/createscenecommand.cpp \
$$PWD/instances/instancecontainer.cpp \
$$PWD/instances/changefileurlcommand.cpp \
$$PWD/instances/clearscenecommand.cpp \
$$PWD/instances/reparentcontainer.cpp \
$$PWD/instances/reparentinstancescommand.cpp \
$$PWD/instances/changevaluescommand.cpp \
$$PWD/instances/changebindingscommand.cpp \
$$PWD/instances/changeidscommand.cpp \
$$PWD/instances/idcontainer.cpp \
$$PWD/instances/synchronizecommand.cpp \
$$PWD/instances/removeinstancescommand.cpp \
$$PWD/instances/removepropertiescommand.cpp \
$$PWD/instances/valueschangedcommand.cpp \
$$PWD/instances/pixmapchangedcommand.cpp \
$$PWD/instances/informationchangedcommand.cpp \
$$PWD/instances/informationcontainer.cpp \
$$PWD/instances/changestatecommand.cpp \
$$PWD/instances/nodeinstanceserverproxy.cpp \
$$PWD/instances/addimportcommand.cpp \
$$PWD/instances/childrenchangedcommand.cpp \
$$PWD/instances/statepreviewimagechangedcommand.cpp \
$$PWD/instances/imagecontainer.cpp \
$$PWD/instances/completecomponentcommand.cpp \
$$PWD/instances/componentcompletedcommand.cpp \
$$PWD/instances/changenodesourcecommand.cpp \
$$PWD/instances/changeauxiliarycommand.cpp \
$$PWD/instances/addimportcontainer.cpp
$$PWD/exceptions/rewritingexception.cpp
HEADERS += $$PWD/include/corelib_global.h \
$$PWD/include/abstractview.h \
......@@ -132,8 +98,6 @@ HEADERS += $$PWD/include/corelib_global.h \
$$PWD/pluginmanager/widgetpluginmanager.h \
$$PWD/pluginmanager/widgetpluginpath.h \
$$PWD/include/exception.h \
$$PWD/include/invalidnodeinstanceexception.h \
$$PWD/include/invalidmodelnodeexception.h \
$$PWD/include/invalidreparentingexception.h \
$$PWD/include/invalidmetainfoexception.h \
$$PWD/include/invalidargumentexception.h \
......@@ -181,45 +145,8 @@ HEADERS += $$PWD/include/corelib_global.h \
$$PWD/include/modelmerger.h \
$$PWD/include/mathutils.h \
$$PWD/include/customnotifications.h \
$$PWD/include/rewritingexception.h \
$$PWD/instances/declarativedesignercommunicationinterface.h \
$$PWD/instances/createinstancescommand.h \
$$PWD/include/nodeinstanceserverinterface.h \
$$PWD/include/nodeinstance.h \
$$PWD/include/propertyvaluecontainer.h \
$$PWD/instances/childrenchangeeventfilter.h \
$$PWD/include/propertybindingcontainer.h \
$$PWD/include/propertyabstractcontainer.h \
$$PWD/instances/createscenecommand.h \
$$PWD/instances/instancecontainer.h \
$$PWD/instances/changefileurlcommand.h \
$$PWD/instances/clearscenecommand.h \
$$PWD/instances/reparentcontainer.h \
$$PWD/instances/reparentinstancescommand.h \
$$PWD/instances/synchronizecommand.h \
$$PWD/instances/changevaluescommand.h \
$$PWD/instances/changebindingscommand.h \
$$PWD/instances/changeidscommand.h \
$$PWD/instances/idcontainer.h \
$$PWD/instances/removeinstancescommand.h \
$$PWD/instances/removepropertiescommand.h \
$$PWD/include/nodeinstanceclientinterface.h \
$$PWD/instances/valueschangedcommand.h \
$$PWD/instances/pixmapchangedcommand.h \
$$PWD/instances/informationchangedcommand.h \
$$PWD/instances/informationcontainer.h \
$$PWD/include/commondefines.h \
$$PWD/instances/changestatecommand.h \
$$PWD/instances/nodeinstanceserverproxy.h \
$$PWD/instances/addimportcommand.h \
$$PWD/instances/childrenchangedcommand.h \
$$PWD/instances/statepreviewimagechangedcommand.h \
$$PWD/instances/imagecontainer.h \
$$PWD/instances/completecomponentcommand.h \
$$PWD/instances/componentcompletedcommand.h \
$$PWD/instances/changenodesourcecommand.h \
$$PWD/instances/changeauxiliarycommand.h \
$$PWD/instances/addimportcontainer.h
$$PWD/include/rewritingexception.h
contains(CONFIG, plugin) {
# If core.pri has been included in the qmldesigner plugin
SOURCES += $$PWD/model/basetexteditmodifier.cpp
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "invalidnodeinstanceexception.h"
/*!
\class QmlDesigner::InvalidNodeInstanceException
\ingroup CoreExceptions
\brief Exception for a invalid ndoe instance
\see NodeInstance
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
*/
InvalidNodeInstanceException::InvalidNodeInstanceException(int line,
const QString &function,
const QString &file)
: Exception(line, function, file)
{
}
/*!
\brief Returns the type of this exception
\returns the type as a string
*/
QString InvalidNodeInstanceException::type() const
{
return "InvalidNodeInstanceException";
}
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "noanchoringpossibleexception.h"
namespace QmlDesigner {
NoAnchoringPossibleException::NoAnchoringPossibleException(int line,
const QString &function,
const QString &file)
: Exception(line,function, file)
{
}
QString NoAnchoringPossibleException::type() const
{
return "NoAnchoringPossibleException";
}
} // namespace QKinecticDesigner
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef INVALIDNODEINSTANCEEXCEPTION_H
#define INVALIDNODEINSTANCEEXCEPTION_H
#include "exception.h"
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidNodeInstanceException : public Exception
{
public:
InvalidNodeInstanceException(int line,
const QString &function,
const QString &file);
QString type() const;
};
}
#endif // INVALIDNODEINSTANCEEXCEPTION_H
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef INVALIDNODESTATEEXCEPTION_H
#define INVALIDNODESTATEEXCEPTION_H
#include <exception.h>
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidNodeStateException : public Exception
{
public:
InvalidNodeStateException(int line,
const QString &function,
const QString &file);
QString type() const;
};
} // namespace QmlDesigner
#endif // INVALIDNODESTATEEXCEPTION_H
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef NOANCHORINGPOSSIBLEEXCEPTION_H
#define NOANCHORINGPOSSIBLEEXCEPTION_H
#include "exception.h"
namespace QmlDesigner {
class CORESHARED_EXPORT NoAnchoringPossibleException : public Exception
{
public:
NoAnchoringPossibleException(int line,
const QString &function,
const QString &file);
QString type() const;
};
} // namespace QKinecticDesigner
#endif // NOANCHORINGPOSSIBLEEXCEPTION_H
......@@ -68,7 +68,6 @@ class ChangeBindingsCommand;
class ChangeIdsCommand;
class RemoveInstancesCommand;
class RemovePropertiesCommand;
class AddImportCommand;
class CompleteComponentCommand;
class CORESHARED_EXPORT NodeInstanceView : public AbstractView, public NodeInstanceClientInterface
......@@ -175,7 +174,6 @@ private: // functions
RemoveInstancesCommand createRemoveInstancesCommand(const QList<ModelNode> &nodeList) const;
RemoveInstancesCommand createRemoveInstancesCommand(const ModelNode &node) const;
RemovePropertiesCommand createRemovePropertiesCommand(const QList<AbstractProperty> &propertyList) const;
AddImportCommand createImportCommand(const Import &import);
void resetHorizontalAnchors(const ModelNode &node);
void resetVerticalAnchors(const ModelNode &node);
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "addimportcommand.h"
namespace QmlDesigner {
AddImportCommand::AddImportCommand()
{
}
AddImportCommand::AddImportCommand(const AddImportContainer &container)
: m_importContainer(container)
{
}
AddImportContainer AddImportCommand::import() const
{
return m_importContainer;
}
QDataStream &operator<<(QDataStream &out, const AddImportCommand &command)
{
out << command.import();
return out;
}
QDataStream &operator>>(QDataStream &in, AddImportCommand &command)
{
in >> command.m_importContainer;
return in;
}
} // namespace QmlDesigner
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef ADDIMPORTCOMMAND_H
#define ADDIMPORTCOMMAND_H
#include "addimportcontainer.h"
namespace QmlDesigner {
class AddImportCommand
{
friend QDataStream &operator>>(QDataStream &in, AddImportCommand &command);
public:
AddImportCommand();
AddImportCommand(const AddImportContainer &container);
AddImportContainer import() const;
private:
AddImportContainer m_importContainer;
};