diff options
author | Leena Miettinen <riitta-leena.miettinen@digia.com> | 2012-12-10 10:44:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-11 07:50:39 +0100 |
commit | d5093ec4801e0cae5336d07e2d776223233d465f (patch) | |
tree | 228247a47e3f92c6fa5ef20187ee57a1b1a3ff2d | |
parent | f46226f6aa2b97cf402bebbec1cbac49fb7c4095 (diff) |
Doc: modularize Qt Designer custom plugin docs
Create index and module pages for Qt Designer custom
plugin classes. Modify the qdocconf file to also build
the Qt Designer plugin class docs. Move snippets from
qtdoc to qttools. Fix links to the classes page in example docs.
Change-Id: Ie191fdb07fb0b00379a15d44c1355f00815053e6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
29 files changed, 560 insertions, 67 deletions
diff --git a/examples/designer/doc/src/containerextension.qdoc b/examples/designer/doc/src/containerextension.qdoc index c97b02871..07231a624 100644 --- a/examples/designer/doc/src/containerextension.qdoc +++ b/examples/designer/doc/src/containerextension.qdoc @@ -64,7 +64,7 @@ You can use all the extensions following the same pattern as in this example, only replacing the respective extension base - class. For more information, see the \l {QtDesigner Module}. + class. For more information, see \l{Qt Designer C++ Classes}. The Container Extension example consists of four classes: diff --git a/examples/designer/doc/src/taskmenuextension.qdoc b/examples/designer/doc/src/taskmenuextension.qdoc index e6dcae359..7712486be 100644 --- a/examples/designer/doc/src/taskmenuextension.qdoc +++ b/examples/designer/doc/src/taskmenuextension.qdoc @@ -64,7 +64,7 @@ You can use all the extensions following the same pattern as in this example, only replacing the respective extension base - class. For more information, see the \l {QtDesigner Module}. + class. For more information, see the \l{Qt Designer C++ Classes}. The Task Menu Extension example consists of five classes: diff --git a/src/designer/src/designer/doc/qtdesigner.qdocconf b/src/designer/src/designer/doc/qtdesigner.qdocconf index 329853ccb..d477390d0 100644 --- a/src/designer/src/designer/doc/qtdesigner.qdocconf +++ b/src/designer/src/designer/doc/qtdesigner.qdocconf @@ -22,17 +22,28 @@ qhp.QtDesigner.subprojects.examples.title = Examples qhp.QtDesigner.subprojects.examples.indexTitle = Qt Examples qhp.QtDesigner.subprojects.examples.selectors = fake:example qhp.QtDesigner.subprojects.examples.sortPages = true +qhp.QtDesigner.subprojects = classes +qhp.QtDesigner.subprojects.classes.title = C++ Classes +qhp.QtDesigner.subprojects.classes.indexTitle = Qt Designer C++ Classes +qhp.QtDesigner.subprojects.classes.selectors = class fake:headerfile +qhp.QtDesigner.subprojects.classes.sortPages = true language = Cpp -sourcedirs = .. +headerdirs += .. \ + ../../lib + +sourcedirs = .. \ + ../../lib exampledirs = ../../../../../examples/designer \ ../../../../../examples/uitools \ snippets +excludefiles += ../../lib/uilib/extension.h + imagedirs = images outputdir = $QT_INSTALL_DOCS/qtdesigner -depends += qtdoc qtbase qtwidgets qtcore +depends += qtdoc qtwidgets qtcore diff --git a/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp new file mode 100644 index 000000000..b2c1a47e5 --- /dev/null +++ b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp @@ -0,0 +1,328 @@ +/**************************************************************************** +** +** 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_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; +} + +Q_EXPORT_PLUGIN2(customwidgetsplugin, MyCustomWidgets) +//! [13] + + +//! [14] +Q_EXPORT_PLUGIN2(customwidgetplugin, MyCustomWidget) +//! [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/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.pro b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.pro new file mode 100644 index 000000000..719782d2f --- /dev/null +++ b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.pro @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** 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] diff --git a/src/designer/src/designer/doc/src/designer-manual.qdoc b/src/designer/src/designer/doc/src/designer-manual.qdoc index 834339e9e..a93c90605 100644 --- a/src/designer/src/designer/doc/src/designer-manual.qdoc +++ b/src/designer/src/designer/doc/src/designer-manual.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \page qtdesigner-index.html + \page qtdesigner-manual.html \title Qt Designer Manual \ingroup qttools diff --git a/src/designer/src/designer/doc/src/qtdesigner-index.qdoc b/src/designer/src/designer/doc/src/qtdesigner-index.qdoc new file mode 100644 index 000000000..2f709f7ff --- /dev/null +++ b/src/designer/src/designer/doc/src/qtdesigner-index.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** 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:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtdesigner-index.html + \title Qt Designer + + \brief Provides classes to create your own custom widget plugins for + Qt Designer and classes to access Qt Designer components. + + In addition, the QFormBuilder class provides the possibility of + constructing user interfaces from UI files at run-time. + + \section1 Getting Started + + To use Qt Designer classes,add this directive into the C++ files: + + \snippet plugins/doc_src_qtdesigner.cpp 0 + + To link against the Qt Designer module, add this line to the project file: + + \snippet plugins/doc_src_qtdesigner.pro 1 + + \section1 Articles and Guides + + These articles contain information about Qt Designer. + + \list + \li \l{Creating and Using Components for Qt Designer} - Creating and using + custom widget plugins + \li \l{Qt Designer Manual} - Using Qt Designer + \endlist + + \section1 API Reference + + These are links to the API reference material. + + \list + \li \l{Qt Designer C++ Classes}{C++ Classes} + \endlist + +*/ diff --git a/src/designer/src/designer/doc/src/qtdesigner-module.qdoc b/src/designer/src/designer/doc/src/qtdesigner-module.qdoc new file mode 100644 index 000000000..d667eecb6 --- /dev/null +++ b/src/designer/src/designer/doc/src/qtdesigner-module.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** 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:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \module QtDesigner + \title Qt Designer C++ Classes + \ingroup modules + + \brief Provides classes to create your own custom widget plugins for + Qt Designer and classes to access Qt Designer 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 classes, use the following + directive: + + \snippet plugins/doc_src_qtdesigner.cpp 0 + + To link against the module, add this line to your \c qmake .pro file: + + \snippet plugins/doc_src_qtdesigner.pro 1 +*/ diff --git a/src/designer/src/lib/extension/default_extensionfactory.cpp b/src/designer/src/lib/extension/default_extensionfactory.cpp index 39f71ddbb..ada383ec8 100644 --- a/src/designer/src/lib/extension/default_extensionfactory.cpp +++ b/src/designer/src/lib/extension/default_extensionfactory.cpp @@ -80,16 +80,16 @@ QT_BEGIN_NAMESPACE You can either create a new QExtensionFactory and reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp 0 + \snippet lib/tools_designer_src_lib_extension_default_extensionfactory.cpp 0 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create your extension as well. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp 1 + \snippet lib/tools_designer_src_lib_extension_default_extensionfactory.cpp 1 For a complete example using the QExtensionFactory class, see the - \l {designer/taskmenuextension}{Task Menu Extension example}. The + \l {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the QDesignerTaskMenuExtension class to add custom items to Qt Designer's task menu. diff --git a/src/designer/src/lib/extension/extension.cpp b/src/designer/src/lib/extension/extension.cpp index dd53eebe6..39d02d784 100644 --- a/src/designer/src/lib/extension/extension.cpp +++ b/src/designer/src/lib/extension/extension.cpp @@ -147,7 +147,7 @@ QT_BEGIN_NAMESPACE object is of type T (or of a subclass); otherwise returns 0. The extension is retrieved using the given extension \a manager. - \snippet doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp 0 + \snippet lib/tools_designer_src_lib_extension_extension.cpp 0 When implementing a custom widget plugin, a pointer to \QD's current QDesignerFormEditorInterface object (\c formEditor) is @@ -169,7 +169,7 @@ QT_BEGIN_NAMESPACE extension class called \a ExtensionName. The \a Identifier must be unique. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp 1 + \snippet lib/tools_designer_src_lib_extension_extension.cpp 1 Using the company and product names is a good way to ensure uniqueness of the identifier. diff --git a/src/designer/src/lib/extension/qextensionmanager.cpp b/src/designer/src/lib/extension/qextensionmanager.cpp index eefbd80bf..bda2e22d4 100644 --- a/src/designer/src/lib/extension/qextensionmanager.cpp +++ b/src/designer/src/lib/extension/qextensionmanager.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE The registration of an extension factory is typically made in the QDesignerCustomWidgetInterface::initialize() function: - \snippet doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp 0 + \snippet lib/tools_designer_src_lib_extension_qextensionmanager.cpp 0 The QExtensionManager is not intended to be instantiated directly. You can retrieve an interface to \QD's extension manager @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE sheet, a property sheet or a task menu. For a complete example using the QExtensionManager class, see the - \l {designer/taskmenuextension}{Task Menu Extension example}. The + \l {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the QDesignerTaskMenuExtension class to add custom items to \QD's task menu. diff --git a/src/designer/src/lib/sdk/abstractformeditor.cpp b/src/designer/src/lib/sdk/abstractformeditor.cpp index 1ab0e6aec..59fee9ee7 100644 --- a/src/designer/src/lib/sdk/abstractformeditor.cpp +++ b/src/designer/src/lib/sdk/abstractformeditor.cpp @@ -149,7 +149,7 @@ QDesignerFormEditorInterfacePrivate::~QDesignerFormEditorInterfacePrivate() these components. They are typically used to query (and manipulate) the respective component. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractformeditor.cpp 0 QDesignerFormEditorInterface is not intended to be instantiated directly. A pointer to \QD's current QDesignerFormEditorInterface diff --git a/src/designer/src/lib/sdk/abstractformwindow.cpp b/src/designer/src/lib/sdk/abstractformwindow.cpp index 50be10deb..572c6133a 100644 --- a/src/designer/src/lib/sdk/abstractformwindow.cpp +++ b/src/designer/src/lib/sdk/abstractformwindow.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE widget, you can use the static QDesignerFormWindowInterface::findFormWindow() function: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractformwindow.cpp 0 But in addition, you can access any of the current form windows through \QD's form window manager: Use the @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE through the QDesignerFormWindowManagerInterface::formWindow() function. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp 1 + \snippet lib/tools_designer_src_lib_sdk_abstractformwindow.cpp 1 The pointer to \QD's current QDesignerFormEditorInterface object (\c formEditor in the example above) is provided by the @@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE with functions that enables you to control whether a widget should be managed by \QD, or not: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp 2 + \snippet lib/tools_designer_src_lib_sdk_abstractformwindow.cpp 2 The complete list of functions concerning widget management is: isManaged(), manageWidget() and unmanageWidget(). There is also diff --git a/src/designer/src/lib/sdk/abstractformwindowcursor.cpp b/src/designer/src/lib/sdk/abstractformwindowcursor.cpp index d83497470..665565562 100644 --- a/src/designer/src/lib/sdk/abstractformwindowcursor.cpp +++ b/src/designer/src/lib/sdk/abstractformwindowcursor.cpp @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE QDesignerFormWindowInterface::findFormWindow() functions. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp 0 You can retrieve any of \QD's current form windows through \QD's \l {QDesignerFormWindowManagerInterface}{form window diff --git a/src/designer/src/lib/sdk/abstractformwindowmanager.cpp b/src/designer/src/lib/sdk/abstractformwindowmanager.cpp index 7ff95e352..832d8ef33 100644 --- a/src/designer/src/lib/sdk/abstractformwindowmanager.cpp +++ b/src/designer/src/lib/sdk/abstractformwindowmanager.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE the QDesignerFormEditorInterface::formWindowManager() function. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp 0 When implementing a custom widget plugin, a pointer to \QD's current QDesignerFormEditorInterface object (\c formEditor in the @@ -409,7 +409,7 @@ QAction *QDesignerFormWindowManagerInterface::actionSimplifyLayout() const */ /*! - \n virtual void QDesignerFormWindowManagerInterface::removeFormWindow(QDesignerFormWindowInterface *formWindow) + \fn virtual void QDesignerFormWindowManagerInterface::removeFormWindow(QDesignerFormWindowInterface *formWindow) Removes the given \a formWindow from the collection of windows that \QD's form window manager maintains. @@ -488,7 +488,7 @@ QAction *QDesignerFormWindowManagerInterface::actionRedo() const \fn void QDesignerFormWindowManagerInterface::formWindowSettingsChanged(QDesignerFormWindowInterface *formWindow) This signal is emitted when the settings of the form window change. It can be used to update - window titles, etc. accordingly. + window titles, etc. accordingly. A pointer to the \a formWindow is passed as an argument. \sa FormWindowSettingsDialogAction */ diff --git a/src/designer/src/lib/sdk/abstractobjectinspector.cpp b/src/designer/src/lib/sdk/abstractobjectinspector.cpp index 98042ca55..6abeb8cd7 100644 --- a/src/designer/src/lib/sdk/abstractobjectinspector.cpp +++ b/src/designer/src/lib/sdk/abstractobjectinspector.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE current form window selection. For example, when implementing a custom widget plugin: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractobjectinspector.cpp 0 The QDesignerObjectInspectorInterface class is not intended to be instantiated directly. You can retrieve an interface to \QD's diff --git a/src/designer/src/lib/sdk/abstractpromotioninterface.cpp b/src/designer/src/lib/sdk/abstractpromotioninterface.cpp index 0942665b9..3f9d43723 100644 --- a/src/designer/src/lib/sdk/abstractpromotioninterface.cpp +++ b/src/designer/src/lib/sdk/abstractpromotioninterface.cpp @@ -59,16 +59,20 @@ QDesignerPromotionInterface::~QDesignerPromotionInterface() /*! \class QDesignerPromotionInterface::PromotedClass + \inmodule QtDesigner A pair of database items containing the base class and the promoted class. +*/ +/*! \typedef QDesignerPromotionInterface::PromotedClasses A list of PromotedClass items. +*/ - virtual QDesignerPromotionInterface::PromotedClasses promotedClasses() const +/*! + \fn virtual QDesignerPromotionInterface::PromotedClasses promotedClasses() const Returns a list of promoted classes along with their base classes in alphabetical order. It can be used to populate tree models for editing promoted widgets. - */ /*! diff --git a/src/designer/src/lib/sdk/abstractpropertyeditor.cpp b/src/designer/src/lib/sdk/abstractpropertyeditor.cpp index b9731168b..10cba4d39 100644 --- a/src/designer/src/lib/sdk/abstractpropertyeditor.cpp +++ b/src/designer/src/lib/sdk/abstractpropertyeditor.cpp @@ -63,13 +63,13 @@ QT_BEGIN_NAMESPACE For example, when implementing a custom widget plugin, you can connect the signal to a custom slot: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp 0 Then the custom slot can check if the new value is within the range we want when a specified property, belonging to a particular widget, changes: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp 1 + \snippet lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp 1 The QDesignerPropertyEditorInterface class is not intended to be instantiated directly. You can retrieve an interface to \QD's diff --git a/src/designer/src/lib/sdk/abstractwidgetbox.cpp b/src/designer/src/lib/sdk/abstractwidgetbox.cpp index 9268b523e..f608918d9 100644 --- a/src/designer/src/lib/sdk/abstractwidgetbox.cpp +++ b/src/designer/src/lib/sdk/abstractwidgetbox.cpp @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE without calling the save() function, the original content can be restored by a simple invocation of the load() function: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 0 + \snippet lib/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 0 The QDesignerWidgetBoxInterface class is not intended to be instantiated directly. You can retrieve an interface to Qt @@ -84,16 +84,16 @@ QT_BEGIN_NAMESPACE with the setFileName() function to save your changes into another file. Remember to store the name of the original file first: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 1 + \snippet lib/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 1 Then you can restore the original contents of the widget box by resetting the file name to the original file and calling load(): - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 2 + \snippet lib/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 2 In a similar way, you can later use your customized XML file: - \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 3 + \snippet lib/tools_designer_src_lib_sdk_abstractwidgetbox.cpp 3 \sa QDesignerFormEditorInterface diff --git a/src/designer/src/lib/sdk/membersheet.qdoc b/src/designer/src/lib/sdk/membersheet.qdoc index 9d19534b5..7be875412 100644 --- a/src/designer/src/lib/sdk/membersheet.qdoc +++ b/src/designer/src/lib/sdk/membersheet.qdoc @@ -40,7 +40,7 @@ manipulate the member functions' appearance in \QD's signals and slots editing mode. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 2 + \snippet plugins/doc_src_qtdesigner.cpp 2 When implementing a custom widget plugin, a pointer to \QD's current QDesignerFormEditorInterface object (\c formEditor in the @@ -69,7 +69,7 @@ made known to the meta object system using the Q_INTERFACES() macro: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 3 + \snippet plugins/doc_src_qtdesigner.cpp 3 This enables \QD to use qobject_cast() to query for supported interfaces using nothing but a QObject pointer. @@ -101,16 +101,16 @@ QExtensionFactory and reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 4 + \snippet plugins/doc_src_qtdesigner.cpp 4 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a member sheet extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 5 + \snippet plugins/doc_src_qtdesigner.cpp 5 For a complete example using an extension class, see \l - {designer/taskmenuextension}{Task Menu Extension example}. The + {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the QDesignerTaskMenuExtension class to add custom items to \QD's task menu. diff --git a/src/designer/src/lib/sdk/propertysheet.qdoc b/src/designer/src/lib/sdk/propertysheet.qdoc index 0c14a3a05..035ea8308 100644 --- a/src/designer/src/lib/sdk/propertysheet.qdoc +++ b/src/designer/src/lib/sdk/propertysheet.qdoc @@ -41,7 +41,7 @@ manipulate the properties' appearance in the property editor. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 15 + \snippet plugins/doc_src_qtdesigner.cpp 15 Note that if you change the value of a property using the QDesignerPropertySheetExtension::setProperty() function, the undo @@ -86,7 +86,7 @@ an interface, we must ensure that it's made known to the meta object system using the Q_INTERFACES() macro: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 16 + \snippet plugins/doc_src_qtdesigner.cpp 16 This enables \QD to use qobject_cast() to query for supported interfaces using nothing but a QObject pointer. @@ -118,17 +118,17 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 17 + \snippet plugins/doc_src_qtdesigner.cpp 17 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a property sheet extension extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 18 + \snippet plugins/doc_src_qtdesigner.cpp 18 For a complete example using an extension class, see the \l - {designer/taskmenuextension}{Task Menu Extension example}. The + {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the QDesignerTaskMenuExtension class to add custom items to \QD's task menu. diff --git a/src/designer/src/lib/sdk/taskmenu.qdoc b/src/designer/src/lib/sdk/taskmenu.qdoc index 9dcf99b86..e97421c7f 100644 --- a/src/designer/src/lib/sdk/taskmenu.qdoc +++ b/src/designer/src/lib/sdk/taskmenu.qdoc @@ -51,7 +51,7 @@ inherit from both QObject and QDesignerTaskMenuExtension. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 9 + \snippet plugins/doc_src_qtdesigner.cpp 9 Since we are implementing an interface, we must ensure that it is made known to the meta-object system using the Q_INTERFACES() @@ -94,16 +94,16 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 10 + \snippet plugins/doc_src_qtdesigner.cpp 10 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a task menu extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 11 + \snippet plugins/doc_src_qtdesigner.cpp 11 For a complete example using the QDesignerTaskMenuExtension class, - see the \l {designer/taskmenuextension}{Task Menu Extension + see the \l {taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for \QD, and how to to use the QDesignerTaskMenuExtension class to add custom items to \QD's task menu. diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 9995f1272..266190e56 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -100,7 +100,7 @@ void updateWizardLayout(QWidget *layoutBase) } /*! - \class Layout layout.h + \class qdesigner_internal::Layout \brief Baseclass for layouting widgets in the Designer (Helper for Layout commands) \internal diff --git a/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp b/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp index 629a36f33..80b8a32a0 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp +++ b/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp @@ -50,6 +50,7 @@ using namespace qdesigner_internal; /*! \class QDesignerFormWindowManager + \inmodule QtDesigner Extends QDesignerFormWindowManagerInterface with methods to control the preview and printing of forms. It provides a facade that simplifies @@ -85,8 +86,7 @@ void QDesignerFormWindowManager::showPluginDialog() } /*! - \fn - void QDesignerFormWindowManager::formWindowSettingsChanged(QDesignerFormWindowInterface *fw); + \fn void QDesignerFormWindowManager::formWindowSettingsChanged(QDesignerFormWindowInterface *fw); This signal is emitted when the form settings dialog was shown and changes have been made to the form. diff --git a/src/designer/src/lib/shared/qdesigner_qsettings.cpp b/src/designer/src/lib/shared/qdesigner_qsettings.cpp index 8f8bf21be..1da82ef70 100644 --- a/src/designer/src/lib/shared/qdesigner_qsettings.cpp +++ b/src/designer/src/lib/shared/qdesigner_qsettings.cpp @@ -47,12 +47,6 @@ #include <QtCore/QString> #include <QtCore/QDebug> -/*! - \class QDesignerSettingsSimple - - \brief Implements QDesignerSettingsInterface by calls to QSettings - */ - QDesignerQSettings::QDesignerQSettings() : m_settings(qApp->organizationName(), settingsApplicationName()) { diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index 2ed0d2c34..097952e05 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -127,7 +127,7 @@ public: QFormBuilder class to create user interfaces from UI files at run-time. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp 0 + \snippet lib/tools_designer_src_lib_uilib_abstractformbuilder.cpp 0 To override certain aspects of the form builder's behavior, subclass QAbstractFormBuilder and reimplement the relevant virtual diff --git a/src/designer/src/lib/uilib/container.qdoc b/src/designer/src/lib/uilib/container.qdoc index 95ef518e0..852b16410 100644 --- a/src/designer/src/lib/uilib/container.qdoc +++ b/src/designer/src/lib/uilib/container.qdoc @@ -44,7 +44,7 @@ To create a container extension, your extension class must inherit from both QObject and QDesignerContainerExtension. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 6 + \snippet plugins/doc_src_qtdesigner.cpp 6 Since we are implementing an interface, we must ensure that it's made known to the meta object system using the Q_INTERFACES() @@ -88,16 +88,16 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 7 + \snippet plugins/doc_src_qtdesigner.cpp 7 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a container extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 8 + \snippet plugins/doc_src_qtdesigner.cpp 8 For a complete example using the QDesignerContainerExtension - class, see the \l {designer/containerextension}{Container + class, see the \l {containerextension}{Container Extension example}. The example shows how to create a custom multi-page plugin for \QD. diff --git a/src/designer/src/lib/uilib/customwidget.qdoc b/src/designer/src/lib/uilib/customwidget.qdoc index ebf5a2e28..97ca87ca8 100644 --- a/src/designer/src/lib/uilib/customwidget.qdoc +++ b/src/designer/src/lib/uilib/customwidget.qdoc @@ -46,7 +46,7 @@ \l{Custom Widget Plugin Example}{Custom Widget Plugin example} that enables an analog clock custom widget to be used by \QD: - \snippet examples/designer/customwidgetplugin/customwidgetplugin.h 0 + \snippet customwidgetplugin/customwidgetplugin.h 0 Note that the only part of the class definition that is specific to this particular custom widget is the class name. In addition, @@ -72,7 +72,7 @@ class called \c MyCustomWidget, we can export it by adding the following line to the file containing the plugin header: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 14 + \snippet plugins/doc_src_qtdesigner.cpp 14 This macro ensures that \QD can access and construct the custom widget. Without this macro, there is no way for \QD to use it. @@ -105,7 +105,7 @@ \endlist For a complete example using the QDesignerCustomWidgetInterface - class, see the \l {designer/customwidgetplugin}{Custom Widget + class, see the \l {customwidgetplugin}{Custom Widget Example}. The example shows how to create a custom widget plugin for \QD. @@ -229,12 +229,12 @@ Using this macro ensures that the symbols are retained on those platforms, and has no side effects on other platforms. - For example, the \l{designer/worldtimeclockplugin}{World Time Clock Plugin} + For example, the \l{worldtimeclockplugin}{World Time Clock Plugin} example exports a custom widget class with the following declaration: - \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 0 + \snippet worldtimeclockplugin/worldtimeclock.h 0 \dots - \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 2 + \snippet worldtimeclockplugin/worldtimeclock.h 2 \sa {Creating Custom Widgets for Qt Designer} */ @@ -262,13 +262,13 @@ several custom widgets \c CustomWidgetOne, \c CustomWidgetTwo and \c CustomWidgetThree, the class definition may look like this: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 12 + \snippet plugins/doc_src_qtdesigner.cpp 12 In the class constructor you add the interfaces to your custom widgets to the list which you return in the customWidgets() function: - \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 13 + \snippet plugins/doc_src_qtdesigner.cpp 13 Note that instead of exporting each custom widget plugin using the Q_PLUGIN_METADATA() macro, you export the entire collection. The diff --git a/src/designer/src/lib/uilib/formbuilder.cpp b/src/designer/src/lib/uilib/formbuilder.cpp index 2d7bb7f93..b285eaf3c 100644 --- a/src/designer/src/lib/uilib/formbuilder.cpp +++ b/src/designer/src/lib/uilib/formbuilder.cpp @@ -64,13 +64,13 @@ namespace QFormInternal { creating user interfaces at run-time, based on UI files created with \QD. For example: - \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 0 + \snippet lib/tools_designer_src_lib_uilib_formbuilder.cpp 0 By including the user interface in the example's resources (\c myForm.qrc), we ensure that it will be present when the example is run: - \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 1 + \snippet lib/tools_designer_src_lib_uilib_formbuilder.cpp 1 QFormBuilder extends the QAbstractFormBuilder base class with a number of functions that are used to support custom widget |