forked from qt-creator/qt-creator
QmlDesigner: Break dependencies
To get the model under unit tests we have to break every depenedency to code outside of the unit test scope. Change-Id: Ib613c3308e48990c55b2ed0cd42bc4b0e1041a01 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 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 "listmodeleditormodel.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
ListModelEditorModel::ListModelEditorModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,38 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 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 <QStandardItemModel>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ListModelEditorModel : public QStandardItemModel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ListModelEditorModel();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,35 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 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 "listmodeleditorview.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
ListModelEditorView::ListModelEditorView()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,38 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 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 <abstractview.h>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ListModelEditorView : public AbstractView
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ListModelEditorView();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
#include <coreplugin/messagebox.h>
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
#include <coreplugin/messagebox.h>
|
||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -160,8 +160,12 @@ QString Exception::description() const
|
|||||||
*/
|
*/
|
||||||
void Exception::showException(const QString &title) const
|
void Exception::showException(const QString &title) const
|
||||||
{
|
{
|
||||||
QString composedTitle = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title;
|
Q_UNUSED(title)
|
||||||
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
QString composedTitle = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error")
|
||||||
|
: title;
|
||||||
Core::AsynchronousMessageBox::warning(composedTitle, description());
|
Core::AsynchronousMessageBox::warning(composedTitle, description());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@@ -1,2 +1,14 @@
|
|||||||
SOURCES += $$PWD/exception.cpp
|
SOURCES += $$PWD/exception.cpp \
|
||||||
SOURCES += $$PWD/invalidnodeinstanceexception.cpp
|
$$PWD/invalidargumentexception.cpp \
|
||||||
|
$$PWD/invalididexception.cpp \
|
||||||
|
$$PWD/invalidmetainfoexception.cpp \
|
||||||
|
$$PWD/invalidmodelnodeexception.cpp \
|
||||||
|
$$PWD/invalidmodelstateexception.cpp \
|
||||||
|
$$PWD/invalidpropertyexception.cpp \
|
||||||
|
$$PWD/invalidqmlsourceexception.cpp \
|
||||||
|
$$PWD/invalidreparentingexception.cpp \
|
||||||
|
$$PWD/invalidslideindexexception.cpp \
|
||||||
|
$$PWD/notimplementedexception.cpp \
|
||||||
|
$$PWD/removebasestateexception.cpp \
|
||||||
|
$$PWD/rewritingexception.cpp
|
||||||
|
|
||||||
|
@@ -31,10 +31,13 @@
|
|||||||
// Unnecessary since core isn't a dll any more.
|
// Unnecessary since core isn't a dll any more.
|
||||||
|
|
||||||
#if defined(DESIGNER_CORE_LIBRARY)
|
#if defined(DESIGNER_CORE_LIBRARY)
|
||||||
# define QMLDESIGNERCORE_EXPORT Q_DECL_EXPORT
|
#define QMLDESIGNERCORE_EXPORT Q_DECL_EXPORT
|
||||||
|
#elif defined(DESIGNER_STATIC_CORE_LIBRARY)
|
||||||
|
#define QMLDESIGNERCORE_EXPORT
|
||||||
#else
|
#else
|
||||||
# define QMLDESIGNERCORE_EXPORT Q_DECL_IMPORT
|
#define QMLDESIGNERCORE_EXPORT Q_DECL_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
using PropertyName = QByteArray;
|
using PropertyName = QByteArray;
|
||||||
using PropertyNameList = QList<PropertyName>;
|
using PropertyNameList = QList<PropertyName>;
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
|
#include <QWidget>
|
||||||
#include <QtGui/qimage.h>
|
#include <QtGui/qimage.h>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
61
src/plugins/qmldesigner/qmldesignerunittestfiles.pri
Normal file
61
src/plugins/qmldesigner/qmldesignerunittestfiles.pri
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
INCLUDEPATH += $$PWD
|
||||||
|
INCLUDEPATH += $$PWD/designercore/include
|
||||||
|
INCLUDEPATH += $$PWD/designercore
|
||||||
|
INCLUDEPATH += $$PWD/../../../share/qtcreator/qml/qmlpuppet/interfaces
|
||||||
|
INCLUDEPATH += $$PWD/../../../share/qtcreator/qml/qmlpuppet/types
|
||||||
|
|
||||||
|
DEFINES += QMLDESIGNER_TEST DESIGNER_STATIC_CORE_LIBRARY
|
||||||
|
|
||||||
|
include($$PWD/designercore/exceptions/exceptions.pri)
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
$$PWD/designercore/model/model.cpp \
|
||||||
|
$$PWD/designercore/model/modelnode.cpp \
|
||||||
|
$$PWD/designercore/model/import.cpp \
|
||||||
|
$$PWD/designercore/model/abstractproperty.cpp \
|
||||||
|
$$PWD/designercore/model/abstractview.cpp \
|
||||||
|
$$PWD/components/listmodeleditor/listmodeleditormodel.cpp \
|
||||||
|
$$PWD/designercore/model/internalproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalbindingproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalnodeabstractproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalnodelistproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalnodeproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalsignalhandlerproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalproperty.cpp \
|
||||||
|
$$PWD/designercore/model/internalnode.cpp \
|
||||||
|
$$PWD/designercore/model/internalvariantproperty.cpp \
|
||||||
|
$$PWD/designercore/model/bindingproperty.cpp \
|
||||||
|
$$PWD/designercore/model/nodeabstractproperty.cpp \
|
||||||
|
$$PWD/designercore/model/nodelistproperty.cpp \
|
||||||
|
$$PWD/designercore/model/nodeproperty.cpp \
|
||||||
|
$$PWD/designercore/model/signalhandlerproperty.cpp \
|
||||||
|
$$PWD/designercore/model/variantproperty.cpp\
|
||||||
|
$$PWD/designercore/model/annotation.cpp\
|
||||||
|
$$PWD/designercore/model/annotation.cpp \
|
||||||
|
$$PWD/designercore/rewritertransaction.cpp
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
$$PWD/designercore/include/modelnode.h \
|
||||||
|
$$PWD/designercore/include/model.h \
|
||||||
|
$$PWD/../../../share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h \
|
||||||
|
$$PWD/designercore/include/import.h \
|
||||||
|
$$PWD/designercore/include/abstractproperty.h \
|
||||||
|
$$PWD/designercore/include/abstractview.h \
|
||||||
|
$$PWD/components/listmodeleditor/listmodeleditormodel.h \
|
||||||
|
$$PWD/designercore/model/model_p.h \
|
||||||
|
$$PWD/designercore/include/qmldesignercorelib_global.h \
|
||||||
|
$$PWD/designercore/model/internalbindingproperty.h \
|
||||||
|
$$PWD/designercore/model/internalnode_p.h \
|
||||||
|
$$PWD/designercore/model/internalnodeabstractproperty.h \
|
||||||
|
$$PWD/designercore/model/internalnodelistproperty.h \
|
||||||
|
$$PWD/designercore/model/internalnodeproperty.h \
|
||||||
|
$$PWD/designercore/model/internalproperty.h \
|
||||||
|
$$PWD/designercore/model/internalsignalhandlerproperty.h \
|
||||||
|
$$PWD/designercore/model/internalvariantproperty.h \
|
||||||
|
$$PWD/designercore/include/bindingproperty.h \
|
||||||
|
$$PWD/designercore/include/nodeabstractproperty.h \
|
||||||
|
$$PWD/designercore/include/nodelistproperty.h \
|
||||||
|
$$PWD/designercore/include/nodeproperty.h \
|
||||||
|
$$PWD/designercore/include/signalhandlerproperty.h \
|
||||||
|
$$PWD/designercore/include/variantproperty.h \
|
||||||
|
$$PWD/designercore/rewritertransaction.h
|
41
tests/unit/mockup/coreplugin/helpitem.h
Normal file
41
tests/unit/mockup/coreplugin/helpitem.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "core_global.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
|
||||||
|
class HelpItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
HelpItem() {}
|
||||||
|
HelpItem(const QString &) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Core
|
40
tests/unit/mockup/coreplugin/icontext.h
Normal file
40
tests/unit/mockup/coreplugin/icontext.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <QString>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
|
||||||
|
class IContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using HelpCallback = std::function<void(const QString &)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Core
|
@@ -0,0 +1,70 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "exception.h"
|
||||||
|
|
||||||
|
#include <qmldesignercorelib_global.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
namespace QmlJS {
|
||||||
|
class DiagnosticMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class DocumentMessage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Type { NoError = 0, InternalError = 1, ParseError = 2 };
|
||||||
|
|
||||||
|
public:
|
||||||
|
DocumentMessage() {}
|
||||||
|
DocumentMessage(const QString &) {}
|
||||||
|
|
||||||
|
Type type() const { return m_type; }
|
||||||
|
|
||||||
|
int line() const { return m_line; }
|
||||||
|
|
||||||
|
int column() const { return m_column; }
|
||||||
|
|
||||||
|
QString description() const { return m_description; }
|
||||||
|
|
||||||
|
QUrl url() const { return m_url; }
|
||||||
|
|
||||||
|
QString toString() const { return {}; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Type m_type;
|
||||||
|
int m_line;
|
||||||
|
int m_column;
|
||||||
|
QString m_description;
|
||||||
|
QUrl m_url;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,56 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmldesignercorelib_global.h"
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ItemLibraryEntry
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString name() const { return {}; }
|
||||||
|
TypeName typeName() const { return {}; }
|
||||||
|
QIcon typeIcon() const { return {}; }
|
||||||
|
QString libraryEntryIconPath() const { return {}; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class ItemLibraryInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QList<ItemLibraryEntry> entries() const { return {}; }
|
||||||
|
QList<ItemLibraryEntry> entriesForType(const QByteArray &typeName,
|
||||||
|
int majorVersion,
|
||||||
|
int minorVersion) const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
ItemLibraryEntry entry(const QString &name) const { return {}; }
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,64 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <QObject>
|
||||||
|
#include <QSize>
|
||||||
|
#include <QString>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include "itemlibraryinfo.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ItemLibraryItem : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(QVariant itemLibraryEntry READ itemLibraryEntry FINAL)
|
||||||
|
Q_PROPERTY(QString itemName READ itemName FINAL)
|
||||||
|
Q_PROPERTY(QString itemLibraryIconPath READ itemLibraryIconPath FINAL)
|
||||||
|
Q_PROPERTY(bool itemVisible READ isVisible NOTIFY visibilityChanged FINAL)
|
||||||
|
|
||||||
|
public:
|
||||||
|
ItemLibraryItem(QObject *) {}
|
||||||
|
~ItemLibraryItem() override {}
|
||||||
|
|
||||||
|
QString itemName() const { return {}; }
|
||||||
|
QString typeName() const { return {}; }
|
||||||
|
QString itemLibraryIconPath() const { return {}; }
|
||||||
|
|
||||||
|
bool setVisible(bool) { return {}; }
|
||||||
|
bool isVisible() const { return {}; }
|
||||||
|
|
||||||
|
void setItemLibraryEntry(const ItemLibraryEntry &) {}
|
||||||
|
QVariant itemLibraryEntry() const { return {}; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void visibilityChanged();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,63 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmldesignercorelib_global.h"
|
||||||
|
|
||||||
|
#include <QSharedPointer>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
#include "itemlibraryinfo.h"
|
||||||
|
#include <nodemetainfo.h>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ModelNode;
|
||||||
|
class AbstractProperty;
|
||||||
|
class ItemLibraryInfo;
|
||||||
|
|
||||||
|
inline bool operator==(const MetaInfo &first, const MetaInfo &second)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
inline bool operator!=(const MetaInfo &first, const MetaInfo &second)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
class QMLDESIGNERCORE_EXPORT MetaInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ItemLibraryInfo *itemLibraryInfo() const { return {}; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
static MetaInfo global() { return {}; }
|
||||||
|
static void clearGlobal() {}
|
||||||
|
|
||||||
|
static void setPluginPaths(const QStringList &paths) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} //namespace QmlDesigner
|
@@ -0,0 +1,91 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmldesignercorelib_global.h"
|
||||||
|
#include "abstractview.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class NodeInstanceView : public AbstractView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
NodeInstanceView(QObject *parent) {}
|
||||||
|
~NodeInstanceView() override {}
|
||||||
|
|
||||||
|
void modelAttached(Model *model) override {}
|
||||||
|
void modelAboutToBeDetached(Model *model) override {}
|
||||||
|
void nodeCreated(const ModelNode &createdNode) override {}
|
||||||
|
void nodeRemoved(const ModelNode &removedNode,
|
||||||
|
const NodeAbstractProperty &parentProperty,
|
||||||
|
PropertyChangeFlags propertyChange) override
|
||||||
|
{}
|
||||||
|
void propertiesAboutToBeRemoved(const QList<AbstractProperty> &propertyList) override {}
|
||||||
|
void propertiesRemoved(const QList<AbstractProperty> &propertyList) override {}
|
||||||
|
void variantPropertiesChanged(const QList<VariantProperty> &propertyList,
|
||||||
|
PropertyChangeFlags propertyChange) override
|
||||||
|
{}
|
||||||
|
void bindingPropertiesChanged(const QList<BindingProperty> &propertyList,
|
||||||
|
PropertyChangeFlags propertyChange) override
|
||||||
|
{}
|
||||||
|
void signalHandlerPropertiesChanged(const QVector<SignalHandlerProperty> &propertyList,
|
||||||
|
PropertyChangeFlags propertyChange) override
|
||||||
|
{}
|
||||||
|
void nodeReparented(const ModelNode &node,
|
||||||
|
const NodeAbstractProperty &newPropertyParent,
|
||||||
|
const NodeAbstractProperty &oldPropertyParent,
|
||||||
|
AbstractView::PropertyChangeFlags propertyChange) override
|
||||||
|
{}
|
||||||
|
void nodeIdChanged(const ModelNode &node, const QString &newId, const QString &oldId) override
|
||||||
|
{}
|
||||||
|
void nodeOrderChanged(const NodeListProperty &listProperty,
|
||||||
|
const ModelNode &movedNode,
|
||||||
|
int oldIndex) override
|
||||||
|
{}
|
||||||
|
void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion) override {}
|
||||||
|
void nodeTypeChanged(const ModelNode &node,
|
||||||
|
const TypeName &type,
|
||||||
|
int majorVersion,
|
||||||
|
int minorVersion) override
|
||||||
|
{}
|
||||||
|
void customNotification(const AbstractView *view,
|
||||||
|
const QString &identifier,
|
||||||
|
const QList<ModelNode> &nodeList,
|
||||||
|
const QList<QVariant> &data) override
|
||||||
|
{}
|
||||||
|
|
||||||
|
void rewriterBeginTransaction() override {}
|
||||||
|
void rewriterEndTransaction() override {}
|
||||||
|
|
||||||
|
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) override
|
||||||
|
{}
|
||||||
|
|
||||||
|
void sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,97 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <QIcon>
|
||||||
|
#include <QList>
|
||||||
|
#include <QString>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include "qmldesignercorelib_global.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QDeclarativeContext;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class MetaInfo;
|
||||||
|
class Model;
|
||||||
|
class AbstractProperty;
|
||||||
|
|
||||||
|
class NodeMetaInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NodeMetaInfo() {}
|
||||||
|
NodeMetaInfo(Model *, const TypeName &, int, int) {}
|
||||||
|
|
||||||
|
bool isValid() const { return {}; }
|
||||||
|
bool isFileComponent() const { return {}; }
|
||||||
|
bool hasProperty(const PropertyName &) const { return {}; }
|
||||||
|
PropertyNameList propertyNames() const { return {}; }
|
||||||
|
PropertyNameList signalNames() const { return {}; }
|
||||||
|
PropertyNameList directPropertyNames() const { return {}; }
|
||||||
|
PropertyName defaultPropertyName() const { return "data"; }
|
||||||
|
bool hasDefaultProperty() const { return {}; }
|
||||||
|
TypeName propertyTypeName(const PropertyName &) const { return {}; }
|
||||||
|
bool propertyIsWritable(const PropertyName &) const { return {}; }
|
||||||
|
bool propertyIsListProperty(const PropertyName &) const { return {}; }
|
||||||
|
bool propertyIsEnumType(const PropertyName &) const { return {}; }
|
||||||
|
bool propertyIsPrivate(const PropertyName &) const { return {}; }
|
||||||
|
QString propertyEnumScope(const PropertyName &) const { return {}; }
|
||||||
|
QStringList propertyKeysForEnum(const PropertyName &) const { return {}; }
|
||||||
|
QVariant propertyCastedValue(const PropertyName &, const QVariant &) const { return {}; }
|
||||||
|
|
||||||
|
QList<NodeMetaInfo> classHierarchy() const { return {}; }
|
||||||
|
QList<NodeMetaInfo> superClasses() const { return {}; }
|
||||||
|
NodeMetaInfo directSuperClass() const { return {}; }
|
||||||
|
|
||||||
|
bool defaultPropertyIsComponent() const { return {}; }
|
||||||
|
|
||||||
|
TypeName typeName() const { return {}; }
|
||||||
|
TypeName simplifiedTypeName() const { return {}; }
|
||||||
|
int majorVersion() const { return {}; }
|
||||||
|
int minorVersion() const { return {}; }
|
||||||
|
|
||||||
|
QString componentSource() const { return {}; }
|
||||||
|
QString componentFileName() const { return {}; }
|
||||||
|
|
||||||
|
bool hasCustomParser() const { return {}; }
|
||||||
|
|
||||||
|
bool availableInVersion(int, int) const { return {}; }
|
||||||
|
bool isSubclassOf(const TypeName &, int = -1, int = -1) const { return {}; }
|
||||||
|
|
||||||
|
bool isGraphicalItem() const { return {}; }
|
||||||
|
bool isLayoutable() const { return {}; }
|
||||||
|
bool isView() const { return {}; }
|
||||||
|
bool isTabView() const { return {}; }
|
||||||
|
|
||||||
|
QString importDirectoryPath() const { return {}; }
|
||||||
|
|
||||||
|
static void clearCache() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,56 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 <modelnode.h>
|
||||||
|
#include <qmldesignercorelib_global.h>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class AbstractView;
|
||||||
|
class NodeInstanceView;
|
||||||
|
|
||||||
|
class QmlModelNodeFacade
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
operator ModelNode() const { return {}; }
|
||||||
|
ModelNode modelNode() { return {}; }
|
||||||
|
const ModelNode modelNode() const { return {}; }
|
||||||
|
bool hasModelNode() const { return {}; }
|
||||||
|
static bool isValidQmlModelNodeFacade(const ModelNode &modelNode) { return {}; }
|
||||||
|
virtual bool isValid() const { return {}; }
|
||||||
|
|
||||||
|
AbstractView *view() const { return {}; }
|
||||||
|
static NodeInstanceView *nodeInstanceView(const ModelNode &modelNode) { return {}; }
|
||||||
|
NodeInstanceView *nodeInstanceView() const { return {}; }
|
||||||
|
bool isRootNode() const { return {}; }
|
||||||
|
|
||||||
|
QmlModelNodeFacade(const ModelNode &) {}
|
||||||
|
QmlModelNodeFacade() {}
|
||||||
|
~QmlModelNodeFacade(){};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmlmodelnodefacade.h"
|
||||||
|
#include <qmldesignercorelib_global.h>
|
||||||
|
|
||||||
|
#include <nodeinstance.h>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class QMLDESIGNERCORE_EXPORT QmlObjectNode : public QmlModelNodeFacade
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QmlObjectNode() {}
|
||||||
|
QmlObjectNode(const ModelNode &modelNode){};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,39 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmlmodelnodefacade.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class QmlModelState : public QmlModelNodeFacade
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QmlModelState();
|
||||||
|
QmlModelState(const ModelNode &) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmlmodelnodefacade.h"
|
||||||
|
#include <qmldesignercorelib_global.h>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class QmlTimeline : public QmlModelNodeFacade
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QmlTimeline() {}
|
||||||
|
QmlTimeline(const ModelNode &) {}
|
||||||
|
|
||||||
|
bool isValid() const override { return {}; }
|
||||||
|
|
||||||
|
void toogleRecording(bool b) const {}
|
||||||
|
|
||||||
|
void resetGroupRecording() const {}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,175 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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 "qmldesignercorelib_global.h"
|
||||||
|
#include "abstractview.h"
|
||||||
|
|
||||||
|
namespace QmlJS {
|
||||||
|
class Document;
|
||||||
|
class ScopeChain;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class TextModifier;
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class TextToModelMerger;
|
||||||
|
class ModelToTextMerger;
|
||||||
|
class ModelNodePositionStorage;
|
||||||
|
|
||||||
|
} //Internal
|
||||||
|
|
||||||
|
struct CppTypeData
|
||||||
|
{
|
||||||
|
QString superClassName;
|
||||||
|
QString importUrl;
|
||||||
|
QString versionString;
|
||||||
|
QString cppClassName;
|
||||||
|
QString typeName;
|
||||||
|
bool isSingleton = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RewriterView : public AbstractView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum DifferenceHandling {
|
||||||
|
Validate,
|
||||||
|
Amend
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
RewriterView(DifferenceHandling, QObject *) {}
|
||||||
|
~RewriterView() override {}
|
||||||
|
|
||||||
|
void modelAttached(Model *) override {}
|
||||||
|
void modelAboutToBeDetached(Model *) override {}
|
||||||
|
void nodeCreated(const ModelNode &) override {}
|
||||||
|
void nodeRemoved(const ModelNode &, const NodeAbstractProperty &, PropertyChangeFlags) override
|
||||||
|
{}
|
||||||
|
void propertiesAboutToBeRemoved(const QList<AbstractProperty> &) override {}
|
||||||
|
void propertiesRemoved(const QList<AbstractProperty> &) override {}
|
||||||
|
void variantPropertiesChanged(const QList<VariantProperty> &, PropertyChangeFlags) override {}
|
||||||
|
void bindingPropertiesChanged(const QList<BindingProperty> &, PropertyChangeFlags) override {}
|
||||||
|
void signalHandlerPropertiesChanged(const QVector<SignalHandlerProperty> &,
|
||||||
|
PropertyChangeFlags) override
|
||||||
|
{}
|
||||||
|
void nodeReparented(const ModelNode &,
|
||||||
|
const NodeAbstractProperty &,
|
||||||
|
const NodeAbstractProperty &,
|
||||||
|
AbstractView::PropertyChangeFlags) override
|
||||||
|
{}
|
||||||
|
void nodeIdChanged(const ModelNode &, const QString &, const QString &) override {}
|
||||||
|
void nodeOrderChanged(const NodeListProperty &, const ModelNode &, int) override {}
|
||||||
|
void rootNodeTypeChanged(const QString &, int, int) override {}
|
||||||
|
void nodeTypeChanged(const ModelNode &, const TypeName &, int, int) override {}
|
||||||
|
void customNotification(const AbstractView *,
|
||||||
|
const QString &,
|
||||||
|
const QList<ModelNode> &,
|
||||||
|
const QList<QVariant> &) override
|
||||||
|
{}
|
||||||
|
|
||||||
|
void rewriterBeginTransaction() override {}
|
||||||
|
void rewriterEndTransaction() override {}
|
||||||
|
|
||||||
|
void importsChanged(const QList<Import> &, const QList<Import> &) override {}
|
||||||
|
|
||||||
|
TextModifier *textModifier() const { return {}; }
|
||||||
|
void setTextModifier(TextModifier *) {}
|
||||||
|
QString textModifierContent() const { return {}; }
|
||||||
|
|
||||||
|
void reactivateTextMofifierChangeSignals() {}
|
||||||
|
void deactivateTextMofifierChangeSignals() {}
|
||||||
|
|
||||||
|
void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data) override
|
||||||
|
{}
|
||||||
|
|
||||||
|
Internal::ModelNodePositionStorage *positionStorage() const {}
|
||||||
|
|
||||||
|
QList<DocumentMessage> warnings() const { return {}; }
|
||||||
|
QList<DocumentMessage> errors() const { return {}; }
|
||||||
|
void clearErrorAndWarnings() {}
|
||||||
|
void setErrors(const QList<DocumentMessage> &) {}
|
||||||
|
void setWarnings(const QList<DocumentMessage> &) {}
|
||||||
|
void setIncompleteTypeInformation(bool) {}
|
||||||
|
bool hasIncompleteTypeInformation() const { return false; }
|
||||||
|
void addError(const DocumentMessage &) {}
|
||||||
|
|
||||||
|
void enterErrorState(const QString &) {}
|
||||||
|
bool inErrorState() const { return false; }
|
||||||
|
void leaveErrorState() {}
|
||||||
|
void resetToLastCorrectQml() {}
|
||||||
|
|
||||||
|
QMap<ModelNode, QString> extractText(const QList<ModelNode> &) const;
|
||||||
|
int nodeOffset(const ModelNode &) const;
|
||||||
|
int nodeLength(const ModelNode &) const;
|
||||||
|
int firstDefinitionInsideOffset(const ModelNode &) const { return {}; }
|
||||||
|
int firstDefinitionInsideLength(const ModelNode &) const { return {}; }
|
||||||
|
bool modificationGroupActive() { return {}; }
|
||||||
|
ModelNode nodeAtTextCursorPosition(int) const { return {}; }
|
||||||
|
|
||||||
|
bool renameId(const QString &, const QString &) { return {}; }
|
||||||
|
|
||||||
|
const QmlJS::Document *document() const { return {}; }
|
||||||
|
const QmlJS::ScopeChain *scopeChain() const { return {}; }
|
||||||
|
|
||||||
|
QString convertTypeToImportAlias(const QString &) const { return {}; }
|
||||||
|
|
||||||
|
bool checkSemanticErrors() const { return {}; }
|
||||||
|
|
||||||
|
void setCheckSemanticErrors(bool) {}
|
||||||
|
|
||||||
|
QString pathForImport(const Import &) { return {}; }
|
||||||
|
|
||||||
|
QStringList importDirectories() const { return {}; }
|
||||||
|
|
||||||
|
QSet<QPair<QString, QString>> qrcMapping() const { return {}; }
|
||||||
|
|
||||||
|
void moveToComponent(const ModelNode &) {}
|
||||||
|
|
||||||
|
QStringList autoComplete(const QString &, int, bool = true) { return {}; }
|
||||||
|
|
||||||
|
QList<CppTypeData> getCppTypes() { return {}; }
|
||||||
|
|
||||||
|
void setWidgetStatusCallback(std::function<void(bool)> setWidgetStatusCallback);
|
||||||
|
|
||||||
|
void qmlTextChanged() {}
|
||||||
|
void delayedSetup() {}
|
||||||
|
|
||||||
|
void writeAuxiliaryData() {}
|
||||||
|
void restoreAuxiliaryData() {}
|
||||||
|
|
||||||
|
QString getRawAuxiliaryData() const { return {}; }
|
||||||
|
QString auxiliaryDataAsQML() const { return {}; }
|
||||||
|
|
||||||
|
ModelNode getNodeForCanonicalIndex(int) { return {}; }
|
||||||
|
};
|
||||||
|
|
||||||
|
} //QmlDesigner
|
@@ -16,6 +16,7 @@ include($$PWD/../../../src/plugins/clangpchmanager/clangpchmanager-source.pri)
|
|||||||
include($$PWD/../../../src/plugins/cpptools/cpptoolsunittestfiles.pri)
|
include($$PWD/../../../src/plugins/cpptools/cpptoolsunittestfiles.pri)
|
||||||
include($$PWD/../../../src/plugins/debugger/debuggerunittestfiles.pri)
|
include($$PWD/../../../src/plugins/debugger/debuggerunittestfiles.pri)
|
||||||
include($$PWD/../../../src/plugins/compilationdatabaseprojectmanager/compilationdatabaseunittestfiles.pri)
|
include($$PWD/../../../src/plugins/compilationdatabaseprojectmanager/compilationdatabaseunittestfiles.pri)
|
||||||
|
include($$PWD/../../../src/plugins/qmldesigner/qmldesignerunittestfiles.pri)
|
||||||
!isEmpty(QTC_UNITTEST_BUILD_CPP_PARSER):include(cplusplus.pri)
|
!isEmpty(QTC_UNITTEST_BUILD_CPP_PARSER):include(cplusplus.pri)
|
||||||
!isEmpty(LLVM_VERSION) {
|
!isEmpty(LLVM_VERSION) {
|
||||||
include($$PWD/../../../src/plugins/clangtools/clangtoolsunittestfiles.pri)
|
include($$PWD/../../../src/plugins/clangtools/clangtoolsunittestfiles.pri)
|
||||||
|
47
tests/unit/unittest/listmodeleditor-test.cpp
Normal file
47
tests/unit/unittest/listmodeleditor-test.cpp
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 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 "googletest.h"
|
||||||
|
|
||||||
|
#include <qmldesigner/components/listmodeleditor/listmodeleditormodel.h>
|
||||||
|
#include <qmldesigner/components/listmodeleditor/listmodeleditorview.h>
|
||||||
|
#include <qmldesigner/designercore/include/model.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class ListModelEditor : public testing::Test
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ListModelEditor() { designerModel->attachView(&view); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::unique_ptr<QmlDesigner::Model> designerModel{QmlDesigner::Model::create("QtQuick.Item", 1, 1)};
|
||||||
|
QmlDesigner::ListModelEditorView view;
|
||||||
|
QmlDesigner::ListModelEditorModel model;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
@@ -1,4 +1,5 @@
|
|||||||
INCLUDEPATH += ../mockup
|
INCLUDEPATH += ../mockup
|
||||||
|
INCLUDEPATH += ../mockup/qmldesigner/designercore/include
|
||||||
|
|
||||||
QT += core network testlib widgets
|
QT += core network testlib widgets
|
||||||
CONFIG += console c++14 testcase
|
CONFIG += console c++14 testcase
|
||||||
@@ -65,6 +66,7 @@ SOURCES += \
|
|||||||
gtest-qt-printing.cpp \
|
gtest-qt-printing.cpp \
|
||||||
lastchangedrowid-test.cpp \
|
lastchangedrowid-test.cpp \
|
||||||
lineprefixer-test.cpp \
|
lineprefixer-test.cpp \
|
||||||
|
listmodeleditor-test.cpp \
|
||||||
locatorfilter-test.cpp \
|
locatorfilter-test.cpp \
|
||||||
mimedatabase-utilities.cpp \
|
mimedatabase-utilities.cpp \
|
||||||
pchmanagerclientserverinprocess-test.cpp \
|
pchmanagerclientserverinprocess-test.cpp \
|
||||||
@@ -288,7 +290,11 @@ HEADERS += \
|
|||||||
mockbuilddependencygenerator.h \
|
mockbuilddependencygenerator.h \
|
||||||
mockpchtasksmerger.h \
|
mockpchtasksmerger.h \
|
||||||
mockpchtaskqueue.h \
|
mockpchtaskqueue.h \
|
||||||
mockpchtaskgenerator.h
|
mockpchtaskgenerator.h \
|
||||||
|
../mockup/qmldesigner/designercore/include/nodeinstanceview.h \
|
||||||
|
../mockup/qmldesigner/designercore/include/rewriterview.h \
|
||||||
|
../mockup/qmldesigner/designercore/include/itemlibraryitem.h
|
||||||
|
|
||||||
|
|
||||||
!isEmpty(LIBCLANG_LIBS) {
|
!isEmpty(LIBCLANG_LIBS) {
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
Reference in New Issue
Block a user