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:
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:
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
--- /dev/null
+/****************************************************************************
+**
+** 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]
--- /dev/null
+/****************************************************************************
+**
+** 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]
****************************************************************************/
/*!
- \page qtdesigner-index.html
+ \page qtdesigner-manual.html
\title Qt Designer Manual
\ingroup qttools
--- /dev/null
+/****************************************************************************
+**
+** 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
+
+*/
--- /dev/null
+/****************************************************************************
+**
+** 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
+*/
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.
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
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.
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
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.
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
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
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
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
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
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
*/
/*!
- \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.
\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
*/
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
/*!
\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.
-
*/
/*!
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
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
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
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
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.
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.
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
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.
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.
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()
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.
}
/*!
- \class Layout layout.h
+ \class qdesigner_internal::Layout
\brief Baseclass for layouting widgets in the Designer (Helper for Layout commands)
\internal
/*!
\class QDesignerFormWindowManager
+ \inmodule QtDesigner
Extends QDesignerFormWindowManagerInterface with methods to control
the preview and printing of forms. It provides a facade that simplifies
}
/*!
- \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.
#include <QtCore/QString>
#include <QtCore/QDebug>
-/*!
- \class QDesignerSettingsSimple
-
- \brief Implements QDesignerSettingsInterface by calls to QSettings
- */
-
QDesignerQSettings::QDesignerQSettings() :
m_settings(qApp->organizationName(), settingsApplicationName())
{
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
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()
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.
\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,
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.
\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.
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}
*/
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
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