From 3772c3a3583b757439977ae8b13a3b9cfe5ba895 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Feb 2023 12:55:08 +0100 Subject: Move the uitools multipleinheritance example to calculatorform_mi It illustrates how to use multipleinheritance from Ui struct and widget and is not really related to UiTools. Task-number: QTBUG-110447 Change-Id: If6b61c76ea0ac07b935f1e0a8ee02a2e7179cdc3 Reviewed-by: Qt CI Bot Reviewed-by: Jarek Kobus (cherry picked from commit db7a30bd1dca12b04f04a2617d54e22c61e5cf70) Reviewed-by: Qt Cherry-pick Bot --- examples/designer/CMakeLists.txt | 1 + examples/designer/calculatorform_mi/CMakeLists.txt | 38 +++ .../designer/calculatorform_mi/calculatorform.cpp | 28 ++ .../designer/calculatorform_mi/calculatorform.h | 25 ++ .../designer/calculatorform_mi/calculatorform.ui | 303 +++++++++++++++++++++ .../calculatorform_mi/calculatorform_mi.pro | 11 + examples/designer/calculatorform_mi/main.cpp | 15 + examples/designer/designer.pro | 3 +- examples/designer/doc/images/calculatorform_mi.png | Bin 0 -> 6974 bytes examples/designer/doc/src/calculatorform_mi.qdoc | 72 +++++ examples/uitools/CMakeLists.txt | 1 - .../doc/images/multipleinheritance-example.png | Bin 6974 -> 0 bytes examples/uitools/doc/src/multipleinheritance.qdoc | 72 ----- .../uitools/multipleinheritance/CMakeLists.txt | 38 --- .../uitools/multipleinheritance/calculatorform.cpp | 28 -- .../uitools/multipleinheritance/calculatorform.h | 25 -- .../uitools/multipleinheritance/calculatorform.ui | 303 --------------------- examples/uitools/multipleinheritance/main.cpp | 15 - .../multipleinheritance/multipleinheritance.pro | 11 - examples/uitools/uitools.pro | 4 +- .../src/designer/doc/src/designer-examples.qdoc | 1 + .../src/designer/doc/src/designer-manual.qdoc | 6 +- src/uitools/doc/src/qtuitools-examples.qdoc | 1 - 23 files changed, 500 insertions(+), 501 deletions(-) create mode 100644 examples/designer/calculatorform_mi/CMakeLists.txt create mode 100644 examples/designer/calculatorform_mi/calculatorform.cpp create mode 100644 examples/designer/calculatorform_mi/calculatorform.h create mode 100644 examples/designer/calculatorform_mi/calculatorform.ui create mode 100644 examples/designer/calculatorform_mi/calculatorform_mi.pro create mode 100644 examples/designer/calculatorform_mi/main.cpp create mode 100644 examples/designer/doc/images/calculatorform_mi.png create mode 100644 examples/designer/doc/src/calculatorform_mi.qdoc delete mode 100644 examples/uitools/doc/images/multipleinheritance-example.png delete mode 100644 examples/uitools/doc/src/multipleinheritance.qdoc delete mode 100644 examples/uitools/multipleinheritance/CMakeLists.txt delete mode 100644 examples/uitools/multipleinheritance/calculatorform.cpp delete mode 100644 examples/uitools/multipleinheritance/calculatorform.h delete mode 100644 examples/uitools/multipleinheritance/calculatorform.ui delete mode 100644 examples/uitools/multipleinheritance/main.cpp delete mode 100644 examples/uitools/multipleinheritance/multipleinheritance.pro diff --git a/examples/designer/CMakeLists.txt b/examples/designer/CMakeLists.txt index b98f6ea5f..28962d53c 100644 --- a/examples/designer/CMakeLists.txt +++ b/examples/designer/CMakeLists.txt @@ -7,6 +7,7 @@ qt_exclude_tool_directories_from_default_target( ) qt_internal_add_example(calculatorform) +qt_internal_add_example(calculatorform_mi) if(QT_BUILD_SHARED_LIBS AND NOT solaris-cc_x_) qt_internal_add_example(calculatorbuilder) endif() diff --git a/examples/designer/calculatorform_mi/CMakeLists.txt b/examples/designer/calculatorform_mi/CMakeLists.txt new file mode 100644 index 000000000..23f868c7b --- /dev/null +++ b/examples/designer/calculatorform_mi/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) +project(calculatorform_mi LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/designer/calculatorform_mi") + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) + +qt_add_executable(calculatorform_mi + calculatorform.cpp calculatorform.h calculatorform.ui + main.cpp +) + +set_target_properties(calculatorform_mi PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +target_link_libraries(calculatorform_mi PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +install(TARGETS calculatorform_mi + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/designer/calculatorform_mi/calculatorform.cpp b/examples/designer/calculatorform_mi/calculatorform.cpp new file mode 100644 index 000000000..6a877de7e --- /dev/null +++ b/examples/designer/calculatorform_mi/calculatorform.cpp @@ -0,0 +1,28 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "calculatorform.h" +#include + + +//! [0] +CalculatorForm::CalculatorForm(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} +//! [0] + +//! [1] +void CalculatorForm::on_inputSpinBox1_valueChanged(int value) +{ + outputWidget->setText(QString::number(value + inputSpinBox2->value())); +} +//! [1] + +//! [2] +void CalculatorForm::on_inputSpinBox2_valueChanged(int value) +{ + outputWidget->setText(QString::number(value + inputSpinBox1->value())); +} +//! [2] diff --git a/examples/designer/calculatorform_mi/calculatorform.h b/examples/designer/calculatorform_mi/calculatorform.h new file mode 100644 index 000000000..aba28c2ce --- /dev/null +++ b/examples/designer/calculatorform_mi/calculatorform.h @@ -0,0 +1,25 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef CALCULATORFORM_H +#define CALCULATORFORM_H + +//! [0] +#include "ui_calculatorform.h" +//! [0] + +//! [1] +class CalculatorForm : public QWidget, private Ui::CalculatorForm +{ + Q_OBJECT + +public: + explicit CalculatorForm(QWidget *parent = nullptr); + +private slots: + void on_inputSpinBox1_valueChanged(int value); + void on_inputSpinBox2_valueChanged(int value); +}; +//! [1] + +#endif diff --git a/examples/designer/calculatorform_mi/calculatorform.ui b/examples/designer/calculatorform_mi/calculatorform.ui new file mode 100644 index 000000000..9bcca91b2 --- /dev/null +++ b/examples/designer/calculatorform_mi/calculatorform.ui @@ -0,0 +1,303 @@ + + + + + CalculatorForm + + + CalculatorForm + + + + 0 + 0 + 276 + 98 + + + + + 5 + 5 + 0 + 0 + + + + Calculator Form + + + + + + + 9 + + + 6 + + + + + + + + 1 + + + 6 + + + + + + + + 1 + + + 6 + + + + + label + + + + 1 + 1 + 45 + 19 + + + + Input 1 + + + + + + + inputSpinBox1 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3 + + + + 54 + 1 + 7 + 52 + + + + + + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2 + + + + 1 + 1 + 45 + 19 + + + + Input 2 + + + + + + + inputSpinBox2 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3_2 + + + + 120 + 1 + 7 + 52 + + + + = + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2_2_2 + + + + 1 + 1 + 37 + 17 + + + + Output + + + + + + + outputWidget + + + + 1 + 24 + 37 + 27 + + + + QFrame::Box + + + QFrame::Sunken + + + 0 + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + + + + + + + + + verticalSpacer + + + + 85 + 69 + 20 + 20 + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + horizontalSpacer + + + + 188 + 26 + 79 + 20 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + diff --git a/examples/designer/calculatorform_mi/calculatorform_mi.pro b/examples/designer/calculatorform_mi/calculatorform_mi.pro new file mode 100644 index 000000000..c0f50316e --- /dev/null +++ b/examples/designer/calculatorform_mi/calculatorform_mi.pro @@ -0,0 +1,11 @@ +#! [0] +QT += widgets + +HEADERS = calculatorform.h +SOURCES = calculatorform.cpp main.cpp +FORMS = calculatorform.ui +#! [0] + +target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform_mi +INSTALLS += target + diff --git a/examples/designer/calculatorform_mi/main.cpp b/examples/designer/calculatorform_mi/main.cpp new file mode 100644 index 000000000..d6b0aee09 --- /dev/null +++ b/examples/designer/calculatorform_mi/main.cpp @@ -0,0 +1,15 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "calculatorform.h" +#include + +//! [0] +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + CalculatorForm calculator; + calculator.show(); + return app.exec(); +} +//! [0] diff --git a/examples/designer/designer.pro b/examples/designer/designer.pro index 5f9cc2769..3f2f6367f 100644 --- a/examples/designer/designer.pro +++ b/examples/designer/designer.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs -SUBDIRS = calculatorform +SUBDIRS = calculatorform \ + calculatorform_mi !contains(CONFIG, static) { SUBDIRS += calculatorbuilder \ diff --git a/examples/designer/doc/images/calculatorform_mi.png b/examples/designer/doc/images/calculatorform_mi.png new file mode 100644 index 000000000..9e8929297 Binary files /dev/null and b/examples/designer/doc/images/calculatorform_mi.png differ diff --git a/examples/designer/doc/src/calculatorform_mi.qdoc b/examples/designer/doc/src/calculatorform_mi.qdoc new file mode 100644 index 000000000..c3b8beeae --- /dev/null +++ b/examples/designer/doc/src/calculatorform_mi.qdoc @@ -0,0 +1,72 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \example multipleinheritance + \ingroup examples-designer + \title Calculator Form Example/Multiple Inheritance Example + + \brief Using a form created with Qt Designer in an application. + + The Multiple Inheritance Example shows how to use a form created with + \l{Qt Designer} in an application by subclassing both QWidget and the user + interface class, which is \c{Ui::CalculatorForm}. + + \image calculatorform_mi.png + + To subclass the \c calculatorform.ui file and ensure that \c qmake + processes it with the \c uic, we have to include \c calculatorform.ui + in the \c .pro file, as shown below: + + \snippet calculatorform_mi/calculatorform_mi.pro 0 + + When the project is compiled, the \c uic will generate a corresponding + \c ui_calculatorform.h. + + \section1 CalculatorForm Definition + + In the \c CalculatorForm definition, we include the \c ui_calculatorform.h + that was generated earlier. + + \snippet calculatorform_mi/calculatorform.h 0 + + As mentioned earlier, the class is a subclass of both QWidget and + \c{Ui::CalculatorForm}. + + \snippet calculatorform_mi/calculatorform.h 1 + + Two slots are defined according to the \l{Automatic Connections} + {automatic connection} naming convention required by \c uic. This is + to ensure that \l{QMetaObject}'s auto-connection facilities connect + all the signals and slots involved automatically. + + \section1 CalculatorForm Implementation + + In the constructor, we call \c setupUi() to load the user interface file. + Note that setupUi is a method of \c Ui::CalculatorForm. + + \snippet calculatorform_mi/calculatorform.cpp 0 + + We include two slots, \c{on_inputSpinBox1_valueChanged()} and + \c{on_inputSpinBox2_valueChanged()}. These slots respond to the + \l{QSpinBox::valueChanged()}{valueChanged()} signal that both spin boxes + emit. Whenever there is a change in one spin box's value, we take that + value and add it to whatever value the other spin box has. + + \snippet calculatorform_mi/calculatorform.cpp 1 + \codeline + \snippet calculatorform_mi/calculatorform.cpp 2 + + \section1 \c main() Function + + The \c main() function instantiates QApplication and \c CalculatorForm. + The \c calculator object is displayed by invoking the \l{QWidget::show()} + {show()} function. + + \snippet calculatorform_mi/main.cpp 0 + + There are various approaches to include forms into applications. The + Multiple Inheritance approach is just one of them. See + \l{Using a Designer UI File in Your Application} for more information on + the other approaches available. +*/ diff --git a/examples/uitools/CMakeLists.txt b/examples/uitools/CMakeLists.txt index 4720af772..16d288cbc 100644 --- a/examples/uitools/CMakeLists.txt +++ b/examples/uitools/CMakeLists.txt @@ -1,2 +1 @@ -qt_internal_add_example(multipleinheritance) qt_internal_add_example(textfinder) diff --git a/examples/uitools/doc/images/multipleinheritance-example.png b/examples/uitools/doc/images/multipleinheritance-example.png deleted file mode 100644 index 9e8929297..000000000 Binary files a/examples/uitools/doc/images/multipleinheritance-example.png and /dev/null differ diff --git a/examples/uitools/doc/src/multipleinheritance.qdoc b/examples/uitools/doc/src/multipleinheritance.qdoc deleted file mode 100644 index 1c4a83f37..000000000 --- a/examples/uitools/doc/src/multipleinheritance.qdoc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example multipleinheritance - \ingroup examples-qtuitools - \title Multiple Inheritance Example - - \brief Using a form created with Qt Designer in an application. - - The Multiple Inheritance Example shows how to use a form created with - \l{Qt Designer} in an application by subclassing both QWidget and the user - interface class, which is \c{Ui::CalculatorForm}. - - \image multipleinheritance-example.png - - To subclass the \c calculatorform.ui file and ensure that \c qmake - processes it with the \c uic, we have to include \c calculatorform.ui - in the \c .pro file, as shown below: - - \snippet multipleinheritance/multipleinheritance.pro 0 - - When the project is compiled, the \c uic will generate a corresponding - \c ui_calculatorform.h. - - \section1 CalculatorForm Definition - - In the \c CalculatorForm definition, we include the \c ui_calculatorform.h - that was generated earlier. - - \snippet multipleinheritance/calculatorform.h 0 - - As mentioned earlier, the class is a subclass of both QWidget and - \c{Ui::CalculatorForm}. - - \snippet multipleinheritance/calculatorform.h 1 - - Two slots are defined according to the \l{Automatic Connections} - {automatic connection} naming convention required by \c uic. This is - to ensure that \l{QMetaObject}'s auto-connection facilities connect - all the signals and slots involved automatically. - - \section1 CalculatorForm Implementation - - In the constructor, we call \c setupUi() to load the user interface file. - Note that setupUi is a method of \c Ui::CalculatorForm. - - \snippet multipleinheritance/calculatorform.cpp 0 - - We include two slots, \c{on_inputSpinBox1_valueChanged()} and - \c{on_inputSpinBox2_valueChanged()}. These slots respond to the - \l{QSpinBox::valueChanged()}{valueChanged()} signal that both spin boxes - emit. Whenever there is a change in one spin box's value, we take that - value and add it to whatever value the other spin box has. - - \snippet multipleinheritance/calculatorform.cpp 1 - \codeline - \snippet multipleinheritance/calculatorform.cpp 2 - - \section1 \c main() Function - - The \c main() function instantiates QApplication and \c CalculatorForm. - The \c calculator object is displayed by invoking the \l{QWidget::show()} - {show()} function. - - \snippet multipleinheritance/main.cpp 0 - - There are various approaches to include forms into applications. The - Multiple Inheritance approach is just one of them. See - \l{Using a Designer UI File in Your Application} for more information on - the other approaches available. -*/ diff --git a/examples/uitools/multipleinheritance/CMakeLists.txt b/examples/uitools/multipleinheritance/CMakeLists.txt deleted file mode 100644 index 1081b7371..000000000 --- a/examples/uitools/multipleinheritance/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(multipleinheritance LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/uitools/multipleinheritance") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) - -qt_add_executable(multipleinheritance - calculatorform.cpp calculatorform.h calculatorform.ui - main.cpp -) - -set_target_properties(multipleinheritance PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) - -target_link_libraries(multipleinheritance PUBLIC - Qt::Core - Qt::Gui - Qt::Widgets -) - -install(TARGETS multipleinheritance - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/uitools/multipleinheritance/calculatorform.cpp b/examples/uitools/multipleinheritance/calculatorform.cpp deleted file mode 100644 index 6a877de7e..000000000 --- a/examples/uitools/multipleinheritance/calculatorform.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "calculatorform.h" -#include - - -//! [0] -CalculatorForm::CalculatorForm(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); -} -//! [0] - -//! [1] -void CalculatorForm::on_inputSpinBox1_valueChanged(int value) -{ - outputWidget->setText(QString::number(value + inputSpinBox2->value())); -} -//! [1] - -//! [2] -void CalculatorForm::on_inputSpinBox2_valueChanged(int value) -{ - outputWidget->setText(QString::number(value + inputSpinBox1->value())); -} -//! [2] diff --git a/examples/uitools/multipleinheritance/calculatorform.h b/examples/uitools/multipleinheritance/calculatorform.h deleted file mode 100644 index aba28c2ce..000000000 --- a/examples/uitools/multipleinheritance/calculatorform.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef CALCULATORFORM_H -#define CALCULATORFORM_H - -//! [0] -#include "ui_calculatorform.h" -//! [0] - -//! [1] -class CalculatorForm : public QWidget, private Ui::CalculatorForm -{ - Q_OBJECT - -public: - explicit CalculatorForm(QWidget *parent = nullptr); - -private slots: - void on_inputSpinBox1_valueChanged(int value); - void on_inputSpinBox2_valueChanged(int value); -}; -//! [1] - -#endif diff --git a/examples/uitools/multipleinheritance/calculatorform.ui b/examples/uitools/multipleinheritance/calculatorform.ui deleted file mode 100644 index dda0e62dd..000000000 --- a/examples/uitools/multipleinheritance/calculatorform.ui +++ /dev/null @@ -1,303 +0,0 @@ - - - - - CalculatorForm - - - CalculatorForm - - - - 0 - 0 - 276 - 98 - - - - - 5 - 5 - 0 - 0 - - - - Calculator Builder - - - - - - - 9 - - - 6 - - - - - - - - 1 - - - 6 - - - - - - - - 1 - - - 6 - - - - - label - - - - 1 - 1 - 45 - 19 - - - - Input 1 - - - - - - - inputSpinBox1 - - - - 1 - 26 - 45 - 25 - - - - true - - - - - - - - - label_3 - - - - 54 - 1 - 7 - 52 - - - - + - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label_2 - - - - 1 - 1 - 45 - 19 - - - - Input 2 - - - - - - - inputSpinBox2 - - - - 1 - 26 - 45 - 25 - - - - true - - - - - - - - - label_3_2 - - - - 120 - 1 - 7 - 52 - - - - = - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label_2_2_2 - - - - 1 - 1 - 37 - 17 - - - - Output - - - - - - - outputWidget - - - - 1 - 24 - 37 - 27 - - - - QFrame::Box - - - QFrame::Sunken - - - 0 - - - Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask - - - - - - - - - - - verticalSpacer - - - - 85 - 69 - 20 - 20 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - horizontalSpacer - - - - 188 - 26 - 79 - 20 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - diff --git a/examples/uitools/multipleinheritance/main.cpp b/examples/uitools/multipleinheritance/main.cpp deleted file mode 100644 index d6b0aee09..000000000 --- a/examples/uitools/multipleinheritance/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "calculatorform.h" -#include - -//! [0] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - CalculatorForm calculator; - calculator.show(); - return app.exec(); -} -//! [0] diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro deleted file mode 100644 index fd40982ed..000000000 --- a/examples/uitools/multipleinheritance/multipleinheritance.pro +++ /dev/null @@ -1,11 +0,0 @@ -#! [0] -QT += widgets - -HEADERS = calculatorform.h -SOURCES = calculatorform.cpp main.cpp -FORMS = calculatorform.ui -#! [0] - -target.path = $$[QT_INSTALL_EXAMPLES]/uitools/multipleinheritance -INSTALLS += target - diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro index bc2285d80..e0d22065e 100644 --- a/examples/uitools/uitools.pro +++ b/examples/uitools/uitools.pro @@ -1,4 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = multipleinheritance - -SUBDIRS += textfinder +SUBDIRS = textfinder diff --git a/src/designer/src/designer/doc/src/designer-examples.qdoc b/src/designer/src/designer/doc/src/designer-examples.qdoc index 98a597c5c..199c46db7 100644 --- a/src/designer/src/designer/doc/src/designer-examples.qdoc +++ b/src/designer/src/designer/doc/src/designer-examples.qdoc @@ -20,6 +20,7 @@ \li \l{arthurplugin}{Arthur Plugin} \li \l{calculatorbuilder}{Calculator Builder}\raisedaster \li \l{calculatorform}{Calculator Form}\raisedaster + \li \l{calculatorform_mi}{Calculator Form Example/Multiple Inheritance Example}\raisedaster \li \l{customwidgetplugin}{Custom Widget Plugin}\raisedaster \li \l{taskmenuextension}{Task Menu Extension}\raisedaster \li \l{containerextension}{Container Extension}\raisedaster diff --git a/src/designer/src/designer/doc/src/designer-manual.qdoc b/src/designer/src/designer/doc/src/designer-manual.qdoc index 10ffa06d8..4cd7a819f 100644 --- a/src/designer/src/designer/doc/src/designer-manual.qdoc +++ b/src/designer/src/designer/doc/src/designer-manual.qdoc @@ -1931,14 +1931,14 @@ pixmap property in the property editor. We need to include the header file that \c uic generates from the \c calculatorform.ui file, as follows: - \snippet ../uitools/multipleinheritance/calculatorform.h 0 + \snippet ../designer/calculatorform_mi/calculatorform.h 0 The class is defined in a similar way to the one used in the \l{The Single Inheritance Approach}{single inheritance approach}, except that this time we inherit from \e{both} QWidget and \c{Ui::CalculatorForm}, as follows: - \snippet ../uitools/multipleinheritance/calculatorform.h 1 + \snippet ../designer/calculatorform_mi/calculatorform.h 1 We inherit \c{Ui::CalculatorForm} privately to ensure that the user interface objects are private in our subclass. We can also inherit it with @@ -1949,7 +1949,7 @@ pixmap property in the property editor. constructor used in the \l{The Single Inheritance Approach} {single inheritance} example: - \snippet ../uitools/multipleinheritance/calculatorform.cpp 0 + \snippet ../designer/calculatorform_mi/calculatorform.cpp 0 In this case, the widgets used in the user interface can be accessed in the same say as a widget created in code by hand. We no longer require the diff --git a/src/uitools/doc/src/qtuitools-examples.qdoc b/src/uitools/doc/src/qtuitools-examples.qdoc index 170bbcf42..90cf190e6 100644 --- a/src/uitools/doc/src/qtuitools-examples.qdoc +++ b/src/uitools/doc/src/qtuitools-examples.qdoc @@ -19,7 +19,6 @@ /* \list - \li \l{Multiple Inheritance Example}\raisedaster \li \l{Text Finder Example}\raisedaster \endlist -- cgit v1.2.3