diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-06-02 13:59:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-07 10:12:27 +0200 |
commit | 7ce30f9e366a120bc4e69674fba0ab5d0a65ca6f (patch) | |
tree | f0223bfe5c0896f0d1d9ac8abbeed18d97fa7c62 /src | |
parent | ef4c147e11007a47d4adf49a61d6aeae497574ab (diff) | |
download | qtquick1-7ce30f9e366a120bc4e69674fba0ab5d0a65ca6f.tar.gz |
Move the designer plugin from qttools here
Like this the plugin is together with the functionality and
thus automatically gets installed when the module gets
installed.
Change-Id: I01f9f61d46fb5ef11c5c8f474df8df59865e535c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/plugins.pro | 2 | ||||
-rw-r--r-- | src/plugins/qdeclarativeview/qdeclarativeview.json | 1 | ||||
-rw-r--r-- | src/plugins/qdeclarativeview/qdeclarativeview.pro | 18 | ||||
-rw-r--r-- | src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp | 130 | ||||
-rw-r--r-- | src/plugins/qdeclarativeview/qdeclarativeview_plugin.h | 75 |
5 files changed, 225 insertions, 1 deletions
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 21d41c18..49039871 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs SUBDIRS += qmltooling - +contains(QT_CONFIG, designer):SUBDIRS += qdeclarativeview diff --git a/src/plugins/qdeclarativeview/qdeclarativeview.json b/src/plugins/qdeclarativeview/qdeclarativeview.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/src/plugins/qdeclarativeview/qdeclarativeview.json @@ -0,0 +1 @@ +{} diff --git a/src/plugins/qdeclarativeview/qdeclarativeview.pro b/src/plugins/qdeclarativeview/qdeclarativeview.pro new file mode 100644 index 00000000..6b63dfb2 --- /dev/null +++ b/src/plugins/qdeclarativeview/qdeclarativeview.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +TARGET = qdeclarativeview +CONFIG += qt warn_on plugin designer +QT += quick1 widgets designer + +DESTDIR = $$QT.designer.plugins/designer +contains(TEMPLATE, ".*lib"):TARGET = $$qtLibraryTarget($$TARGET) +target.path = $$[QT_INSTALL_PLUGINS]/designer +INSTALLS += target + +build_all:!build_pass { + CONFIG -= build_all + CONFIG += release +} + +SOURCES += qdeclarativeview_plugin.cpp +HEADERS += qdeclarativeview_plugin.h +OTHER_FILES += qdeclarativeview.json diff --git a/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp b/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp new file mode 100644 index 00000000..9415d723 --- /dev/null +++ b/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQuick1 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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. +** +** 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. +** +** 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. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativeview_plugin.h" + +#include <QtDesigner/QExtensionFactory> +#include <QtDesigner/QExtensionManager> + +#include <QtCore/qplugin.h> +#include <QtQuick1/QDeclarativeView> + +static const char toolTipC[] = "QtDeclarative view widget"; + +QT_BEGIN_NAMESPACE + +QDeclarativeViewPlugin::QDeclarativeViewPlugin(QObject *parent) : + QObject(parent), + m_initialized(false) +{ +} + +QString QDeclarativeViewPlugin::name() const +{ + return QStringLiteral("QDeclarativeView"); +} + +QString QDeclarativeViewPlugin::group() const +{ + return QStringLiteral("Display Widgets"); +} + +QString QDeclarativeViewPlugin::toolTip() const +{ + return tr(toolTipC); +} + +QString QDeclarativeViewPlugin::whatsThis() const +{ + return tr(toolTipC); +} + +QString QDeclarativeViewPlugin::includeFile() const +{ + return QStringLiteral("QtDeclarative/QDeclarativeView"); +} + +QIcon QDeclarativeViewPlugin::icon() const +{ + return QIcon(); +} + +bool QDeclarativeViewPlugin::isContainer() const +{ + return false; +} + +QWidget *QDeclarativeViewPlugin::createWidget(QWidget *parent) +{ + return new QDeclarativeView(parent); +} + +bool QDeclarativeViewPlugin::isInitialized() const +{ + return m_initialized; +} + +void QDeclarativeViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/) +{ + if (m_initialized) + return; + + m_initialized = true; +} + +QString QDeclarativeViewPlugin::domXml() const +{ + return QStringLiteral("\ + <ui language=\"c++\">\ + <widget class=\"QDeclarativeView\" name=\"declarativeView\">\ + <property name=\"geometry\">\ + <rect>\ + <x>0</x>\ + <y>0</y>\ + <width>300</width>\ + <height>200</height>\ + </rect>\ + </property>\ + </widget>\ + </ui>"); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h b/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h new file mode 100644 index 00000000..49a32491 --- /dev/null +++ b/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQuick1 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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. +** +** 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. +** +** 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. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEVIEW_PLUGIN_H +#define QDECLARATIVEVIEW_PLUGIN_H + +#include <QtDesigner/QDesignerCustomWidgetInterface> + +QT_BEGIN_NAMESPACE + +class QDeclarativeViewPlugin: public QObject, public QDesignerCustomWidgetInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "qdeclarativeview.json") + Q_INTERFACES(QDesignerCustomWidgetInterface) +public: + QDeclarativeViewPlugin(QObject *parent = 0); + + virtual QString name() const; + virtual QString group() const; + virtual QString toolTip() const; + virtual QString whatsThis() const; + virtual QString includeFile() const; + virtual QIcon icon() const; + virtual bool isContainer() const; + virtual QWidget *createWidget(QWidget *parent); + virtual bool isInitialized() const; + virtual void initialize(QDesignerFormEditorInterface *core); + virtual QString domXml() const; + +private: + bool m_initialized; +}; + +QT_END_NAMESPACE + +#endif // QDECLARATIVEVIEW_PLUGIN_H |