class MultiPageWidgetPlugin: public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
+//! [1]
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidget" FILE "multipagewidget.json")
+//! [1]
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
MultiPageWidgetPlugin(QObject *parent = 0);
page; any inital pages of a multi-page widget must be specified
within this function.
- \snippet containerextension/multipagewidgetplugin.cpp 14
+ \snippet containerextension/multipagewidgetplugin.h 1
Remember to use the Q_PLUGIN_METADATA() macro to export the
MultiPageWidgetPlugin class for use with Qt's plugin handling
default settings for the widget in the standard XML format used by
Qt Designer), since no default values are necessary.
- \snippet taskmenuextension/tictactoeplugin.cpp 4
+ \snippet taskmenuextension/tictactoeplugin.h 1
Finally, we use the Q_PLUGIN_METADATA() macro to export the
TicTacToePlugin class for use with Qt's plugin handling classes:
class TicTacToePlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
+//! [1]
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "tictactoe.json")
+//! [1]
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
}
}
-/*! \reimp
+/*!
+ \reimp
*/
void QHelpSearchQueryWidget::changeEvent(QEvent *event)
{
outputdir = $QT_INSTALL_DOCS/qtdesigner
-depends += qtdoc qtwidgets qtcore
+depends += qtdoc qtwidgets qtcore qtuitools
To use the direct approach, we include the \c ui_calculatorform.h file
directly in \c main.cpp:
- \snippet calculatorform/main.cpp 0
+ \snippet uitools/calculatorform/main.cpp 0
The \c main function creates the calculator widget by constructing a
standard QWidget that we use to host the user interface described by the
\c calculatorform.ui file.
- \snippet calculatorform/main.cpp 1
+ \snippet uitools/calculatorform/main.cpp 1
In this case, the \c{Ui::CalculatorForm} is an interface description object
from the \c ui_calculatorform.h file that sets up all the dialog's widgets