diff options
author | Leena Miettinen <riitta-leena.miettinen@digia.com> | 2012-12-11 10:24:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-11 10:53:13 +0100 |
commit | aee2c3a5024fd9fa0b6da7cf90f01825d6043823 (patch) | |
tree | bce5f76e54be11a457914ac66f755ee66787eee7 | |
parent | 6d35cb6c3a79b90d13ed0e4750761c5df0b0e032 (diff) | |
download | qtdoc-aee2c3a5024fd9fa0b6da7cf90f01825d6043823.tar.gz |
Doc: move Qt Designer module page to qttools
Remove the page and snippets from qtdoc, as they were moved to
qttools.
Change-Id: I578bf255c3160ebabdf468a03ab0f425e8cdd375
Reviewed-by: David Schulz <david.schulz@digia.com>
-rw-r--r-- | doc/src/modules.qdoc | 23 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qtdesigner.cpp | 327 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qtdesigner.pro | 43 |
3 files changed, 0 insertions, 393 deletions
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 804d4d99..ad4ec440 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -235,29 +235,6 @@ */ /*! - \module QtDesigner - \title QtDesigner Module - \ingroup modules - - \brief The QtDesigner module provides classes that allow you to - create your own custom widget plugins for Qt Designer, and classes - that enable you to access Qt Designer's components. - - In addition, the QFormBuilder class provides the possibility of - constructing user interfaces from UI files at run-time. - - To include the definitions of the module's classes, use the - following directive: - - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 0 - - To link against the module, add this line to your \c qmake .pro - file: - - \snippet doc/src/snippets/code/doc_src_qtdesigner.pro 1 -*/ - -/*! \module QAxContainer \title QAxContainer Module \ingroup modules diff --git a/doc/src/snippets/code/doc_src_qtdesigner.cpp b/doc/src/snippets/code/doc_src_qtdesigner.cpp deleted file mode 100644 index 1c2c6fe6..00000000 --- a/doc/src/snippets/code/doc_src_qtdesigner.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -#include <QtDesigner> -//! [0] - - -//! [2] -QDesignerMemberSheetExtension *memberSheet = 0; -QExtensionManager manager = formEditor->extensionManager(); - -memberSheet = qt_extension<QDesignerMemberSheetExtension*>(manager, widget); -int index = memberSheet->indexOf(setEchoMode); -memberSheet->setVisible(index, false); - -delete memberSheet; -//! [2] - - -//! [3] -class MyMemberSheetExtension : public QObject, - public QDesignerMemberSheetExtension -{ - Q_OBJECT - Q_INTERFACES(QDesignerMemberSheetExtension) - -public: - ... -} -//! [3] - - -//! [4] -QObject *ANewExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - if (iid != Q_TYPEID(QDesignerMemberSheetExtension)) - return 0; - - if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*> - (object)) - return new MyMemberSheetExtension(widget, parent); - - return 0; -} -//! [4] - - -//! [5] -QObject *AGeneralExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object); - - if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) { - return new MyTaskMenuExtension(widget, parent); - - } else if (widget && (iid == Q_TYPEID(QDesignerMemberSheetExtension))) { - return new MyMemberSheetExtension(widget, parent); - - } else { - return 0; - } -} -//! [5] - - -//! [6] -class MyContainerExtension : public QObject, - public QDesignerContainerExtension -{ - Q_OBJECT - Q_INTERFACES(QDesignerContainerExtension) - -public: - MyContainerExtension(MyCustomWidget *widget, - QObject *parent = 0); - int count() const; - QWidget *widget(int index) const; - int currentIndex() const; - void setCurrentIndex(int index); - void addWidget(QWidget *widget); - void insertWidget(int index, QWidget *widget); - void remove(int index); - -private: - MyCustomWidget *myWidget; -}; -//! [6] - - -//! [7] -QObject *ANewExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - if (iid != Q_TYPEID(QDesignerContainerExtension)) - return 0; - - if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*> - (object)) - return new MyContainerExtension(widget, parent); - - return 0; -} -//! [7] - - -//! [8] -QObject *AGeneralExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object); - - if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) { - return new MyTaskMenuExtension(widget, parent); - - } else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) { - return new MyContainerExtension(widget, parent); - - } else { - return 0; - } -} -//! [8] - - -//! [9] -class MyTaskMenuExtension : public QObject, - public QDesignerTaskMenuExtension -{ - Q_OBJECT - Q_INTERFACES(QDesignerTaskMenuExtension) - -public: - MyTaskMenuExtension(MyCustomWidget *widget, QObject *parent); - - QAction *preferredEditAction() const; - QList<QAction *> taskActions() const; - -private slots: - void mySlot(); - -private: - MyCustomWidget *widget; - QAction *myAction; -}; -//! [9] - - -//! [10] -QObject *ANewExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - if (iid != Q_TYPEID(QDesignerTaskMenuExtension)) - return 0; - - if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object)) - return new MyTaskMenuExtension(widget, parent); - - return 0; -} -//! [10] - - -//! [11] -QObject *AGeneralExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object); - - if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) { - return new MyContainerExtension(widget, parent); - - } else if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) { - return new MyTaskMenuExtension(widget, parent); - - } else { - return 0; - } -} -//! [11] - - -//! [12] -#include customwidgetoneinterface.h -#include customwidgettwointerface.h -#include customwidgetthreeinterface.h - -#include <QtDesigner/QtDesigner> -#include <QtCore/qplugin.h> - -class MyCustomWidgets: public QObject, public QDesignerCustomWidgetCollectionInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerMyCustomWidgets" FILE "mycustomwidgets.json") - Q_INTERFACES(QDesignerCustomWidgetCollectionInterface) - -public: - MyCustomWidgets(QObject *parent = 0); - - virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const; - -private: - QList<QDesignerCustomWidgetInterface*> widgets; -}; -//! [12] - - -//! [13] -MyCustomWidgets::MyCustomWidgets(QObject *parent) - : QObject(parent) -{ - widgets.append(new CustomWidgetOneInterface(this)); - widgets.append(new CustomWidgetTwoInterface(this)); - widgets.append(new CustomWidgetThreeInterface(this)); -} - -QList<QDesignerCustomWidgetInterface*> MyCustomWidgets::customWidgets() const -{ - return widgets; -} -//! [13] - - -//! [14] -Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerMyCustomWidgets" FILE "mycustomwidgets.json") -//! [14] - - -//! [15] -QDesignerPropertySheetExtension *propertySheet = 0; -QExtensionManager manager = formEditor->extensionManager(); - -propertySheet = qt_extension<QDesignerPropertySheetExtension*>(manager, widget); -int index = propertySheet->indexOf(QLatin1String("margin")); - -propertySheet->setProperty(index, 10); -propertySheet->setChanged(index, true); - -delete propertySheet; -//! [15] - - -//! [16] -class MyPropertySheetExtension : public QObject, - public QDesignerPropertySheetExtension -{ - Q_OBJECT - Q_INTERFACES(QDesignerPropertySheetExtension) - -public: - ... -} -//! [16] - - -//! [17] -QObject *ANewExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - if (iid != Q_TYPEID(QDesignerPropertySheetExtension)) - return 0; - - if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*> - (object)) - return new MyPropertySheetExtension(widget, parent); - - return 0; -} -//! [17] - - -//! [18] -QObject *AGeneralExtensionFactory::createExtension(QObject *object, - const QString &iid, QObject *parent) const -{ - MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object); - - if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) { - return new MyTaskMenuExtension(widget, parent); - - } else if (widget && (iid == Q_TYPEID(QDesignerPropertySheetExtension))) { - return new MyPropertySheetExtension(widget, parent); - - } else { - return 0; - } -} -//! [18] diff --git a/doc/src/snippets/code/doc_src_qtdesigner.pro b/doc/src/snippets/code/doc_src_qtdesigner.pro deleted file mode 100644 index 719782d2..00000000 --- a/doc/src/snippets/code/doc_src_qtdesigner.pro +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#! [1] -CONFIG += designer -#! [1] |