diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-11-02 14:03:54 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-11-02 18:00:25 +0100 |
commit | ffd790d7108facb987a78158c916464919a9ef30 (patch) | |
tree | 5a9d39cd469b83e6090ca08a3f6fe6fc76d3ddf2 /examples/uml/duse-mt/src/plugins | |
parent | 1563fd53a2707564cc094deec3a28de7af318cee (diff) |
Add initial support for concrete syntax
Also provide basic QML elements for UML concrete syntax
Change-Id: Ie2660ae383cc0576659b7d88a92e8d73692cd0b7
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'examples/uml/duse-mt/src/plugins')
17 files changed, 598 insertions, 4 deletions
diff --git a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.json b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.json index 86c0672f..e845db64 100644 --- a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.json +++ b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.json @@ -1,5 +1,5 @@ { - "Category": "Test", + "Category": "Concrete Syntax", "Vendor": "Qt Project", "Version": "1.0" } diff --git a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.pro b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.pro index b0d0e9e6..580564b1 100644 --- a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.pro +++ b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxview.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += quick +QT += quick-private include(../../duse-mt-plugin.pri) diff --git a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.cpp b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.cpp index 4a862ea4..e16f92ac 100644 --- a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.cpp +++ b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.cpp @@ -43,9 +43,17 @@ #include <interfaces/iuicontroller.h> #include <QtQuick/QQuickView> +#include <QtQuick/QQuickItem> + +#include "private/qquickflickable_p.h" + +#include <QtQml/QQmlEngine> +#include <QtQml/QQmlContext> #include <QtWidgets/QWidget> +#include <QtCore/QRegularExpression> + ConcreteSyntaxViewPlugin::ConcreteSyntaxViewPlugin(QObject *parent) : DuSE::IPlugin(parent), _concreteSyntaxQuickView(new QQuickView) @@ -58,7 +66,30 @@ bool ConcreteSyntaxViewPlugin::initialize(DuSE::ICore *core) _concreteSyntaxQuickView->setResizeMode(QQuickView::SizeRootObjectToView); core->uiController()->addCentralWidgetTab(QWidget::createWindowContainer(_concreteSyntaxQuickView), "Concrete Syntax"); + connect(core->uiController(), &DuSE::IUiController::addToView, this, &ConcreteSyntaxViewPlugin::addToView); return true; } +void ConcreteSyntaxViewPlugin::addToView(QObject *selectedModelingObject, QQuickItem *parent) +{ + QQmlContext *context = new QQmlContext(_concreteSyntaxQuickView->engine()->rootContext()); + context->setContextProperty(QStringLiteral("element"), selectedModelingObject); + QQmlComponent *qmlComponent = new QQmlComponent(_concreteSyntaxQuickView->engine()); + int x = qrand() % 400; + int y = qrand() % 400; + qmlComponent->setData(QString("import QtQuick 2.0\nimport QtModeling.Uml 1.0\n\n%1 { x: %2; y: %3}").arg(QString(selectedModelingObject->metaObject()->className()).remove(QRegularExpression("^Q")).remove(QRegularExpression("Object$"))).arg(x).arg(y).toLatin1(), QUrl()); + + QQuickItem *item = 0; + if (qmlComponent->isError()) { + qWarning() << qmlComponent->errors(); + } else { + item = qobject_cast<QQuickItem *>(qmlComponent->create(context)); + if (item) { + item->setParentItem(parent ? parent:(qobject_cast<QQuickFlickable *>(_concreteSyntaxQuickView->rootObject()))->contentItem()); + } + } + + qmlComponent->deleteLater(); +} + diff --git a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.h b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.h index 7c3527c4..6f2a84d7 100644 --- a/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.h +++ b/examples/uml/duse-mt/src/plugins/concretesyntaxview/concretesyntaxviewplugin.h @@ -44,6 +44,7 @@ #include <interfaces/iplugin.h> class QQuickView; +class QQuickItem; class ConcreteSyntaxViewPlugin : public DuSE::IPlugin { @@ -55,6 +56,9 @@ public: virtual bool initialize(DuSE::ICore *core); +private Q_SLOTS: + void addToView(QObject *selectedModelingObject, QQuickItem *parent = 0); + private: QQuickView *_concreteSyntaxQuickView; }; diff --git a/examples/uml/duse-mt/src/plugins/modelinspector/modelinspectorplugin.cpp b/examples/uml/duse-mt/src/plugins/modelinspector/modelinspectorplugin.cpp index 6da737fd..a29cc3ff 100644 --- a/examples/uml/duse-mt/src/plugins/modelinspector/modelinspectorplugin.cpp +++ b/examples/uml/duse-mt/src/plugins/modelinspector/modelinspectorplugin.cpp @@ -86,6 +86,7 @@ bool ModelInspectorPlugin::initialize(DuSE::ICore *core) connect(_modelingObjectView, SIGNAL(modelingObjectChanged(QModelingObject*)), core->uiController(), SIGNAL(currentModelingObjectChanged(QModelingObject*))); connect(_propertyModel, &QModelingObjectPropertyModel::indexChanged, _modelingObjectModel, &QModelingObjectModel::updateIndex); connect(core->uiController(), SIGNAL(updateCurrentModelingObject()), this, SLOT(updateCurrentModelingObject())); + connect(_modelingObjectView, SIGNAL(addToView(QObject*,QQuickItem*)), core->uiController(), SIGNAL(addToView(QObject*,QQuickItem*))); return true; } diff --git a/examples/uml/duse-mt/src/plugins/plugins.pro b/examples/uml/duse-mt/src/plugins/plugins.pro index 28395b54..7f5cdee4 100644 --- a/examples/uml/duse-mt/src/plugins/plugins.pro +++ b/examples/uml/duse-mt/src/plugins/plugins.pro @@ -5,6 +5,7 @@ SUBDIRS = \ modelinspector \ javascriptconsole \ welcomedashboard \ - concretesyntaxview \ designspaceexplorer \ - designoptimizer + designoptimizer \ + concretesyntaxview \ + umlconcretesyntax diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlClass.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlClass.qml new file mode 100644 index 00000000..0babe90f --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlClass.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + +UmlElement { + UmlSlot { + id: nameSlot + anchors.top: parent.top + Text { + id: label + text: element.name + anchors.centerIn: parent + font { family: "Korolev"; italic: element.isAbstract } + } + } + UmlSlot { + id: attributeSlot + anchors { top: nameSlot.bottom; topMargin: -1 } + height: (parent.height - nameSlot.height)/2 + ListView { + model: element.ownedAttributes + anchors { fill: parent; margins: 4 } + delegate: Text { + text: visibility(modelData.visibility) + modelData.name + ": " + (modelData.type ? modelData.type.name:"<no type>") + font { family: "Korolev" } + } + } + } + UmlSlot { + anchors { top: attributeSlot.bottom; topMargin: -1; bottom: parent.bottom } + ListView { + model: element.ownedOperations + anchors { fill: parent; margins: 4 } + delegate: Text { + text: visibility(modelData.visibility) + modelData.name + font { family: "Korolev" } + } + } + } + function visibility(visibilityEnum) + { + switch (visibilityEnum) { + case 0: return "+" + case 1: return "-" + case 2: return "#" + case 3: return "~" + } + } +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlComponent.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlComponent.qml new file mode 100644 index 00000000..a0639d5b --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlComponent.qml @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + +UmlElement { + UmlSlot { + id: nameSlot + anchors.top: parent.top + Text { + text: element.name + anchors.centerIn: parent + font { family: "Korolev"; italic: element.isAbstract } + } + Rectangle { + border.width: 1 + width: 18; height: 18 + anchors { right: parent.right; rightMargin: 6; verticalCenter: parent.verticalCenter } + Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 3 } + Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 10 } + } + } + UmlSlot { + id: partSlot + anchors { top: nameSlot.bottom; topMargin: -1; bottom: parent.bottom } + } + Row { + width: parent.width + spacing: (parent.width - 14*ports.length)/(ports.length-1) + anchors { bottom: parent.bottom; bottomMargin: -7 } + Repeater { + model: ports.length + Rectangle { + border.width: 1 + width: 14; height: 14 + } + } + } + Component.onCompleted: { + var component = Qt.createComponent("UmlProperty.qml") + if (component.status == Component.Ready) { + var partLength = parts.length + for (var i = 0; i < partLength; ++i) { + component.createObject(partSlot, { name: parts[i].name + ":" + parts[i].type.name }) + } + } + } +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlElement.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlElement.qml new file mode 100644 index 00000000..03a3d120 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlElement.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + +Rectangle { + id: element + + width: 120 + height: 80 + + // Drag area + MouseArea { + anchors.fill: parent + drag { target: parent; minimumX: 0; minimumY: 0 } + onPressed: parent.focus = true + } + + // Selection marks (begin) + Rectangle { + visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 + anchors { right: parent.right; top: parent.top; rightMargin: -2; topMargin: -2 } + } + Rectangle { + visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 + anchors { right: parent.right; bottom: parent.bottom; rightMargin: -2; bottomMargin: -2 } + } + Rectangle { + visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 + anchors { left: parent.left; top: parent.top; leftMargin: -2; topMargin: -2 } + } + Rectangle { + visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 + anchors { left: parent.left; bottom: parent.bottom; leftMargin: -2; bottomMargin: -2 } + } + // Selection marks (end) + + // Resize mark + Image { + id: resizeMark + visible: parent.focus + source: "resize-mark.png" + anchors { right: parent.right; bottom: parent.bottom } + z: 1 + MouseArea { + enabled: element.focus + + anchors.fill: parent + drag.target: resizeMark + + property int oldMouseX + property int oldMouseY + + hoverEnabled: true + + onPressed: { + element.focus = true; + oldMouseX = mouseX + oldMouseY = mouseY + } + + onPositionChanged: { + if (pressed) { + element.width = Math.max(element.width + (mouseX - oldMouseX), 80) + element.height = Math.max(element.height + (mouseY - oldMouseY), 50) + } + } + } + } + gradient: Gradient { + GradientStop { position: 0.0; color: "#FFFFF5" } + GradientStop { position: 1.0; color: "#FFFFE1" } + } +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlProperty.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlProperty.qml new file mode 100644 index 00000000..1972afa8 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlProperty.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + +UmlElement { + width: 60 + height: 40 + property alias name: label.text + property alias portsLength: repeater.model + UmlSlot { + anchors { top: parent.top; bottom: parent.bottom } + Text { + id: label + anchors.centerIn: parent + font { family: "Korolev"; italic: element.isAbstract } + } + Rectangle { + border.width: 1 + width: 18; height: 18 + anchors { right: parent.right; rightMargin: 6; verticalCenter: parent.verticalCenter } + Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 3 } + Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 10 } + } + } + Row { + width: parent.width + spacing: (parent.width - 14*ports.length)/(ports.length-1) + anchors { bottom: parent.bottom; bottomMargin: -7 } + Repeater { + id: repeater + Rectangle { + border.width: 1 + width: 14; height: 14 + } + } + } +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlSlot.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlSlot.qml new file mode 100644 index 00000000..23f22ded --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/UmlSlot.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + +Rectangle { + width: parent.width + height: childrenRect.height + 10 + border { width: 1; color: "black" } + clip: true + color: "transparent" +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmldir b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmldir new file mode 100644 index 00000000..ddc74ca3 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmldir @@ -0,0 +1,6 @@ +module QtModeling.Uml +internal UmlElement UmlElement.qml +internal UmlSlot UmlSlot.qml +UmlClass 1.0 UmlClass.qml +UmlComponent 1.0 UmlComponent.qml +UmlProperty 1.0 UmlProperty.qml diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/resize-mark.png b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/resize-mark.png Binary files differnew file mode 100644 index 00000000..b3697697 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/resize-mark.png diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.json b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.json new file mode 100644 index 00000000..e845db64 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.json @@ -0,0 +1,5 @@ +{ + "Category": "Concrete Syntax", + "Vendor": "Qt Project", + "Version": "1.0" +} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.pro b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.pro new file mode 100644 index 00000000..577b2a0e --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntax.pro @@ -0,0 +1,25 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2013-10-25T17:38:51 +# +#------------------------------------------------- + +include(../../duse-mt-plugin.pri) + +TARGETPATH = QtModeling/Uml + +QML_FILES = \ + resize-mark.png \ + UmlElement.qml \ + UmlSlot.qml \ + UmlClass.qml \ + UmlComponent.qml \ + UmlProperty.qml + +load(qml_module) + +SOURCES += umlconcretesyntaxplugin.cpp + +HEADERS += umlconcretesyntaxplugin.h + +OTHER_FILES += umlconcretesyntax.json diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.cpp b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.cpp new file mode 100644 index 00000000..783e1b46 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.cpp @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "umlconcretesyntaxplugin.h" + +UmlConcreteSyntaxPlugin::UmlConcreteSyntaxPlugin(QObject *parent) : + DuSE::IPlugin(parent) +{ +} + +bool UmlConcreteSyntaxPlugin::initialize(DuSE::ICore *core) +{ + Q_UNUSED(core); + return true; +} + diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.h b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.h new file mode 100644 index 00000000..945a2426 --- /dev/null +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/umlconcretesyntaxplugin.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtUml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef UMLCONCRETESYNTAXPLUGIN_H +#define UMLCONCRETESYNTAXPLUGIN_H + +#include <interfaces/iplugin.h> + +class QQuickView; +class QQuickItem; + +class UmlConcreteSyntaxPlugin : public DuSE::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.liveblue.DuSE.IPlugin" FILE "umlconcretesyntax.json") + +public: + UmlConcreteSyntaxPlugin(QObject *parent = 0); + + virtual bool initialize(DuSE::ICore *core); +}; + +#endif // UMLCONCRETESYNTAXPLUGIN_H + |