diff options
Diffstat (limited to 'examples/widgets')
256 files changed, 935 insertions, 404 deletions
diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.pro b/examples/widgets/animation/animatedtiles/animatedtiles.pro index c4e2553224..04c2b8f3d0 100644 --- a/examples/widgets/animation/animatedtiles/animatedtiles.pro +++ b/examples/widgets/animation/animatedtiles/animatedtiles.pro @@ -1,8 +1,8 @@ +QT += widgets + SOURCES = main.cpp RESOURCES = animatedtiles.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/animatedtiles INSTALLS += target - -QT += widgets diff --git a/examples/widgets/animation/animation.pro b/examples/widgets/animation/animation.pro index 575fed4ead..a13f8bb65a 100644 --- a/examples/widgets/animation/animation.pro +++ b/examples/widgets/animation/animation.pro @@ -8,5 +8,3 @@ SUBDIRS += \ states \ stickman \ sub-attaq \ - -QT += widgets diff --git a/examples/widgets/animation/appchooser/appchooser.pro b/examples/widgets/animation/appchooser/appchooser.pro index 8560db2c4c..674e623b2d 100644 --- a/examples/widgets/animation/appchooser/appchooser.pro +++ b/examples/widgets/animation/appchooser/appchooser.pro @@ -1,8 +1,8 @@ +QT += widgets + SOURCES = main.cpp RESOURCES = appchooser.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/appchooser INSTALLS += target - -QT += widgets diff --git a/examples/widgets/animation/easing/easing.pro b/examples/widgets/animation/easing/easing.pro index 0e430df1ba..498180c0bb 100644 --- a/examples/widgets/animation/easing/easing.pro +++ b/examples/widgets/animation/easing/easing.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h \ animation.h SOURCES = main.cpp \ @@ -10,6 +12,3 @@ RESOURCES = easing.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/easing INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/animation/moveblocks/moveblocks.pro b/examples/widgets/animation/moveblocks/moveblocks.pro index 2992315064..1397246b3f 100644 --- a/examples/widgets/animation/moveblocks/moveblocks.pro +++ b/examples/widgets/animation/moveblocks/moveblocks.pro @@ -1,7 +1,7 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/moveblocks INSTALLS += target - -QT += widgets diff --git a/examples/widgets/animation/states/states.pro b/examples/widgets/animation/states/states.pro index 563160ce9f..491d557a8d 100644 --- a/examples/widgets/animation/states/states.pro +++ b/examples/widgets/animation/states/states.pro @@ -1,8 +1,8 @@ +QT += widgets + SOURCES += main.cpp RESOURCES += states.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/states INSTALLS += target - -QT += widgets diff --git a/examples/widgets/animation/stickman/stickman.pro b/examples/widgets/animation/stickman/stickman.pro index 145a9a18f9..a803acf624 100644 --- a/examples/widgets/animation/stickman/stickman.pro +++ b/examples/widgets/animation/stickman/stickman.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += stickman.h \ animation.h \ node.h \ @@ -17,5 +19,3 @@ RESOURCES += stickman.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/animation/stickman INSTALLS += target - -QT += widgets diff --git a/examples/widgets/animation/sub-attaq/sub-attaq.pro b/examples/widgets/animation/sub-attaq/sub-attaq.pro index 3ed823d1e6..ac79fd4249 100644 --- a/examples/widgets/animation/sub-attaq/sub-attaq.pro +++ b/examples/widgets/animation/sub-attaq/sub-attaq.pro @@ -1,5 +1,5 @@ QT += widgets -contains(QT_CONFIG, opengl):QT += opengl +qtHaveModule(opengl): QT += opengl HEADERS += boat.h \ bomb.h \ mainwindow.h \ diff --git a/examples/widgets/desktop/desktop.pro b/examples/widgets/desktop/desktop.pro index 5da59599d4..db518c1c7a 100644 --- a/examples/widgets/desktop/desktop.pro +++ b/examples/widgets/desktop/desktop.pro @@ -1,5 +1,3 @@ TEMPLATE = subdirs CONFIG += ordered SUBDIRS = screenshot systray - -QT += widgets diff --git a/examples/widgets/desktop/screenshot/screenshot.pro b/examples/widgets/desktop/screenshot/screenshot.pro index 31ea646af0..f12bc82ca7 100644 --- a/examples/widgets/desktop/screenshot/screenshot.pro +++ b/examples/widgets/desktop/screenshot/screenshot.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = screenshot.h SOURCES = main.cpp \ screenshot.cpp @@ -6,5 +8,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/desktop/screenshot INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp index bb81bb78e4..ece04524b8 100644 --- a/examples/widgets/desktop/systray/main.cpp +++ b/examples/widgets/desktop/systray/main.cpp @@ -39,8 +39,10 @@ ****************************************************************************/ #include <QApplication> -#include <QMessageBox> +#ifndef QT_NO_SYSTEMTRAYICON + +#include <QMessageBox> #include "window.h" int main(int argc, char *argv[]) @@ -61,3 +63,24 @@ int main(int argc, char *argv[]) window.show(); return app.exec(); } + +#else + +#include <QLabel> +#include <QDebug> + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QString text("QSystemTrayIcon is not supported on this platform"); + + QLabel *label = new QLabel(text); + label->setWordWrap(true); + + label->show(); + qDebug() << text; + + app.exec(); +} + +#endif diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index 8de1f5843e..a7ea3b471e 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -39,6 +39,9 @@ ****************************************************************************/ #include "window.h" + +#ifndef QT_NO_SYSTEMTRAYICON + #include <QtGui> #include <QAction> @@ -265,3 +268,5 @@ void Window::createTrayIcon() trayIcon = new QSystemTrayIcon(this); trayIcon->setContextMenu(trayIconMenu); } + +#endif diff --git a/examples/widgets/desktop/systray/window.h b/examples/widgets/desktop/systray/window.h index 2c33812778..08919e8a49 100644 --- a/examples/widgets/desktop/systray/window.h +++ b/examples/widgets/desktop/systray/window.h @@ -42,6 +42,9 @@ #define WINDOW_H #include <QSystemTrayIcon> + +#ifndef QT_NO_SYSTEMTRAYICON + #include <QDialog> QT_BEGIN_NAMESPACE @@ -109,4 +112,6 @@ private: }; //! [0] +#endif // QT_NO_SYSTEMTRAYICON + #endif diff --git a/examples/widgets/dialogs/classwizard/classwizard.pro b/examples/widgets/dialogs/classwizard/classwizard.pro index 9b272b9d3f..5226b38b7c 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.pro +++ b/examples/widgets/dialogs/classwizard/classwizard.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = classwizard.h SOURCES = classwizard.cpp \ main.cpp @@ -7,5 +9,4 @@ RESOURCES = classwizard.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/classwizard INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/dialogs/classwizard/main.cpp b/examples/widgets/dialogs/classwizard/main.cpp index ec95d9d8d3..55fdf0fbb6 100644 --- a/examples/widgets/dialogs/classwizard/main.cpp +++ b/examples/widgets/dialogs/classwizard/main.cpp @@ -51,11 +51,13 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); +#ifndef QT_NO_TRANSLATION QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); +#endif ClassWizard wizard; wizard.show(); diff --git a/examples/widgets/dialogs/configdialog/configdialog.pro b/examples/widgets/dialogs/configdialog/configdialog.pro index 616b5fd650..6e5b1e2725 100644 --- a/examples/widgets/dialogs/configdialog/configdialog.pro +++ b/examples/widgets/dialogs/configdialog/configdialog.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = configdialog.h \ pages.h SOURCES = configdialog.cpp \ @@ -11,5 +13,4 @@ INSTALLS += target wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/dialogs/configdialog/main.cpp b/examples/widgets/dialogs/configdialog/main.cpp index 20a2709a1e..b23c64a56f 100644 --- a/examples/widgets/dialogs/configdialog/main.cpp +++ b/examples/widgets/dialogs/configdialog/main.cpp @@ -47,6 +47,7 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(configdialog); QApplication app(argc, argv); + app.setApplicationDisplayName("Qt Example"); ConfigDialog dialog; return dialog.exec(); } diff --git a/examples/widgets/dialogs/dialogs.pro b/examples/widgets/dialogs/dialogs.pro index 0a4922eeaf..c31c37222d 100644 --- a/examples/widgets/dialogs/dialogs.pro +++ b/examples/widgets/dialogs/dialogs.pro @@ -11,5 +11,3 @@ SUBDIRS = classwizard \ contains(DEFINES, QT_NO_WIZARD): SUBDIRS -= trivialwizard licensewizard classwizard wince*: SUBDIRS += sipdialog - -QT += widgets diff --git a/examples/widgets/dialogs/extension/extension.pro b/examples/widgets/dialogs/extension/extension.pro index e7cf493128..327eeff1f3 100644 --- a/examples/widgets/dialogs/extension/extension.pro +++ b/examples/widgets/dialogs/extension/extension.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = finddialog.h SOURCES = finddialog.cpp \ main.cpp @@ -6,5 +8,4 @@ SOURCES = finddialog.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/extension INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/dialogs/findfiles/findfiles.pro b/examples/widgets/dialogs/findfiles/findfiles.pro index f02ec69e4c..2dd058ac5c 100644 --- a/examples/widgets/dialogs/findfiles/findfiles.pro +++ b/examples/widgets/dialogs/findfiles/findfiles.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -5,5 +7,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/findfiles INSTALLS += target - -QT += widgets diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.pro b/examples/widgets/dialogs/licensewizard/licensewizard.pro index 4bcfdad384..8a4b251737 100644 --- a/examples/widgets/dialogs/licensewizard/licensewizard.pro +++ b/examples/widgets/dialogs/licensewizard/licensewizard.pro @@ -1,3 +1,5 @@ +QT += widgets printsupport + HEADERS = licensewizard.h SOURCES = licensewizard.cpp \ main.cpp @@ -7,5 +9,4 @@ RESOURCES = licensewizard.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/licensewizard INSTALLS += target -QT += widgets printsupport simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/dialogs/licensewizard/main.cpp b/examples/widgets/dialogs/licensewizard/main.cpp index 9217d4f49e..a84c6241d4 100644 --- a/examples/widgets/dialogs/licensewizard/main.cpp +++ b/examples/widgets/dialogs/licensewizard/main.cpp @@ -51,12 +51,14 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); +#ifndef QT_NO_TRANSLATION QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); - +#endif + LicenseWizard wizard; wizard.show(); return app.exec(); diff --git a/examples/widgets/dialogs/sipdialog/sipdialog.pro b/examples/widgets/dialogs/sipdialog/sipdialog.pro index 5e24335e8c..a7c82a0ebc 100644 --- a/examples/widgets/dialogs/sipdialog/sipdialog.pro +++ b/examples/widgets/dialogs/sipdialog/sipdialog.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = dialog.h SOURCES = main.cpp \ dialog.cpp @@ -8,6 +10,4 @@ INSTALLS += target wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp index 15f18d7af1..96863e3aab 100644 --- a/examples/widgets/dialogs/standarddialogs/main.cpp +++ b/examples/widgets/dialogs/standarddialogs/main.cpp @@ -49,11 +49,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); +#ifndef QT_NO_TRANSLATION QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); +#endif Dialog dialog; dialog.show(); diff --git a/examples/widgets/dialogs/standarddialogs/standarddialogs.pro b/examples/widgets/dialogs/standarddialogs/standarddialogs.pro index 89d0ad9a39..12a814cb69 100644 --- a/examples/widgets/dialogs/standarddialogs/standarddialogs.pro +++ b/examples/widgets/dialogs/standarddialogs/standarddialogs.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = dialog.h SOURCES = dialog.cpp \ main.cpp @@ -7,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/standarddialogs INSTALLS += target wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib - -QT += widgets diff --git a/examples/widgets/dialogs/tabdialog/tabdialog.pro b/examples/widgets/dialogs/tabdialog/tabdialog.pro index 656c661844..c282505ac1 100644 --- a/examples/widgets/dialogs/tabdialog/tabdialog.pro +++ b/examples/widgets/dialogs/tabdialog/tabdialog.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = tabdialog.h SOURCES = main.cpp \ tabdialog.cpp @@ -7,4 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/tabdialog INSTALLS += target wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib -QT += widgets diff --git a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp index a49e17e104..f302c0e390 100644 --- a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp +++ b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp @@ -115,12 +115,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); +#ifndef QT_NO_TRANSLATION QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); - +#endif QWizard wizard; wizard.addPage(createIntroPage()); diff --git a/examples/widgets/dialogs/trivialwizard/trivialwizard.pro b/examples/widgets/dialogs/trivialwizard/trivialwizard.pro index 63831e8576..d85826132c 100644 --- a/examples/widgets/dialogs/trivialwizard/trivialwizard.pro +++ b/examples/widgets/dialogs/trivialwizard/trivialwizard.pro @@ -1,8 +1,9 @@ +QT += widgets + SOURCES = trivialwizard.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/trivialwizard INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/doc/images/calendar-example.png b/examples/widgets/doc/images/calendar-example.png Binary files differnew file mode 100644 index 0000000000..895ce76b09 --- /dev/null +++ b/examples/widgets/doc/images/calendar-example.png diff --git a/examples/widgets/doc/images/collidingmice-example.png b/examples/widgets/doc/images/collidingmice-example.png Binary files differnew file mode 100644 index 0000000000..41561de394 --- /dev/null +++ b/examples/widgets/doc/images/collidingmice-example.png diff --git a/examples/widgets/doc/images/graphicsanchorlayout-example.png b/examples/widgets/doc/images/graphicsanchorlayout-example.png Binary files differnew file mode 100644 index 0000000000..d30d6839d9 --- /dev/null +++ b/examples/widgets/doc/images/graphicsanchorlayout-example.png diff --git a/examples/widgets/doc/images/graphicsflowlayout-example.png b/examples/widgets/doc/images/graphicsflowlayout-example.png Binary files differnew file mode 100644 index 0000000000..a5f9b3dc40 --- /dev/null +++ b/examples/widgets/doc/images/graphicsflowlayout-example.png diff --git a/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png b/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png Binary files differnew file mode 100644 index 0000000000..d073b12c0c --- /dev/null +++ b/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png diff --git a/examples/widgets/doc/images/itemviews-editabletreemodel.png b/examples/widgets/doc/images/itemviews-editabletreemodel.png Binary files differnew file mode 100644 index 0000000000..a151ea857f --- /dev/null +++ b/examples/widgets/doc/images/itemviews-editabletreemodel.png diff --git a/examples/widgets/doc/images/orderform-example.png b/examples/widgets/doc/images/orderform-example.png Binary files differnew file mode 100644 index 0000000000..c8545ad23a --- /dev/null +++ b/examples/widgets/doc/images/orderform-example.png diff --git a/examples/widgets/doc/images/textedit-demo.png b/examples/widgets/doc/images/textedit-demo.png Binary files differnew file mode 100644 index 0000000000..3cf2883a12 --- /dev/null +++ b/examples/widgets/doc/images/textedit-demo.png diff --git a/examples/widgets/doc/images/textfinder-example-userinterface.png b/examples/widgets/doc/images/textfinder-example-userinterface.png Binary files differdeleted file mode 100644 index 2bebe2e9dd..0000000000 --- a/examples/widgets/doc/images/textfinder-example-userinterface.png +++ /dev/null diff --git a/examples/widgets/doc/images/weatheranchorlayout-example.png b/examples/widgets/doc/images/weatheranchorlayout-example.png Binary files differnew file mode 100644 index 0000000000..59d3b55b7a --- /dev/null +++ b/examples/widgets/doc/images/weatheranchorlayout-example.png diff --git a/examples/widgets/doc/src/addressbook.qdoc b/examples/widgets/doc/src/addressbook.qdoc index 65ed4b33bd..4712bf94ad 100644 --- a/examples/widgets/doc/src/addressbook.qdoc +++ b/examples/widgets/doc/src/addressbook.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/addressbook \title Address Book Example - + \ingroup examples-itemviews \brief The address book example shows how to use proxy models to display different views onto data from a single model. diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc index bd0f8fd09f..e6c135e138 100644 --- a/examples/widgets/doc/src/application.qdoc +++ b/examples/widgets/doc/src/application.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/application \title Application Example + \ingroup examples-mainwindow \brief The Application example shows how to implement a standard GUI application with menus, toolbars, and a status bar. The example diff --git a/examples/widgets/doc/src/basicgraphicslayouts.qdoc b/examples/widgets/doc/src/basicgraphicslayouts.qdoc index 36ce914018..70f92a838a 100644 --- a/examples/widgets/doc/src/basicgraphicslayouts.qdoc +++ b/examples/widgets/doc/src/basicgraphicslayouts.qdoc @@ -28,8 +28,10 @@ /*! \example graphicsview/basicgraphicslayouts \title Basic Graphics Layouts Example + \ingroup examples-graphicsview-layout + \brief Demonstrates how to create basic graphics layout - \brief The Basic Graphics Layouts example shows how to use the layout classes + The Basic Graphics Layouts example shows how to use the layout classes in QGraphicsView: QGraphicsLinearLayout and QGraphicsGridLayout. In addition to that it shows how to write your own custom layout item. diff --git a/examples/widgets/doc/src/basicsortfiltermodel.qdoc b/examples/widgets/doc/src/basicsortfiltermodel.qdoc index f9a3b94ba6..16f9fa61a2 100644 --- a/examples/widgets/doc/src/basicsortfiltermodel.qdoc +++ b/examples/widgets/doc/src/basicsortfiltermodel.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/basicsortfiltermodel \title Basic Sort/Filter Model Example - + \ingroup examples-itemviews \brief The Basic Sort/Filter Model example illustrates how to use QSortFilterProxyModel to perform basic sorting and filtering. diff --git a/examples/widgets/doc/src/blurpicker.qdoc b/examples/widgets/doc/src/blurpicker.qdoc index aa89ba3cd8..06426c2ab3 100644 --- a/examples/widgets/doc/src/blurpicker.qdoc +++ b/examples/widgets/doc/src/blurpicker.qdoc @@ -28,6 +28,8 @@ /*! \example effects/blurpicker \title Blur Picker Effect Example + \ingroup examples-graphicsview-graphicseffects + \brief Demonstrates how to apply graphical effects on items in the view \image blurpickereffect-example.png */ diff --git a/examples/widgets/doc/src/boxes.qdoc b/examples/widgets/doc/src/boxes.qdoc index 96238f1efd..6ad50fff9f 100644 --- a/examples/widgets/doc/src/boxes.qdoc +++ b/examples/widgets/doc/src/boxes.qdoc @@ -28,9 +28,8 @@ /*! \example graphicsview/boxes \title Boxes - - \brief This demo shows Qt's ability to combine advanced OpenGL rendering with the - the \l{Graphics View Framework}. + \ingroup examples-graphicsview + \brief Combines advanced OpenGL rendering with the Graphics View framework \image boxes-demo.png diff --git a/examples/widgets/doc/src/chart.qdoc b/examples/widgets/doc/src/chart.qdoc index d12ee58422..a3b54f5328 100644 --- a/examples/widgets/doc/src/chart.qdoc +++ b/examples/widgets/doc/src/chart.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/chart \title Chart Example - + \ingroup examples-itemviews \brief The Chart example shows how to create a custom view for the model/view framework. \image chart-example.png diff --git a/examples/widgets/doc/src/chip.qdoc b/examples/widgets/doc/src/chip.qdoc index aa31227e43..6fd15ac09c 100644 --- a/examples/widgets/doc/src/chip.qdoc +++ b/examples/widgets/doc/src/chip.qdoc @@ -28,9 +28,10 @@ /*! \example graphicsview/chip \title 40000 Chips + \ingroup examples-graphicsview + \brief Visualizes a huge graphic view scene with 40000 chip items - \brief This demo shows how to visualize a huge scene with 40000 chip items - using Graphics View. It also shows Graphics View's powerful navigation + This examples demonstrates Graphics View's powerful navigation and interaction features, allowing you to zoom and rotate each of four views independently, and you can select and move items around the scene. diff --git a/examples/widgets/doc/src/classwizard.qdoc b/examples/widgets/doc/src/classwizard.qdoc index 038f9e19b2..b4224a182f 100644 --- a/examples/widgets/doc/src/classwizard.qdoc +++ b/examples/widgets/doc/src/classwizard.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/classwizard \title Class Wizard Example + \ingroup examples-dialogs \brief The License Wizard example shows how to implement linear wizards using QWizard. diff --git a/examples/widgets/doc/src/collidingmice-example.qdoc b/examples/widgets/doc/src/collidingmice-example.qdoc new file mode 100644 index 0000000000..b6187677b8 --- /dev/null +++ b/examples/widgets/doc/src/collidingmice-example.qdoc @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \example graphicsview/collidingmice + \title Colliding Mice Example + \brief Demonstrates how to animate items on a graphics view + \ingroup examples-graphicsview + + The Colliding Mice example shows how to use the Graphics View + framework to implement animated items and detect collision between + items. + + \image collidingmice-example.png + + Graphics View provides the QGraphicsScene class for managing and + interacting with a large number of custom-made 2D graphical items + derived from the QGraphicsItem class, and a QGraphicsView widget + for visualizing the items, with support for zooming and rotation. + + The example consists of an item class and a main function: + the \c Mouse class represents the individual mice extending + QGraphicsItem, and the \c main() function provides the main + application window. + + We will first review the \c Mouse class to see how to animate + items and detect item collision, and then we will review the \c + main() function to see how to put the items into a scene and how to + implement the corresponding view. + + \section1 Mouse Class Definition + + The \c mouse class inherits from QGraphicsItem. The + QGraphicsItem class is the base class for all graphical items in + the Graphics View framework, and provides a light-weight + foundation for writing your own custom items. + + \snippet graphicsview/collidingmice/mouse.h 0 + + When writing a custom graphics item, you must implement + QGraphicsItem's two pure virtual public functions: \l + {QGraphicsItem::}{boundingRect()}, which returns an estimate of + the area painted by the item, and \l {QGraphicsItem::}{paint()}, + which implements the actual painting. In addition, we reimplement + the \l {QGraphicsItem::}{shape()} and \l {QGraphicsItem::}{advance()}. + We reimplement \l {QGraphicsItem::}{shape()} to return an accurate + shape of our mouse item; the default implementation simply returns + the item's bounding rectangle. We reimplement \l {QGraphicsItem::}{advance()} + to handle the animation so it all happens on one update. + + \section1 Mouse Class Definition + + When constructing a mouse item, we first ensure that all the item's + private variables are properly initialized: + + \snippet graphicsview/collidingmice/mouse.cpp 0 + + To calculate the various components of the mouse's color, we use + the global qrand() function which is a thread-safe version of the + standard C++ rand() function. + + Then we call the \l {QGraphicsItem::setRotation()}{setRotation()} function + inherited from QGraphicsItem. Items live in their own local + coordinate system. Their coordinates are usually centered around + (0, 0), and this is also the center for all transformations. By + calling the item's \l {QGraphicsItem::setRotation()}{setRotation()} function + we alter the direction in which the mouse will start moving. + + When the QGraphicsScene decides to advance the scene a frame it will + call QGraphicsItem::advance() on each of the items. This enables us to + animate our mouse using our reimplementation of the advance() function. + + \snippet graphicsview/collidingmice/mouse.cpp 4 + \snippet graphicsview/collidingmice/mouse.cpp 5 + \snippet graphicsview/collidingmice/mouse.cpp 6 + + First, we don't bother doing any advance if the step is 0 since we want to our advance in + the actual advance (advance() is called twice, once with step == 0 indicating that items + are about to advance and with step == 1 for the actual advance). We also ensure that the + mice stays within a circle with a radius of 150 pixels. + + Note the \l {QGraphicsItem::mapFromScene()}{mapFromScene()} + function provided by QGraphicsItem. This function maps a position + given in \e scene coordinates, to the item's coordinate system. + + \snippet graphicsview/collidingmice/mouse.cpp 7 + \snippet graphicsview/collidingmice/mouse.cpp 8 + \snippet graphicsview/collidingmice/mouse.cpp 9 + \codeline + \snippet graphicsview/collidingmice/mouse.cpp 10 + + Then we try to avoid colliding with other mice. + + \snippet graphicsview/collidingmice/mouse.cpp 11 + + Finally, we calculate the mouse's speed and its eye direction (for + use when painting the mouse), and set its new position. + + The position of an item describes its origin (local coordinate (0, + 0)) in the parent coordinates. The \l {QGraphicsItem::setPos()} + function sets the position of the item to the given position in + the parent's coordinate system. For items with no parent, the + given position is interpreted as scene coordinates. QGraphicsItem + also provides a \l {QGraphicsItem::}{mapToParent()} function to + map a position given in item coordinates, to the parent's + coordinate system. If the item has no parent, the position will be + mapped to the scene's coordinate system instead. + + Then it is time to provide an implementation for the pure virtual + functions inherited from QGraphicsItem. Let's first take a look at + the \l {QGraphicsItem::}{boundingRect()} function: + + \snippet graphicsview/collidingmice/mouse.cpp 1 + + The \l {QGraphicsItem::boundingRect()}{boundingRect()} function + defines the outer bounds of the item as a rectangle. Note that the + Graphics View framework uses the bounding rectangle to determine + whether the item requires redrawing, so all painting must be + restricted inside this rectangle. + + \snippet graphicsview/collidingmice/mouse.cpp 3 + + The Graphics View framework calls the \l + {QGraphicsItem::paint()}{paint()} function to paint the contents + of the item; the function paints the item in local coordinates. + + Note the painting of the ears: Whenever a mouse item collides with + other mice items its ears are filled with red; otherwise they are + filled with dark yellow. We use the + QGraphicsScene::collidingItems() function to check if there are + any colliding mice. The actual collision detection is handled by + the Graphics View framework using shape-shape intersection. All we + have to do is to ensure that the QGraphicsItem::shape() function + returns an accurate shape for our item: + + \snippet graphicsview/collidingmice/mouse.cpp 2 + + Because the complexity of arbitrary shape-shape intersection grows + with an order of magnitude when the shapes are complex, this + operation can be noticably time consuming. An alternative approach + is to reimplement the \l + {QGraphicsItem::collidesWithItem()}{collidesWithItem()} function + to provide your own custom item and shape collision algorithm. + + This completes the \c Mouse class implementation, it is now ready + for use. Let's take a look at the \c main() function to see how to + implement a scene for the mice and a view for displaying the + contents of the scene. + + \section1 The Main() Function + + In this example we have chosen to let the \c main() function + provide the main application window, creating the items and the + scene, putting the items into the scene and creating a + corresponding view. + + \snippet graphicsview/collidingmice/main.cpp 0 + + First, we create an application object and call the global + qsrand() function to specify the seed used to generate a new + random number sequence of pseudo random integers with the + previously mentioned qrand() function. + + Then it is time to create the scene: + + \snippet graphicsview/collidingmice/main.cpp 1 + + The QGraphicsScene class serves as a container for + QGraphicsItems. It also provides functionality that lets you + efficiently determine the location of items as well as determining + which items that are visible within an arbitrary area on the + scene. + + When creating a scene it is recommended to set the scene's + rectangle, i.e., the rectangle that defines the extent of the + scene. It is primarily used by QGraphicsView to determine the + view's default scrollable area, and by QGraphicsScene to manage + item indexing. If not explicitly set, the scene's default + rectangle will be the largest bounding rectangle of all the items + on the scene since the scene was created (i.e., the rectangle will + grow when items are added or moved in the scene, but it will never + shrink). + + \snippet graphicsview/collidingmice/main.cpp 2 + + The item index function is used to speed up item discovery. \l + {QGraphicsScene::NoIndex}{NoIndex} implies that item location is + of linear complexity, as all items on the scene are + searched. Adding, moving and removing items, however, is done in + constant time. This approach is ideal for dynamic scenes, where + many items are added, moved or removed continuously. The + alternative is \l {QGraphicsScene::BspTreeIndex}{BspTreeIndex} + which makes use of binary search resulting in item location + algorithms that are of an order closer to logarithmic complexity. + + \snippet graphicsview/collidingmice/main.cpp 3 + + Then we add the mice to the scene. + + \snippet graphicsview/collidingmice/main.cpp 4 + + To be able to view the scene we must also create a QGraphicsView + widget. The QGraphicsView class visualizes the contents of a scene + in a scrollable viewport. We also ensure that the contents is + rendered using antialiasing, and we create the cheese background + by setting the view's background brush. + + The image used for the background is stored as a binary file in + the application's executable using Qt's \l {The Qt Resource + System}{resource system}. The QPixmap constructor accepts both + file names that refer to actual files on disk and file names that + refer to the application's embedded resources. + + \snippet graphicsview/collidingmice/main.cpp 5 + + Then we set the cache mode; QGraphicsView can cache pre-rendered + content in a pixmap, which is then drawn onto the viewport. The + purpose of such caching is to speed up the total rendering time + for areas that are slow to render, e.g., texture, gradient and + alpha blended backgrounds. The \l + {QGraphicsView::CacheMode}{CacheMode} property holds which parts + of the view that are cached, and the \l + {QGraphicsView::CacheBackground}{CacheBackground} flag enables + caching of the view's background. + + By setting the \l {QGraphicsView::dragMode}{dragMode} property we + define what should happen when the user clicks on the scene + background and drags the mouse. The \l + {QGraphicsView::ScrollHandDrag}{ScrollHandDrag} flag makes the + cursor change into a pointing hand, and dragging the mouse around + will scroll the scrollbars. + + \snippet graphicsview/collidingmice/main.cpp 6 + + In the end, we set the application window's title and size before + we enter the main event loop using the QApplication::exec() + function. + + Finally, we create a QTimer and connect its timeout() signal to the + advance() slot of the scene. Every time the timer fires, the scene + will advance one frame. + + We then tell the timer to fire every 1000/33 millisecond. This will + give us a frame rate of 30 frames a second, which is fast enough for most + animations. Doing the animation with a single timer connect to advance the + scene ensures that all the mice are moved at one point and, more + importantly, only one update is sent to the screen after all the mice have + moved. +*/ diff --git a/examples/widgets/doc/src/coloreditorfactory.qdoc b/examples/widgets/doc/src/coloreditorfactory.qdoc index 377491939e..f34622f37e 100644 --- a/examples/widgets/doc/src/coloreditorfactory.qdoc +++ b/examples/widgets/doc/src/coloreditorfactory.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/coloreditorfactory \title Color Editor Factory Example - + \ingroup examples-itemviews \brief This example shows how to create an editor that can be used by a QItemDelegate. diff --git a/examples/widgets/doc/src/combowidgetmapper.qdoc b/examples/widgets/doc/src/combowidgetmapper.qdoc index df0d893f64..187934a816 100644 --- a/examples/widgets/doc/src/combowidgetmapper.qdoc +++ b/examples/widgets/doc/src/combowidgetmapper.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/combowidgetmapper \title Combo Widget Mapper Example - + \ingroup examples-itemviews \brief The Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form. diff --git a/examples/widgets/doc/src/configdialog.qdoc b/examples/widgets/doc/src/configdialog.qdoc index 0fdbc5ddd0..18c14b79e3 100644 --- a/examples/widgets/doc/src/configdialog.qdoc +++ b/examples/widgets/doc/src/configdialog.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/configdialog \title Config Dialog Example + \ingroup examples-dialogs \brief The Config Dialog examples shows how a configuration dialog can be created by using an icon view with a stacked widget. diff --git a/examples/widgets/doc/src/customsortfiltermodel.qdoc b/examples/widgets/doc/src/customsortfiltermodel.qdoc index 2003dc767a..82f124606e 100644 --- a/examples/widgets/doc/src/customsortfiltermodel.qdoc +++ b/examples/widgets/doc/src/customsortfiltermodel.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/customsortfiltermodel \title Custom Sort/Filter Model Example - + \ingroup examples-itemviews \brief The Custom Sort/Filter Model example illustrates how to subclass QSortFilterProxyModel to perform advanced sorting and filtering. diff --git a/examples/widgets/doc/src/diagramscene.qdoc b/examples/widgets/doc/src/diagramscene.qdoc index 9b94ca2ab1..4ad74cfee9 100644 --- a/examples/widgets/doc/src/diagramscene.qdoc +++ b/examples/widgets/doc/src/diagramscene.qdoc @@ -28,8 +28,8 @@ /*! \example graphicsview/diagramscene \title Diagram Scene Example - - \brief This example shows use of Qt's graphics framework. + \ingroup examples-graphicsview + \brief Demonstrate how to use the Graphics View framework \image diagramscene.png diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc index 8f860fd036..5deabcbb19 100644 --- a/examples/widgets/doc/src/dirview.qdoc +++ b/examples/widgets/doc/src/dirview.qdoc @@ -28,6 +28,8 @@ /*! \example itemviews/dirview \title Dir View Example + \ingroup examples-itemviews + \brief This example demonstrates the usage of a tree view. \brief The Dir View example shows a tree view onto the local filing system. It uses the QDirModel class to provide file and directory information. diff --git a/examples/widgets/doc/src/dockwidgets.qdoc b/examples/widgets/doc/src/dockwidgets.qdoc index 8f83c80417..88dc146c7e 100644 --- a/examples/widgets/doc/src/dockwidgets.qdoc +++ b/examples/widgets/doc/src/dockwidgets.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/dockwidgets \title Dock Widgets Example + \ingroup examples-mainwindow \brief The Dock Widgets example shows how to add dock windows to an application. It also shows how to use Qt's rich text engine. diff --git a/examples/widgets/doc/src/dragdroprobot.qdoc b/examples/widgets/doc/src/dragdroprobot.qdoc index cc5e6bd07d..f58f3cfdf2 100644 --- a/examples/widgets/doc/src/dragdroprobot.qdoc +++ b/examples/widgets/doc/src/dragdroprobot.qdoc @@ -28,8 +28,10 @@ /*! \example graphicsview/dragdroprobot \title Drag and Drop Robot Example + \ingroup examples-graphicsview + \brief Demonstrates how to drag and drop items in a graphics view - \brief The Drag and Drop Robot example shows how to implement Drag and Drop in a + The Drag and Drop Robot example shows how to implement Drag and Drop in a QGraphicsItem subclass, as well as how to animate items using Qt's \l{Animation Framework}. diff --git a/examples/widgets/doc/src/editabletreemodel.qdoc b/examples/widgets/doc/src/editabletreemodel.qdoc index fa72b77506..8c4c7cb89c 100644 --- a/examples/widgets/doc/src/editabletreemodel.qdoc +++ b/examples/widgets/doc/src/editabletreemodel.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/editabletreemodel \title Editable Tree Model Example - + \ingroup examples-itemviews \brief This example shows how to implement a simple item-based tree model that can be used with other classes the model/view framework. diff --git a/examples/widgets/doc/src/elasticnodes.qdoc b/examples/widgets/doc/src/elasticnodes.qdoc index 2c081613bc..bfca70d2f1 100644 --- a/examples/widgets/doc/src/elasticnodes.qdoc +++ b/examples/widgets/doc/src/elasticnodes.qdoc @@ -28,8 +28,10 @@ /*! \example graphicsview/elasticnodes \title Elastic Nodes Example + \ingroup examples-graphicsview + \brief Demonstrates how to interact with graphical items in a scene - \brief The Elastic Nodes example shows how to implement edges between nodes in a + The Elastic Nodes example shows how to implement edges between nodes in a graph, with basic interaction. You can click to drag a node around, and zoom in and out using the mouse wheel or the keyboard. Hitting the space bar will randomize the nodes. The example is also resolution independent; diff --git a/examples/widgets/doc/src/embeddeddialogs.qdoc b/examples/widgets/doc/src/embeddeddialogs.qdoc index 878bb9f54a..34e800d75a 100644 --- a/examples/widgets/doc/src/embeddeddialogs.qdoc +++ b/examples/widgets/doc/src/embeddeddialogs.qdoc @@ -28,8 +28,10 @@ /*! \example graphicsview/embeddeddialogs \title Embedded Dialogs + \ingroup examples-graphicsview-layout + \brief Demonstrates how to embed dialogs into a graphics view - \brief This example shows how to embed standard dialogs into + This example shows how to embed standard dialogs into Graphics View. It also shows how you can customize the proxy class and add window shadows. diff --git a/examples/widgets/doc/src/extension.qdoc b/examples/widgets/doc/src/extension.qdoc index 0ba1d0738e..423a829167 100644 --- a/examples/widgets/doc/src/extension.qdoc +++ b/examples/widgets/doc/src/extension.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/extension \title Extension Example + \ingroup examples-dialogs \brief The Extension example shows how to add an extension to a QDialog using the QAbstractButton::toggled() signal and the diff --git a/examples/widgets/doc/src/fademessage.qdoc b/examples/widgets/doc/src/fademessage.qdoc index e50f434e56..dcd429521d 100644 --- a/examples/widgets/doc/src/fademessage.qdoc +++ b/examples/widgets/doc/src/fademessage.qdoc @@ -28,8 +28,10 @@ /*! \example effects/fademessage \title Fade Message Effect Example + \ingroup examples-graphicsview-graphicseffects + \brief Demonstrates how to appliy effects on items in the view - \div { style="text-align: center"} + \div { style="text-align: left"} \inlineimage fademessageeffect-example.png \inlineimage fademessageeffect-example-faded.png \enddiv diff --git a/examples/widgets/doc/src/fetchmore.qdoc b/examples/widgets/doc/src/fetchmore.qdoc index 8e3ec973aa..2c9c5d5b3b 100644 --- a/examples/widgets/doc/src/fetchmore.qdoc +++ b/examples/widgets/doc/src/fetchmore.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/fetchmore \title Fetch More Example - + \ingroup examples-itemviews \brief The Fetch More example shows how two add items to an item view model on demand. diff --git a/examples/widgets/doc/src/findfiles.qdoc b/examples/widgets/doc/src/findfiles.qdoc index 27d0cacade..61dbf05581 100644 --- a/examples/widgets/doc/src/findfiles.qdoc +++ b/examples/widgets/doc/src/findfiles.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/findfiles \title Find Files Example + \ingroup examples-dialogs \brief The Find Files example shows how to use QProgressDialog to provide feedback on the progress of a slow operation. The example also diff --git a/examples/widgets/doc/src/fridgemagnets.qdoc b/examples/widgets/doc/src/fridgemagnets.qdoc index b53c94f0bd..8e0732f7dd 100644 --- a/examples/widgets/doc/src/fridgemagnets.qdoc +++ b/examples/widgets/doc/src/fridgemagnets.qdoc @@ -176,7 +176,7 @@ handler, where drag and drop operations begin: \snippet draganddrop/fridgemagnets/dragwidget.cpp 13 - \snippet examples/draganddrop/fridgemagnets/dragwidget.cpp 14 + \snippet draganddrop/fridgemagnets/dragwidget.cpp 14 Mouse events occur when a mouse button is pressed or released inside a widget, or when the mouse cursor is moved. By diff --git a/examples/widgets/doc/src/frozencolumn.qdoc b/examples/widgets/doc/src/frozencolumn.qdoc index 69e45de6df..39fe04c7bf 100644 --- a/examples/widgets/doc/src/frozencolumn.qdoc +++ b/examples/widgets/doc/src/frozencolumn.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/frozencolumn \title Frozen Column Example - + \ingroup examples-itemviews \brief This example demonstrates how to freeze a column within a QTableView. \image frozencolumn-example.png "Screenshot of the example" diff --git a/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc new file mode 100644 index 0000000000..98c0958918 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \example graphicsview/anchorlayout + \title Anchor Layout Example + \ingroup examples-graphicsview-layout + \brief Demonstrates anchor layout in a graphics view scene + + The Anchor Layout example demonstrates the use of the QGraphicsAnchorLayout + class. + + \image graphicsanchorlayout-example.png +*/ diff --git a/examples/widgets/doc/src/graphicsview-flowlayout.qdoc b/examples/widgets/doc/src/graphicsview-flowlayout.qdoc new file mode 100644 index 0000000000..52d97164c3 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-flowlayout.qdoc @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \example graphicsview/flowlayout + \title Graphics View Flow Layout Example + \ingroup examples-graphicsview-layout + \brief Demonstrates flow layout on a graphics view scene. + + The Graphics View Flow Layout example shows the use of a flow layout + in a Graphics View widget. + + \image graphicsflowlayout-example.png + + See the \l{Flow Layout Example} for a corresponding widget-based example. +*/ diff --git a/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc new file mode 100644 index 0000000000..480c7c4e0c --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \example graphicsview/simpleanchorlayout + \title Simple Anchor Layout Example + \ingroup examples-graphicsview-layout + \brief Demonstrates anchor layout on a graphics view scene + + The Simple Anchor Layout example shows the basic use of the + QGraphicsAnchorLayout class. + + \image graphicssimpleanchorlayout-example.png +*/ diff --git a/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc new file mode 100644 index 0000000000..88a5c60fb5 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +/*! + \example graphicsview/weatheranchorlayout + \title Weather Anchor Layout Example + \ingroup examples-graphicsview-layout + \brief Demonstrates anchor layout on a graphics view scene + + The Weather Anchor Layout example shows more complex use of the + QGraphicsAnchorLayout class to create a real-world window layout. + + \image weatheranchorlayout-example.png +*/ diff --git a/examples/widgets/doc/src/interview.qdoc b/examples/widgets/doc/src/interview.qdoc index 788af64f64..6528bef7d4 100644 --- a/examples/widgets/doc/src/interview.qdoc +++ b/examples/widgets/doc/src/interview.qdoc @@ -28,6 +28,8 @@ /*! \example itemviews/interview \title Interview + \ingroup examples-itemviews + \brief This example demonstrates the usage of the model/view framework. \brief The Interview example explores the flexibility and scalability of the model/view framework by presenting an infinitely deep data structure using a model diff --git a/examples/widgets/doc/src/itemviewspuzzle.qdoc b/examples/widgets/doc/src/itemviewspuzzle.qdoc index 68cbdc936d..2e37cd372c 100644 --- a/examples/widgets/doc/src/itemviewspuzzle.qdoc +++ b/examples/widgets/doc/src/itemviewspuzzle.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/puzzle \title Item Views Puzzle Example - + \ingroup examples-itemviews \brief The Puzzle example shows how to enable drag and drop with a custom model to allow items to be transferred between a view and another widget. diff --git a/examples/widgets/doc/src/licensewizard.qdoc b/examples/widgets/doc/src/licensewizard.qdoc index aee60e11fe..e45c162f29 100644 --- a/examples/widgets/doc/src/licensewizard.qdoc +++ b/examples/widgets/doc/src/licensewizard.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/licensewizard \title License Wizard Example + \ingroup examples-dialogs \brief The License Wizard example shows how to implement complex wizards in Qt. diff --git a/examples/widgets/doc/src/lighting.qdoc b/examples/widgets/doc/src/lighting.qdoc index e457d20ada..e519bacb91 100644 --- a/examples/widgets/doc/src/lighting.qdoc +++ b/examples/widgets/doc/src/lighting.qdoc @@ -28,6 +28,8 @@ /*! \example effects/lighting \title Lighting Effect Example + \ingroup examples-graphicsview-graphicseffects + \brief Demonstrates how to apply effects on items in the view \image lightingeffect-example.png */ diff --git a/examples/widgets/doc/src/mainwindow.qdoc b/examples/widgets/doc/src/mainwindow.qdoc index 313b8cbc10..a0a7a43ee0 100644 --- a/examples/widgets/doc/src/mainwindow.qdoc +++ b/examples/widgets/doc/src/mainwindow.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/mainwindow \title Main Window + \ingroup examples-mainwindow \brief The Main Window example shows Qt's extensive support for tool bars, dock windows, menus, and other standard application features. diff --git a/examples/widgets/doc/src/mdi.qdoc b/examples/widgets/doc/src/mdi.qdoc index e6b5eef4b4..fc1835c727 100644 --- a/examples/widgets/doc/src/mdi.qdoc +++ b/examples/widgets/doc/src/mdi.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/mdi \title MDI Example + \ingroup examples-mainwindow \brief The MDI example shows how to implement a Multiple Document Interface using Qt's QMdiArea class. diff --git a/examples/widgets/doc/src/menus.qdoc b/examples/widgets/doc/src/menus.qdoc index 3b0c6079ab..09a43a1a45 100644 --- a/examples/widgets/doc/src/menus.qdoc +++ b/examples/widgets/doc/src/menus.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/menus \title Menus Example + \ingroup examples-mainwindow \brief The Menus example demonstrates how menus can be used in a main window application. diff --git a/examples/widgets/doc/src/padnavigator.qdoc b/examples/widgets/doc/src/padnavigator.qdoc index b063d6de59..7b5e54e5ff 100644 --- a/examples/widgets/doc/src/padnavigator.qdoc +++ b/examples/widgets/doc/src/padnavigator.qdoc @@ -28,8 +28,10 @@ /*! \example graphicsview/padnavigator \title Pad Navigator Example + \ingroup examples-graphicsview + \brief Demonstrates how to create animated user interface - \brief The Pad Navigator Example shows how you can use Graphics View together with + The Pad Navigator Example shows how you can use Graphics View together with embedded widgets and Qt's \l{State Machine Framework} to create a simple but useful, dynamic, animated user interface. diff --git a/examples/widgets/doc/src/pixelator.qdoc b/examples/widgets/doc/src/pixelator.qdoc index 9eddcd9f11..ebcee4e5f9 100644 --- a/examples/widgets/doc/src/pixelator.qdoc +++ b/examples/widgets/doc/src/pixelator.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/pixelator \title Pixelator Example - + \ingroup examples-itemviews \brief The Pixelator example shows how delegates can be used to customize the way that items are rendered in standard item views. diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc index 88433a5e2f..cf068e92c3 100644 --- a/examples/widgets/doc/src/plugandpaint.qdoc +++ b/examples/widgets/doc/src/plugandpaint.qdoc @@ -48,7 +48,7 @@ through plugins, we recommend that you start by reading this overview, which explains how to make an application use plugins. Afterward, you can read the - \l{plugandpaintplugins/basictools}{Basic Tools} and + \l{tools/plugandpaintplugins/basictools}{Basic Tools} and \l{plugandpaintplugins/extrafilters}{Extra Filters} overviews, which show how to implement static and dynamic plugins, respectively. @@ -287,7 +287,7 @@ \snippet tools/plugandpaint/main.cpp 0 The argument to Q_IMPORT_PLUGIN() is the plugin's name, as - specified with Q_EXPORT_PLUGIN2() in the \l{Exporting the + specified with Q_PLUGIN_METADATA() in the \l{Exporting the Plugin}{plugin}. In the \c .pro file, we need to specify the static library. @@ -324,7 +324,7 @@ \list 1 \li Declare a plugin class. \li Implement the interfaces provided by the plugin. - \li Export the plugin using the Q_EXPORT_PLUGIN2() macro. + \li Export the plugin using the Q_PLUGIN_METADATA() macro. \li Build the plugin using an adequate \c .pro file. \endlist @@ -346,6 +346,8 @@ interfaces. Without the \c Q_INTERFACES() macro, we couldn't use \l qobject_cast() in the \l{plugandpaint}{Plug & Paint} application to detect interfaces. + For an explanation for the \c Q_PLUGIN_METADATA() macro see + \l {Exporting the Plugin}. \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 2 @@ -440,15 +442,20 @@ \section1 Exporting the Plugin - Whereas applications have a \c main() function as their entry - point, plugins need to contain exactly one occurrence of the - Q_EXPORT_PLUGIN2() macro to specify which class provides the - plugin: + To finally export your plugin you just have to add the + \c Q_PLUGIN_METADATA() macro right next to the \c Q_OBJECT() macro + into the header file of the plugin. + It must contain the plugins IID and optionally a filename pointing + to a json file containing the metadata for the plugin. + + \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 4 - \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.cpp 9 + Within this example the json file does not need to export any metadata, + so it just contains an empty json object. - This line may appear in any \c .cpp file that is part of the - plugin's source code. + \code + {} + \endcode \section1 The .pro File diff --git a/examples/widgets/doc/src/recentfiles.qdoc b/examples/widgets/doc/src/recentfiles.qdoc index 722e32f8cd..01a6975828 100644 --- a/examples/widgets/doc/src/recentfiles.qdoc +++ b/examples/widgets/doc/src/recentfiles.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/recentfiles \title Recent Files Example + \ingroup examples-mainwindow \brief The Recent Files example shows how a standard File menu can be extended to show the most recent files loaded by a main window application. diff --git a/examples/widgets/doc/src/sdi.qdoc b/examples/widgets/doc/src/sdi.qdoc index 379f28dc08..b163930530 100644 --- a/examples/widgets/doc/src/sdi.qdoc +++ b/examples/widgets/doc/src/sdi.qdoc @@ -28,6 +28,7 @@ /*! \example mainwindows/sdi \title SDI Example + \ingroup examples-mainwindow \brief The SDI example shows how to create a Single Document Interface. It uses a number of top-level windows to display the contents of different text files. diff --git a/examples/widgets/doc/src/simpledommodel.qdoc b/examples/widgets/doc/src/simpledommodel.qdoc index 99df1e46ca..c48563f47c 100644 --- a/examples/widgets/doc/src/simpledommodel.qdoc +++ b/examples/widgets/doc/src/simpledommodel.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/simpledommodel \title Simple DOM Model Example - + \ingroup examples-itemviews \brief The Simple DOM Model example shows how an existing class can be adapted for use with the model/view framework. diff --git a/examples/widgets/doc/src/simpletreemodel.qdoc b/examples/widgets/doc/src/simpletreemodel.qdoc index 2b8884d5ca..df23617d5d 100644 --- a/examples/widgets/doc/src/simpletreemodel.qdoc +++ b/examples/widgets/doc/src/simpletreemodel.qdoc @@ -28,6 +28,9 @@ /*! \example itemviews/simpletreemodel \title Simple Tree Model Example + \ingroup examples-itemviews + \brief The Simple Tree Model example shows how to use a hierarchical model + with Qt's standard view classes. \brief The Simple Tree Model example shows how to create a basic, read-only hierarchical model to use with Qt's standard view classes. For a diff --git a/examples/widgets/doc/src/simplewidgetmapper.qdoc b/examples/widgets/doc/src/simplewidgetmapper.qdoc index ca5e47e13c..3e827a4a41 100644 --- a/examples/widgets/doc/src/simplewidgetmapper.qdoc +++ b/examples/widgets/doc/src/simplewidgetmapper.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/simplewidgetmapper \title Simple Widget Mapper Example - + \ingroup examples-itemviews \brief The Simple Widget Mapper example shows how to use a widget mapper to display data from a model in a collection of widgets. diff --git a/examples/widgets/doc/src/spinboxdelegate.qdoc b/examples/widgets/doc/src/spinboxdelegate.qdoc index f2add32286..3941afa95a 100644 --- a/examples/widgets/doc/src/spinboxdelegate.qdoc +++ b/examples/widgets/doc/src/spinboxdelegate.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/spinboxdelegate \title Spin Box Delegate Example - + \ingroup examples-itemviews \brief The Spin Box Delegate example shows how to create an editor for a custom delegate in the model/view framework by reusing a standard Qt editor widget. diff --git a/examples/widgets/doc/src/spreadsheet.qdoc b/examples/widgets/doc/src/spreadsheet.qdoc index cd94e08cec..a869c7dbe7 100644 --- a/examples/widgets/doc/src/spreadsheet.qdoc +++ b/examples/widgets/doc/src/spreadsheet.qdoc @@ -28,6 +28,8 @@ /*! \example itemviews/spreadsheet \title Spreadsheet + \ingroup examples-itemviews + \brief The Spreadsheet example shows how to create a simple spreadsheet application. \brief The Spreadsheet example shows how a table view can be used to create a simple spreadsheet application. Custom delegates are used to render different diff --git a/examples/widgets/doc/src/standarddialogs.qdoc b/examples/widgets/doc/src/standarddialogs.qdoc index f9d9372a70..4b39ac64c5 100644 --- a/examples/widgets/doc/src/standarddialogs.qdoc +++ b/examples/widgets/doc/src/standarddialogs.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/standarddialogs \title Standard Dialogs Example + \ingroup examples-dialogs \brief The Standard Dialogs example shows the standard dialogs that are provided by Qt. diff --git a/examples/widgets/doc/src/stardelegate.qdoc b/examples/widgets/doc/src/stardelegate.qdoc index 38e4cdfe22..f3da875422 100644 --- a/examples/widgets/doc/src/stardelegate.qdoc +++ b/examples/widgets/doc/src/stardelegate.qdoc @@ -28,7 +28,7 @@ /*! \example itemviews/stardelegate \title Star Delegate Example - + \ingroup examples-itemviews \brief The Star Delegate example shows how to create a delegate that can paint itself and that supports editing. diff --git a/examples/widgets/doc/src/tabdialog.qdoc b/examples/widgets/doc/src/tabdialog.qdoc index e2ac57550f..b3e74389af 100644 --- a/examples/widgets/doc/src/tabdialog.qdoc +++ b/examples/widgets/doc/src/tabdialog.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/tabdialog \title Tab Dialog Example + \ingroup examples-dialogs \brief The Tab Dialog example shows how to construct a tab dialog using the QTabWidget class. diff --git a/examples/widgets/doc/src/trivialwizard.qdoc b/examples/widgets/doc/src/trivialwizard.qdoc index c67bb09c0d..4ccee9a625 100644 --- a/examples/widgets/doc/src/trivialwizard.qdoc +++ b/examples/widgets/doc/src/trivialwizard.qdoc @@ -28,6 +28,7 @@ /*! \example dialogs/trivialwizard \title Trivial Wizard Example + \ingroup examples-dialogs \brief The Trivial Wizard example illustrates how to create a linear three-page registration wizard using three instances of QWizardPage and one instance diff --git a/examples/widgets/draganddrop/draganddrop.pro b/examples/widgets/draganddrop/draganddrop.pro index 3f2691a516..098651d2f6 100644 --- a/examples/widgets/draganddrop/draganddrop.pro +++ b/examples/widgets/draganddrop/draganddrop.pro @@ -6,4 +6,3 @@ SUBDIRS = draggableicons \ puzzle wince*: SUBDIRS -= dropsite -QT += widgets diff --git a/examples/widgets/draganddrop/draggableicons/draggableicons.pro b/examples/widgets/draganddrop/draggableicons/draggableicons.pro index 194814a8c8..f87ec4ad60 100644 --- a/examples/widgets/draganddrop/draggableicons/draggableicons.pro +++ b/examples/widgets/draganddrop/draggableicons/draggableicons.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = dragwidget.h RESOURCES = draggableicons.qrc SOURCES = dragwidget.cpp \ @@ -6,5 +8,3 @@ SOURCES = dragwidget.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggableicons INSTALLS += target - -QT += widgets diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.pro b/examples/widgets/draganddrop/draggabletext/draggabletext.pro index 1eb579a2bd..2815be1613 100644 --- a/examples/widgets/draganddrop/draggabletext/draggabletext.pro +++ b/examples/widgets/draganddrop/draggabletext/draggabletext.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = draglabel.h \ dragwidget.h RESOURCES = draggabletext.qrc @@ -8,6 +10,3 @@ SOURCES = draglabel.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggabletext INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/draganddrop/dropsite/dropsite.pro b/examples/widgets/draganddrop/dropsite/dropsite.pro index 008030be85..9496cc4940 100644 --- a/examples/widgets/draganddrop/dropsite/dropsite.pro +++ b/examples/widgets/draganddrop/dropsite/dropsite.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = droparea.h \ dropsitewindow.h SOURCES = droparea.cpp \ @@ -8,5 +10,4 @@ SOURCES = droparea.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/dropsite INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro index 350dee6561..2c3165d1c5 100644 --- a/examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro +++ b/examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = draglabel.h \ dragwidget.h RESOURCES = fridgemagnets.qrc @@ -8,6 +10,3 @@ SOURCES = draglabel.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/fridgemagnets INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro index 4d85778073..95008fc29b 100644 --- a/examples/widgets/draganddrop/puzzle/puzzle.pro +++ b/examples/widgets/draganddrop/puzzle/puzzle.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ pieceslist.h \ puzzlewidget.h @@ -18,4 +20,3 @@ wince*: { addFile.path = . DEPLOYMENT += addFile } -QT += widgets diff --git a/examples/widgets/effects/blurpicker/blurpicker.pro b/examples/widgets/effects/blurpicker/blurpicker.pro index 1d232190ac..c570ac3b98 100644 --- a/examples/widgets/effects/blurpicker/blurpicker.pro +++ b/examples/widgets/effects/blurpicker/blurpicker.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp blurpicker.cpp blureffect.cpp HEADERS += blurpicker.h blureffect.h RESOURCES += blurpicker.qrc @@ -5,5 +7,3 @@ RESOURCES += blurpicker.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/effects/blurpicker INSTALLS += target -QT += widgets - diff --git a/examples/widgets/effects/effects.pro b/examples/widgets/effects/effects.pro index ee3d655815..795e0508ac 100644 --- a/examples/widgets/effects/effects.pro +++ b/examples/widgets/effects/effects.pro @@ -4,5 +4,3 @@ SUBDIRS = \ blurpicker \ lighting \ fademessage - -QT += widgets diff --git a/examples/widgets/effects/fademessage/fademessage.pro b/examples/widgets/effects/fademessage/fademessage.pro index ff860af4f1..727181e1a1 100644 --- a/examples/widgets/effects/fademessage/fademessage.pro +++ b/examples/widgets/effects/fademessage/fademessage.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp fademessage.cpp HEADERS += fademessage.h RESOURCES += fademessage.qrc @@ -6,5 +8,4 @@ RESOURCES += fademessage.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/effects/fademessage INSTALLS += target -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/effects/lighting/lighting.pro b/examples/widgets/effects/lighting/lighting.pro index 5450b62093..0a3b397de5 100644 --- a/examples/widgets/effects/lighting/lighting.pro +++ b/examples/widgets/effects/lighting/lighting.pro @@ -1,9 +1,8 @@ +QT += widgets + SOURCES += main.cpp lighting.cpp HEADERS += lighting.h # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/effects/lighting INSTALLS += target -QT += widgets - - diff --git a/examples/widgets/graphicsview/anchorlayout/anchorlayout.pro b/examples/widgets/graphicsview/anchorlayout/anchorlayout.pro index bc396226c8..fbfeaac049 100644 --- a/examples/widgets/graphicsview/anchorlayout/anchorlayout.pro +++ b/examples/widgets/graphicsview/anchorlayout/anchorlayout.pro @@ -1,11 +1,11 @@ +TARGET = anchorlayout + +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/anchorlayout INSTALLS += target -TARGET = anchorlayout -QT += widgets - - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro index 59abd2b405..46fce9b97a 100644 --- a/examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro +++ b/examples/widgets/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = layoutitem.h \ window.h SOURCES = layoutitem.cpp \ @@ -8,5 +10,3 @@ RESOURCES = basicgraphicslayouts.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/basicgraphicslayouts INSTALLS += target - -QT += widgets diff --git a/examples/widgets/graphicsview/chip/chip.pro b/examples/widgets/graphicsview/chip/chip.pro index 8e3d91f38e..a46f07ce35 100644 --- a/examples/widgets/graphicsview/chip/chip.pro +++ b/examples/widgets/graphicsview/chip/chip.pro @@ -5,8 +5,8 @@ SOURCES += main.cpp SOURCES += mainwindow.cpp view.cpp chip.cpp QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport -contains(QT_CONFIG, opengl):QT += opengl +qtHaveModule(printsupport): QT += printsupport +qtHaveModule(opengl): QT += opengl build_all:!build_pass { CONFIG -= build_all diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp index cb83175744..4b7e6c2ed8 100644 --- a/examples/widgets/graphicsview/chip/view.cpp +++ b/examples/widgets/graphicsview/chip/view.cpp @@ -50,6 +50,7 @@ #endif #include <qmath.h> +#ifndef QT_NO_WHEELEVENT void GraphicsView::wheelEvent(QWheelEvent *e) { if (e->modifiers() & Qt::ControlModifier) { @@ -62,6 +63,7 @@ void GraphicsView::wheelEvent(QWheelEvent *e) QGraphicsView::wheelEvent(e); } } +#endif View::View(const QString &name, QWidget *parent) : QFrame(parent) diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h index b6cdc41200..90e0951716 100644 --- a/examples/widgets/graphicsview/chip/view.h +++ b/examples/widgets/graphicsview/chip/view.h @@ -60,7 +60,9 @@ public: GraphicsView(View *v) : QGraphicsView(), view(v) { } protected: +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *); +#endif private: View *view; diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.pro b/examples/widgets/graphicsview/collidingmice/collidingmice.pro index 0337b6da4a..c96e3dad79 100644 --- a/examples/widgets/graphicsview/collidingmice/collidingmice.pro +++ b/examples/widgets/graphicsview/collidingmice/collidingmice.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += \ mouse.h SOURCES += \ @@ -10,6 +12,3 @@ RESOURCES += \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/collidingmice INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.pro b/examples/widgets/graphicsview/diagramscene/diagramscene.pro index ac70e7af17..0c769a0f74 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramscene.pro +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ diagramitem.h \ diagramscene.h \ @@ -16,6 +18,4 @@ RESOURCES = diagramscene.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/diagramscene INSTALLS += target - -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro index 4f8cebc755..8e4197c965 100644 --- a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro +++ b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += \ coloritem.h \ robot.h @@ -15,6 +17,4 @@ RESOURCES += \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/dragdroprobot INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/graphicsview/elasticnodes/elasticnodes.pro b/examples/widgets/graphicsview/elasticnodes/elasticnodes.pro index 71ac21ffe9..419fdad617 100644 --- a/examples/widgets/graphicsview/elasticnodes/elasticnodes.pro +++ b/examples/widgets/graphicsview/elasticnodes/elasticnodes.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += \ edge.h \ node.h \ @@ -12,5 +14,3 @@ SOURCES += \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/elasticnodes INSTALLS += target - -QT += widgets diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp index 67b6088079..b501a4f3c1 100644 --- a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp +++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp @@ -174,12 +174,14 @@ void GraphWidget::timerEvent(QTimerEvent *event) } //! [4] +#ifndef QT_NO_WHEELEVENT //! [5] void GraphWidget::wheelEvent(QWheelEvent *event) { scaleView(pow((double)2, -event->delta() / 240.0)); } //! [5] +#endif //! [6] void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect) diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.h b/examples/widgets/graphicsview/elasticnodes/graphwidget.h index 064d3bf00a..202c17c204 100644 --- a/examples/widgets/graphicsview/elasticnodes/graphwidget.h +++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.h @@ -63,7 +63,9 @@ public slots: protected: void keyPressEvent(QKeyEvent *event); void timerEvent(QTimerEvent *event); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *event); +#endif void drawBackground(QPainter *painter, const QRectF &rect); void scaleView(qreal scaleFactor); diff --git a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro index dd01312788..993a5f22b7 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro +++ b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp SOURCES += customproxy.cpp embeddeddialog.cpp HEADERS += customproxy.h embeddeddialog.h @@ -13,5 +15,3 @@ build_all:!build_pass { # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/embeddeddialogs INSTALLS += target - -QT += widgets diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro index f7142709c8..9d6d7a75f6 100644 --- a/examples/widgets/graphicsview/graphicsview.pro +++ b/examples/widgets/graphicsview/graphicsview.pro @@ -15,8 +15,6 @@ SUBDIRS = \ contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot -contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ +qtHaveModule(opengl):!contains(QT_CONFIG, opengles.) { SUBDIRS += boxes } - -QT += widgets diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.pro b/examples/widgets/graphicsview/padnavigator/padnavigator.pro index 460cc90219..c2bc79b5cc 100644 --- a/examples/widgets/graphicsview/padnavigator/padnavigator.pro +++ b/examples/widgets/graphicsview/padnavigator/padnavigator.pro @@ -17,7 +17,7 @@ FORMS += \ form.ui QT += widgets -contains(QT_CONFIG, opengl):QT += opengl +qtHaveModule(opengl): QT += opengl # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/padnavigator diff --git a/examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.pro b/examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.pro index c8c992adbe..59e37ff64f 100644 --- a/examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.pro +++ b/examples/widgets/graphicsview/simpleanchorlayout/simpleanchorlayout.pro @@ -1,10 +1,11 @@ +TARGET = simpleanchorlayout + +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/simpleanchorlayout INSTALLS += target -TARGET = simpleanchorlayout -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/itemviews/addressbook/addressbook.pro b/examples/widgets/itemviews/addressbook/addressbook.pro index 0d421cb3e3..5e2f1bcbbc 100644 --- a/examples/widgets/itemviews/addressbook/addressbook.pro +++ b/examples/widgets/itemviews/addressbook/addressbook.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = adddialog.cpp \ addresswidget.cpp \ main.cpp \ @@ -13,5 +15,3 @@ HEADERS = adddialog.h \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/addressbook INSTALLS += target -QT += widgets - diff --git a/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro index 6c0924cf7f..2469a4ef20 100644 --- a/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro +++ b/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro @@ -1,10 +1,9 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/basicsortfiltermodel INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/chart/chart.pro b/examples/widgets/itemviews/chart/chart.pro index 927c469e88..caa28276bc 100644 --- a/examples/widgets/itemviews/chart/chart.pro +++ b/examples/widgets/itemviews/chart/chart.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ pieview.h RESOURCES = chart.qrc @@ -9,6 +11,3 @@ unix:!mac:!vxworks:!integrity:LIBS+= -lm # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/chart INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.pro b/examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.pro index 4c16a6fbc1..82cb264ddd 100644 --- a/examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.pro +++ b/examples/widgets/itemviews/coloreditorfactory/coloreditorfactory.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = colorlisteditor.h \ window.h SOURCES = colorlisteditor.cpp \ @@ -7,6 +9,3 @@ SOURCES = colorlisteditor.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/coloreditorfactory INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.pro b/examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.pro index a093f88e88..37f82fa5ae 100644 --- a/examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.pro +++ b/examples/widgets/itemviews/combowidgetmapper/combowidgetmapper.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -5,5 +7,4 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/combowidgetmapper INSTALLS += target -QT += widgets diff --git a/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro index 66ea1063c8..b722e606d3 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro +++ b/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro @@ -1,12 +1,11 @@ +QT += widgets + HEADERS = mysortfilterproxymodel.h \ window.h SOURCES = main.cpp \ mysortfilterproxymodel.cpp \ window.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/customsortfiltermodel INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/dirview/dirview.pro b/examples/widgets/itemviews/dirview/dirview.pro index 0c1cd92a58..511ec0ed98 100644 --- a/examples/widgets/itemviews/dirview/dirview.pro +++ b/examples/widgets/itemviews/dirview/dirview.pro @@ -1,7 +1,7 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/dirview INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro b/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro index fcbdfd997f..a6c1e5563f 100644 --- a/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro +++ b/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro @@ -1,3 +1,5 @@ +QT += widgets + FORMS = mainwindow.ui HEADERS = mainwindow.h \ treeitem.h \ @@ -7,10 +9,7 @@ SOURCES = mainwindow.cpp \ treeitem.cpp \ treemodel.cpp \ main.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/editabletreemodel INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/fetchmore/fetchmore.pro b/examples/widgets/itemviews/fetchmore/fetchmore.pro index 67006de9c7..eb4275da19 100644 --- a/examples/widgets/itemviews/fetchmore/fetchmore.pro +++ b/examples/widgets/itemviews/fetchmore/fetchmore.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = filelistmodel.h \ window.h SOURCES = filelistmodel.cpp \ @@ -7,5 +9,3 @@ SOURCES = filelistmodel.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/fetchmore INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/frozencolumn/frozencolumn.pro b/examples/widgets/itemviews/frozencolumn/frozencolumn.pro index 00247b71c7..717ba40a9d 100644 --- a/examples/widgets/itemviews/frozencolumn/frozencolumn.pro +++ b/examples/widgets/itemviews/frozencolumn/frozencolumn.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += freezetablewidget.h SOURCES += main.cpp freezetablewidget.cpp RESOURCES += grades.qrc @@ -5,5 +7,4 @@ RESOURCES += grades.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/frozencolumn INSTALLS += target -QT += widgets diff --git a/examples/widgets/itemviews/interview/interview.pro b/examples/widgets/itemviews/interview/interview.pro index 08dd9b991e..0e480e939c 100644 --- a/examples/widgets/itemviews/interview/interview.pro +++ b/examples/widgets/itemviews/interview/interview.pro @@ -1,6 +1,6 @@ TEMPLATE = app +QT += widgets -CONFIG += qt warn_on HEADERS += model.h SOURCES += model.cpp main.cpp RESOURCES += interview.qrc @@ -13,5 +13,3 @@ build_all:!build_pass { # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/interview INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro index 60512e2b66..5d5eef1b0f 100644 --- a/examples/widgets/itemviews/itemviews.pro +++ b/examples/widgets/itemviews/itemviews.pro @@ -18,5 +18,4 @@ SUBDIRS = addressbook \ spinboxdelegate \ spreadsheet \ stardelegate - -QT += widgets +contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle diff --git a/examples/widgets/itemviews/pixelator/pixelator.pro b/examples/widgets/itemviews/pixelator/pixelator.pro index 37e54f937a..35176a6026 100644 --- a/examples/widgets/itemviews/pixelator/pixelator.pro +++ b/examples/widgets/itemviews/pixelator/pixelator.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + HEADERS = imagemodel.h \ mainwindow.h \ pixeldelegate.h @@ -10,6 +13,3 @@ RESOURCES += images.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/pixelator INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/itemviews/puzzle/puzzle.pro b/examples/widgets/itemviews/puzzle/puzzle.pro index a05ad83f79..a5379293ff 100644 --- a/examples/widgets/itemviews/puzzle/puzzle.pro +++ b/examples/widgets/itemviews/puzzle/puzzle.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ piecesmodel.h \ puzzlewidget.h @@ -15,6 +17,3 @@ INSTALLS += target wince* { DEPLOYMENT_PLUGIN += qjpeg qgif } - -QT += widgets - diff --git a/examples/widgets/itemviews/simpledommodel/simpledommodel.pro b/examples/widgets/itemviews/simpledommodel/simpledommodel.pro index e52ea4f71e..db15632ba9 100644 --- a/examples/widgets/itemviews/simpledommodel/simpledommodel.pro +++ b/examples/widgets/itemviews/simpledommodel/simpledommodel.pro @@ -5,7 +5,6 @@ SOURCES = domitem.cpp \ dommodel.cpp \ main.cpp \ mainwindow.cpp -CONFIG += qt QT += xml widgets # install diff --git a/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro b/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro index 289939fb2f..82484c9971 100644 --- a/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro +++ b/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro @@ -1,13 +1,12 @@ +QT += widgets + HEADERS = treeitem.h \ treemodel.h RESOURCES = simpletreemodel.qrc SOURCES = treeitem.cpp \ treemodel.cpp \ main.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/simpletreemodel INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro b/examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro index c19cb0eef8..1d5cca3f01 100644 --- a/examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro +++ b/examples/widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -5,5 +7,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/simplewidgetmapper INSTALLS += target - -QT += widgets diff --git a/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro b/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro index c156a4f425..92f6b9d712 100644 --- a/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro +++ b/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = delegate.h SOURCES = delegate.cpp \ main.cpp @@ -6,6 +8,4 @@ SOURCES = delegate.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/spinboxdelegate INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.pro b/examples/widgets/itemviews/spreadsheet/spreadsheet.pro index b69811a4b8..56f7424a93 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheet.pro +++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.pro @@ -1,6 +1,6 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport -#unix:contains(QT_CONFIG, dbus):QT += dbus widgets +qtHaveModule(printsupport): QT += printsupport +#unix:qtHaveModule(dbus): QT += dbus widgets HEADERS += printview.h spreadsheet.h spreadsheetdelegate.h spreadsheetitem.h SOURCES += main.cpp \ diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.pro b/examples/widgets/itemviews/stardelegate/stardelegate.pro index 13c260d268..fefb8b5b95 100644 --- a/examples/widgets/itemviews/stardelegate/stardelegate.pro +++ b/examples/widgets/itemviews/stardelegate/stardelegate.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = stardelegate.h \ stareditor.h \ starrating.h @@ -10,6 +12,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/stardelegate INSTALLS += target - -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/layouts/basiclayouts/basiclayouts.pro b/examples/widgets/layouts/basiclayouts/basiclayouts.pro index cfa8594516..bc53b27782 100644 --- a/examples/widgets/layouts/basiclayouts/basiclayouts.pro +++ b/examples/widgets/layouts/basiclayouts/basiclayouts.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = dialog.h SOURCES = dialog.cpp \ main.cpp @@ -6,6 +8,4 @@ SOURCES = dialog.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/layouts/basiclayouts INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/layouts/borderlayout/borderlayout.pro b/examples/widgets/layouts/borderlayout/borderlayout.pro index 2b7d55919a..53c9647bd7 100644 --- a/examples/widgets/layouts/borderlayout/borderlayout.pro +++ b/examples/widgets/layouts/borderlayout/borderlayout.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = borderlayout.h \ window.h SOURCES = borderlayout.cpp \ @@ -7,5 +9,3 @@ SOURCES = borderlayout.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/layouts/borderlayout INSTALLS += target - -QT += widgets diff --git a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro index 293137c426..8424799ca3 100644 --- a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro +++ b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = dialog.h SOURCES = dialog.cpp \ main.cpp @@ -6,6 +8,4 @@ SOURCES = dialog.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/layouts/dynamiclayouts INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/layouts/flowlayout/flowlayout.pro b/examples/widgets/layouts/flowlayout/flowlayout.pro index bd977f2a0e..a0cfd409bb 100644 --- a/examples/widgets/layouts/flowlayout/flowlayout.pro +++ b/examples/widgets/layouts/flowlayout/flowlayout.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = flowlayout.h \ window.h SOURCES = flowlayout.cpp \ @@ -7,5 +9,3 @@ SOURCES = flowlayout.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/layouts/flowlayout INSTALLS += target - -QT += widgets diff --git a/examples/widgets/layouts/layouts.pro b/examples/widgets/layouts/layouts.pro index cfd9b4b01c..c641e8cf7f 100644 --- a/examples/widgets/layouts/layouts.pro +++ b/examples/widgets/layouts/layouts.pro @@ -3,5 +3,3 @@ SUBDIRS = basiclayouts \ borderlayout \ dynamiclayouts \ flowlayout - -QT += widgets diff --git a/examples/widgets/mainwindows/application/application.pro b/examples/widgets/mainwindows/application/application.pro index f202a60979..652cc73485 100644 --- a/examples/widgets/mainwindows/application/application.pro +++ b/examples/widgets/mainwindows/application/application.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp @@ -9,6 +11,4 @@ RESOURCES = application.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/application INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro index ec3a5813e1..f445c5a89e 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp @@ -7,7 +10,4 @@ RESOURCES = dockwidgets.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/dockwidgets INSTALLS += target -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.pro b/examples/widgets/mainwindows/mainwindow/mainwindow.pro index 2bef5f0b71..bf92d0e3ca 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.pro +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.pro @@ -1,4 +1,6 @@ TEMPLATE = app +QT += widgets + HEADERS += colorswatch.h mainwindow.h toolbar.h SOURCES += colorswatch.cpp mainwindow.cpp toolbar.cpp main.cpp build_all:!build_pass { @@ -11,5 +13,3 @@ RESOURCES += mainwindow.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/mainwindow INSTALLS += target - -QT += widgets diff --git a/examples/widgets/mainwindows/mainwindows.pro b/examples/widgets/mainwindows/mainwindows.pro index 848fdb04df..52179ec9bd 100644 --- a/examples/widgets/mainwindows/mainwindows.pro +++ b/examples/widgets/mainwindows/mainwindows.pro @@ -6,5 +6,3 @@ SUBDIRS = application \ menus \ recentfiles \ sdi - -QT += widgets diff --git a/examples/widgets/mainwindows/mdi/mdi.pro b/examples/widgets/mainwindows/mdi/mdi.pro index 786bbd3569..9f8ed1184a 100644 --- a/examples/widgets/mainwindows/mdi/mdi.pro +++ b/examples/widgets/mainwindows/mdi/mdi.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ mdichild.h SOURCES = main.cpp \ @@ -9,6 +11,4 @@ RESOURCES = mdi.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/mdi INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/mainwindows/menus/menus.pro b/examples/widgets/mainwindows/menus/menus.pro index 1ac5df4a3b..9be318759c 100644 --- a/examples/widgets/mainwindows/menus/menus.pro +++ b/examples/widgets/mainwindows/menus/menus.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h SOURCES = mainwindow.cpp \ main.cpp @@ -5,5 +7,3 @@ SOURCES = mainwindow.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/menus INSTALLS += target - -QT += widgets diff --git a/examples/widgets/mainwindows/recentfiles/recentfiles.pro b/examples/widgets/mainwindows/recentfiles/recentfiles.pro index 4ab5a6820e..898ebd7842 100644 --- a/examples/widgets/mainwindows/recentfiles/recentfiles.pro +++ b/examples/widgets/mainwindows/recentfiles/recentfiles.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp @@ -6,6 +8,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/recentfiles INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/mainwindows/sdi/sdi.pro b/examples/widgets/mainwindows/sdi/sdi.pro index 30ae4f5f3d..7d46b327e7 100644 --- a/examples/widgets/mainwindows/sdi/sdi.pro +++ b/examples/widgets/mainwindows/sdi/sdi.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp @@ -7,6 +9,4 @@ RESOURCES = sdi.qrc target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/sdi INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/painting/affine/affine.pro b/examples/widgets/painting/affine/affine.pro index e94f4d12fb..1f2f8df87f 100644 --- a/examples/widgets/painting/affine/affine.pro +++ b/examples/widgets/painting/affine/affine.pro @@ -1,7 +1,7 @@ SOURCES += main.cpp xform.cpp HEADERS += xform.h -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp index a873ba7af8..d4485df0b3 100644 --- a/examples/widgets/painting/affine/xform.cpp +++ b/examples/widgets/painting/affine/xform.cpp @@ -251,12 +251,14 @@ void XFormView::timerEvent(QTimerEvent *e) } } +#ifndef QT_NO_WHEELEVENT void XFormView::wheelEvent(QWheelEvent *e) { m_scale += e->delta() / qreal(600); m_scale = qMax(qreal(0.1), qMin(qreal(4), m_scale)); emit scaleChanged(int(m_scale*1000)); } +#endif void XFormView::reset() { diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h index fff92733a0..a04381165d 100644 --- a/examples/widgets/painting/affine/xform.h +++ b/examples/widgets/painting/affine/xform.h @@ -116,7 +116,9 @@ signals: protected: void timerEvent(QTimerEvent *e); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *); +#endif private: QPolygonF ctrlPoints; diff --git a/examples/widgets/painting/basicdrawing/basicdrawing.pro b/examples/widgets/painting/basicdrawing/basicdrawing.pro index 52ee0d4402..a7b3cff9cd 100644 --- a/examples/widgets/painting/basicdrawing/basicdrawing.pro +++ b/examples/widgets/painting/basicdrawing/basicdrawing.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -8,5 +10,3 @@ RESOURCES = basicdrawing.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/basicdrawing INSTALLS += target - -QT += widgets diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro index 7ff82d789a..0269945ac8 100644 --- a/examples/widgets/painting/composition/composition.pro +++ b/examples/widgets/painting/composition/composition.pro @@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared include($$SHARED_FOLDER/shared.pri) RESOURCES += composition.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/concentriccircles/concentriccircles.pro b/examples/widgets/painting/concentriccircles/concentriccircles.pro index 9690465d46..844c01a9c2 100644 --- a/examples/widgets/painting/concentriccircles/concentriccircles.pro +++ b/examples/widgets/painting/concentriccircles/concentriccircles.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = circlewidget.h \ window.h SOURCES = circlewidget.cpp \ @@ -7,6 +9,3 @@ SOURCES = circlewidget.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/concentriccircles INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/deform/deform.pro b/examples/widgets/painting/deform/deform.pro index 01dc0a869c..6409aaed96 100644 --- a/examples/widgets/painting/deform/deform.pro +++ b/examples/widgets/painting/deform/deform.pro @@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri) RESOURCES += deform.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/fontsampler/fontsampler.pro b/examples/widgets/painting/fontsampler/fontsampler.pro index c32fc40572..08dd07bc08 100644 --- a/examples/widgets/painting/fontsampler/fontsampler.pro +++ b/examples/widgets/painting/fontsampler/fontsampler.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + FORMS = mainwindowbase.ui HEADERS = mainwindow.h SOURCES = main.cpp \ @@ -6,6 +9,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/fontsampler INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/painting/gradients/gradients.pro b/examples/widgets/painting/gradients/gradients.pro index a7d6ae68d1..73f3974c62 100644 --- a/examples/widgets/painting/gradients/gradients.pro +++ b/examples/widgets/painting/gradients/gradients.pro @@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared include($$SHARED_FOLDER/shared.pri) RESOURCES += gradients.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/imagecomposition/imagecomposition.pro b/examples/widgets/painting/imagecomposition/imagecomposition.pro index ce23c601f5..42c70471c1 100644 --- a/examples/widgets/painting/imagecomposition/imagecomposition.pro +++ b/examples/widgets/painting/imagecomposition/imagecomposition.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = imagecomposer.h SOURCES = imagecomposer.cpp \ main.cpp @@ -6,6 +8,3 @@ RESOURCES = imagecomposition.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/imagecomposition INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/painterpaths/painterpaths.pro b/examples/widgets/painting/painterpaths/painterpaths.pro index 560e84a267..2d2db30739 100644 --- a/examples/widgets/painting/painterpaths/painterpaths.pro +++ b/examples/widgets/painting/painterpaths/painterpaths.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -8,6 +10,3 @@ unix:!mac:!vxworks:!integrity:LIBS += -lm # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/painterpaths INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/painting.pro b/examples/widgets/painting/painting.pro index 145fcdd383..7459dd3e94 100644 --- a/examples/widgets/painting/painting.pro +++ b/examples/widgets/painting/painting.pro @@ -12,8 +12,6 @@ SUBDIRS = basicdrawing \ transformations \ fontsampler -QT += widgets - examples_affine.subdir = affine examples_composition.subdir = composition examples_deform.subdir = deform diff --git a/examples/widgets/painting/pathstroke/pathstroke.pro b/examples/widgets/painting/pathstroke/pathstroke.pro index 197fe22024..8ab3cb9244 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.pro +++ b/examples/widgets/painting/pathstroke/pathstroke.pro @@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri) RESOURCES += pathstroke.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri index 6aef1bdd5b..af027e081a 100644 --- a/examples/widgets/painting/shared/shared.pri +++ b/examples/widgets/painting/shared/shared.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { DEFINES += QT_OPENGL_SUPPORT QT += opengl widgets } diff --git a/examples/widgets/painting/shared/shared.pro b/examples/widgets/painting/shared/shared.pro index 2a71c7d487..2756bf75ca 100644 --- a/examples/widgets/painting/shared/shared.pro +++ b/examples/widgets/painting/shared/shared.pro @@ -1,17 +1,17 @@ TEMPLATE = lib CONFIG += static -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT - QT += opengl widgets + QT += opengl } +QT += widgets build_all:!build_pass { CONFIG -= build_all CONFIG += release } TARGET = demo_shared -QT += widgets SOURCES += \ arthurstyle.cpp\ diff --git a/examples/widgets/painting/transformations/transformations.pro b/examples/widgets/painting/transformations/transformations.pro index 72f42046db..3f5398a228 100644 --- a/examples/widgets/painting/transformations/transformations.pro +++ b/examples/widgets/painting/transformations/transformations.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -7,5 +9,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/transformations INSTALLS += target - -QT += widgets diff --git a/examples/widgets/richtext/calendar/calendar.pro b/examples/widgets/richtext/calendar/calendar.pro index d98b08a368..5adb99aac3 100644 --- a/examples/widgets/richtext/calendar/calendar.pro +++ b/examples/widgets/richtext/calendar/calendar.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h SOURCES = main.cpp \ mainwindow.cpp @@ -5,5 +7,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/richtext/calendar INSTALLS += target - -QT += widgets diff --git a/examples/widgets/richtext/orderform/orderform.pro b/examples/widgets/richtext/orderform/orderform.pro index 72ba3a1d25..0eb9da3ae1 100644 --- a/examples/widgets/richtext/orderform/orderform.pro +++ b/examples/widgets/richtext/orderform/orderform.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + HEADERS = detailsdialog.h \ mainwindow.h SOURCES = detailsdialog.cpp \ @@ -7,6 +10,3 @@ SOURCES = detailsdialog.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/richtext/orderform INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro index e968c1168a..640f36f9b8 100644 --- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro +++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = highlighter.h \ mainwindow.h SOURCES = highlighter.cpp \ @@ -14,5 +16,3 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles } -QT += widgets - diff --git a/examples/widgets/richtext/textedit/textedit.pro b/examples/widgets/richtext/textedit/textedit.pro index a2090231c5..c32bf68f68 100644 --- a/examples/widgets/richtext/textedit/textedit.pro +++ b/examples/widgets/richtext/textedit/textedit.pro @@ -1,8 +1,9 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + TEMPLATE = app TARGET = textedit -CONFIG += qt warn_on - HEADERS = textedit.h SOURCES = textedit.cpp \ main.cpp @@ -18,6 +19,3 @@ EXAMPLE_FILES = textedit.qdoc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/richtext/textedit INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/richtext/textedit/textedit.qdoc b/examples/widgets/richtext/textedit/textedit.qdoc index 18f26dbd1d..070ac22f92 100644 --- a/examples/widgets/richtext/textedit/textedit.qdoc +++ b/examples/widgets/richtext/textedit/textedit.qdoc @@ -33,9 +33,8 @@ \brief This example displays a text editor with the user interface written in pure C++. - A similar example which uses \link designer-manual.book Qt - Designer\endlink to produce the user interface is in the \link - designer-manual.book Qt Designer manual\endlink. + A similar example which uses Qt Designer to produce the user + interface is in the \l {Qt Designer Manual}. See \c{$QTDIR/examples/textedit} for the source code. diff --git a/examples/widgets/scroller/graphicsview/graphicsview.pro b/examples/widgets/scroller/graphicsview/graphicsview.pro index 07ad81922e..39bdb2bc2c 100644 --- a/examples/widgets/scroller/graphicsview/graphicsview.pro +++ b/examples/widgets/scroller/graphicsview/graphicsview.pro @@ -1,7 +1,8 @@ +QT += widgets + TEMPLATE = app SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/scroller/graphicsview INSTALLS += target -QT += widgets diff --git a/examples/widgets/statemachine/eventtransitions/eventtransitions.pro b/examples/widgets/statemachine/eventtransitions/eventtransitions.pro index 7b8ef26eb0..63c2eab5a9 100644 --- a/examples/widgets/statemachine/eventtransitions/eventtransitions.pro +++ b/examples/widgets/statemachine/eventtransitions/eventtransitions.pro @@ -1,9 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/statemachine/eventtransitions INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/statemachine/rogue/rogue.pro b/examples/widgets/statemachine/rogue/rogue.pro index d1f4f5d972..cf9657c7d6 100644 --- a/examples/widgets/statemachine/rogue/rogue.pro +++ b/examples/widgets/statemachine/rogue/rogue.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h \ movementtransition.h SOURCES = main.cpp \ @@ -6,6 +8,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/statemachine/rogue INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/statemachine/statemachine.pro b/examples/widgets/statemachine/statemachine.pro index 2a539d2e54..926e01cfda 100644 --- a/examples/widgets/statemachine/statemachine.pro +++ b/examples/widgets/statemachine/statemachine.pro @@ -3,7 +3,7 @@ SUBDIRS = \ factorial \ pingpong -!contains(QT_CONFIG, no-widgets) { +qtHaveModule(widgets) { SUBDIRS += \ eventtransitions \ rogue \ diff --git a/examples/widgets/statemachine/trafficlight/trafficlight.pro b/examples/widgets/statemachine/trafficlight/trafficlight.pro index 14d10f5a10..85d9cda504 100644 --- a/examples/widgets/statemachine/trafficlight/trafficlight.pro +++ b/examples/widgets/statemachine/trafficlight/trafficlight.pro @@ -1,8 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/statemachine/trafficlight INSTALLS += target -QT += widgets diff --git a/examples/widgets/statemachine/twowaybutton/twowaybutton.pro b/examples/widgets/statemachine/twowaybutton/twowaybutton.pro index 9562df5919..22d19308ae 100644 --- a/examples/widgets/statemachine/twowaybutton/twowaybutton.pro +++ b/examples/widgets/statemachine/twowaybutton/twowaybutton.pro @@ -1,8 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/statemachine/twowaybutton INSTALLS += target -QT += widgets diff --git a/examples/widgets/tools/codecs/codecs.pro b/examples/widgets/tools/codecs/codecs.pro index 410411d870..7b2baa3ec8 100644 --- a/examples/widgets/tools/codecs/codecs.pro +++ b/examples/widgets/tools/codecs/codecs.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += mainwindow.h \ previewform.h SOURCES += main.cpp \ @@ -10,6 +12,4 @@ EXAMPLE_FILES = encodedfiles target.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/completer/completer.pro b/examples/widgets/tools/completer/completer.pro index c0fcf8d1fb..b47b7a9057 100644 --- a/examples/widgets/tools/completer/completer.pro +++ b/examples/widgets/tools/completer/completer.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = fsmodel.h \ mainwindow.h SOURCES = fsmodel.cpp \ @@ -9,6 +11,4 @@ RESOURCES = completer.qrc target.path = $$[QT_INSTALL_EXAMPLES]/tools/completer INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/customcompleter/customcompleter.pro b/examples/widgets/tools/customcompleter/customcompleter.pro index 24d973cf82..b8ccc83744 100644 --- a/examples/widgets/tools/customcompleter/customcompleter.pro +++ b/examples/widgets/tools/customcompleter/customcompleter.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ textedit.h SOURCES = main.cpp \ @@ -9,6 +11,4 @@ RESOURCES = customcompleter.qrc target.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/echoplugin/echoplugin.pro b/examples/widgets/tools/echoplugin/echoplugin.pro index 685227c6c4..986ba9c9c3 100644 --- a/examples/widgets/tools/echoplugin/echoplugin.pro +++ b/examples/widgets/tools/echoplugin/echoplugin.pro @@ -7,5 +7,3 @@ SUBDIRS = echowindow \ # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/echoplugin/echowindow/echowindow.pro b/examples/widgets/tools/echoplugin/echowindow/echowindow.pro index cd91693ec0..c8dc000678 100644 --- a/examples/widgets/tools/echoplugin/echowindow/echowindow.pro +++ b/examples/widgets/tools/echoplugin/echowindow/echowindow.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = echowindow.h \ echointerface.h SOURCES = echowindow.cpp \ @@ -16,6 +18,4 @@ win32 { target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/echoplugin/plugin/plugin.pro b/examples/widgets/tools/echoplugin/plugin/plugin.pro index a586130b76..235358d52c 100644 --- a/examples/widgets/tools/echoplugin/plugin/plugin.pro +++ b/examples/widgets/tools/echoplugin/plugin/plugin.pro @@ -1,6 +1,7 @@ #! [0] TEMPLATE = lib CONFIG += plugin +QT += widgets INCLUDEPATH += ../echowindow HEADERS = echoplugin.h SOURCES = echoplugin.cpp @@ -13,5 +14,3 @@ EXAMPLE_FILES = echoplugin.json # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/i18n/i18n.pro b/examples/widgets/tools/i18n/i18n.pro index 57514781eb..8095e44b3c 100644 --- a/examples/widgets/tools/i18n/i18n.pro +++ b/examples/widgets/tools/i18n/i18n.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = languagechooser.h \ mainwindow.h SOURCES = languagechooser.cpp \ @@ -23,6 +25,4 @@ TRANSLATIONS += translations/i18n_ar.ts \ target.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/plugandpaint/plugandpaint.pro b/examples/widgets/tools/plugandpaint/plugandpaint.pro index ffa408df66..0b20f81a1f 100644 --- a/examples/widgets/tools/plugandpaint/plugandpaint.pro +++ b/examples/widgets/tools/plugandpaint/plugandpaint.pro @@ -1,4 +1,6 @@ #! [0] +QT += widgets + HEADERS = interfaces.h \ mainwindow.h \ paintarea.h \ @@ -19,5 +21,3 @@ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/plugandpaintplugins/basictools/basictools.pro b/examples/widgets/tools/plugandpaintplugins/basictools/basictools.pro index 731034fb3c..aac2edce00 100644 --- a/examples/widgets/tools/plugandpaintplugins/basictools/basictools.pro +++ b/examples/widgets/tools/plugandpaintplugins/basictools/basictools.pro @@ -1,6 +1,7 @@ #! [0] TEMPLATE = lib CONFIG += plugin static +QT += widgets INCLUDEPATH += ../.. HEADERS = basictoolsplugin.h SOURCES = basictoolsplugin.cpp @@ -11,5 +12,3 @@ DESTDIR = ../../plugandpaint/plugins # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h b/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h index b5159803f6..3da75252a7 100644 --- a/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h +++ b/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h @@ -58,7 +58,9 @@ class BasicToolsPlugin : public QObject, public FilterInterface { Q_OBJECT +//! [4] Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json") +//! [4] Q_INTERFACES(BrushInterface ShapeInterface FilterInterface) //! [0] diff --git a/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafilters.pro index 7a18e49dc1..3280f119cf 100644 --- a/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafilters.pro +++ b/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafilters.pro @@ -1,6 +1,7 @@ #! [0] TEMPLATE = lib CONFIG += plugin +QT += widgets INCLUDEPATH += ../.. HEADERS = extrafiltersplugin.h SOURCES = extrafiltersplugin.cpp @@ -11,5 +12,3 @@ DESTDIR = ../../plugandpaint/plugins # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/plugandpaintplugins/plugandpaintplugins.pro b/examples/widgets/tools/plugandpaintplugins/plugandpaintplugins.pro index 6f077c952e..e15220c621 100644 --- a/examples/widgets/tools/plugandpaintplugins/plugandpaintplugins.pro +++ b/examples/widgets/tools/plugandpaintplugins/plugandpaintplugins.pro @@ -1,5 +1,3 @@ TEMPLATE = subdirs SUBDIRS = basictools \ extrafilters - -QT += widgets diff --git a/examples/widgets/tools/regexp/regexp.pro b/examples/widgets/tools/regexp/regexp.pro index eead58807f..0d2a9a280c 100644 --- a/examples/widgets/tools/regexp/regexp.pro +++ b/examples/widgets/tools/regexp/regexp.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = regexpdialog.h SOURCES = regexpdialog.cpp \ main.cpp @@ -6,6 +8,4 @@ SOURCES = regexpdialog.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/settingseditor/settingseditor.pro b/examples/widgets/tools/settingseditor/settingseditor.pro index 9d7c776067..69b8a04c92 100644 --- a/examples/widgets/tools/settingseditor/settingseditor.pro +++ b/examples/widgets/tools/settingseditor/settingseditor.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = locationdialog.h \ mainwindow.h \ settingstree.h \ @@ -14,6 +16,4 @@ EXAMPLE_FILES = inifiles target.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/styleplugin/plugin/plugin.pro b/examples/widgets/tools/styleplugin/plugin/plugin.pro index 65a41087e6..605e196bd9 100644 --- a/examples/widgets/tools/styleplugin/plugin/plugin.pro +++ b/examples/widgets/tools/styleplugin/plugin/plugin.pro @@ -1,6 +1,7 @@ #! [0] TEMPLATE = lib CONFIG += plugin +QT += widgets HEADERS = simplestyle.h \ simplestyleplugin.h SOURCES = simplestyle.cpp \ @@ -19,6 +20,3 @@ EXAMPLE_FILES += simplestyle.json # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/styles INSTALLS += target - - -QT += widgets diff --git a/examples/widgets/tools/styleplugin/styleplugin.pro b/examples/widgets/tools/styleplugin/styleplugin.pro index 4df48ae6b4..d7129e724b 100644 --- a/examples/widgets/tools/styleplugin/styleplugin.pro +++ b/examples/widgets/tools/styleplugin/styleplugin.pro @@ -5,5 +5,3 @@ SUBDIRS = stylewindow \ # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/styleplugin/stylewindow/stylewindow.pro b/examples/widgets/tools/styleplugin/stylewindow/stylewindow.pro index 3bfcf23bbb..12adce4872 100644 --- a/examples/widgets/tools/styleplugin/stylewindow/stylewindow.pro +++ b/examples/widgets/tools/styleplugin/stylewindow/stylewindow.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = stylewindow.h SOURCES = stylewindow.cpp \ main.cpp @@ -13,5 +15,3 @@ win32 { # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro index aaf4440d23..f08f7fd6d2 100644 --- a/examples/widgets/tools/tools.pro +++ b/examples/widgets/tools/tools.pro @@ -14,6 +14,8 @@ SUBDIRS = \ undo \ undoframework +contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= i18n + plugandpaint.depends = plugandpaintplugins # install diff --git a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.pro b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.pro index 818f242b48..56e0cee210 100644 --- a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.pro +++ b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = treemodelcompleter.h \ mainwindow.h SOURCES = treemodelcompleter.cpp \ @@ -9,6 +11,4 @@ RESOURCES = treemodelcompleter.qrc target.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tools/undo/undo.pro b/examples/widgets/tools/undo/undo.pro index f3ac1256c0..5e0f1d7817 100644 --- a/examples/widgets/tools/undo/undo.pro +++ b/examples/widgets/tools/undo/undo.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp mainwindow.cpp commands.cpp document.cpp HEADERS += mainwindow.h commands.h document.h FORMS += mainwindow.ui @@ -12,5 +14,3 @@ RESOURCES += undo.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/undo INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tools/undoframework/undoframework.pro b/examples/widgets/tools/undoframework/undoframework.pro index a9a1b05f39..9cea99f105 100644 --- a/examples/widgets/tools/undoframework/undoframework.pro +++ b/examples/widgets/tools/undoframework/undoframework.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = commands.h \ diagramitem.h \ diagramscene.h \ @@ -13,6 +15,4 @@ RESOURCES = undoframework.qrc target.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/addressbook-fr.pro b/examples/widgets/tutorials/addressbook-fr/addressbook-fr.pro index 50e6e55ac8..8006039ce3 100644 --- a/examples/widgets/tutorials/addressbook-fr/addressbook-fr.pro +++ b/examples/widgets/tutorials/addressbook-fr/addressbook-fr.pro @@ -4,5 +4,4 @@ SUBDIRS = part1 part2 part3 part4 part5 part6 part7 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr INSTALLS += target -QT += widgets diff --git a/examples/widgets/tutorials/addressbook-fr/part1/part1.pro b/examples/widgets/tutorials/addressbook-fr/part1/part1.pro index b82f294ed6..aa31f122b8 100644 --- a/examples/widgets/tutorials/addressbook-fr/part1/part1.pro +++ b/examples/widgets/tutorials/addressbook-fr/part1/part1.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -7,7 +9,5 @@ QMAKE_PROJECT_NAME = abfr_part1 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part1 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part2/part2.pro b/examples/widgets/tutorials/addressbook-fr/part2/part2.pro index 1ebe545e85..bfcedda6f7 100644 --- a/examples/widgets/tutorials/addressbook-fr/part2/part2.pro +++ b/examples/widgets/tutorials/addressbook-fr/part2/part2.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -7,7 +9,5 @@ QMAKE_PROJECT_NAME = abfr_part2 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part2 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part3/part3.pro b/examples/widgets/tutorials/addressbook-fr/part3/part3.pro index 04c8417cbe..0990cb5088 100644 --- a/examples/widgets/tutorials/addressbook-fr/part3/part3.pro +++ b/examples/widgets/tutorials/addressbook-fr/part3/part3.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -7,7 +9,5 @@ QMAKE_PROJECT_NAME = abfr_part3 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part3 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part4/part4.pro b/examples/widgets/tutorials/addressbook-fr/part4/part4.pro index 02fdecf210..44ff4bdce9 100644 --- a/examples/widgets/tutorials/addressbook-fr/part4/part4.pro +++ b/examples/widgets/tutorials/addressbook-fr/part4/part4.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -7,7 +9,5 @@ QMAKE_PROJECT_NAME = abfr_part4 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part4 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part5/part5.pro b/examples/widgets/tutorials/addressbook-fr/part5/part5.pro index 20b9549037..10638759a9 100644 --- a/examples/widgets/tutorials/addressbook-fr/part5/part5.pro +++ b/examples/widgets/tutorials/addressbook-fr/part5/part5.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -9,7 +11,5 @@ QMAKE_PROJECT_NAME = abfr_part5 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part5 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part6/part6.pro b/examples/widgets/tutorials/addressbook-fr/part6/part6.pro index 098daca36a..4c7638fd70 100644 --- a/examples/widgets/tutorials/addressbook-fr/part6/part6.pro +++ b/examples/widgets/tutorials/addressbook-fr/part6/part6.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -9,7 +11,5 @@ QMAKE_PROJECT_NAME = abfr_part6 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part6 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook-fr/part7/part7.pro b/examples/widgets/tutorials/addressbook-fr/part7/part7.pro index 5c1dd33d06..6f56489979 100644 --- a/examples/widgets/tutorials/addressbook-fr/part7/part7.pro +++ b/examples/widgets/tutorials/addressbook-fr/part7/part7.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -9,7 +11,5 @@ QMAKE_PROJECT_NAME = abfr_part7 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook-fr/part7 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/addressbook.pro b/examples/widgets/tutorials/addressbook/addressbook.pro index 5dd9da5c01..d31424998e 100644 --- a/examples/widgets/tutorials/addressbook/addressbook.pro +++ b/examples/widgets/tutorials/addressbook/addressbook.pro @@ -4,5 +4,3 @@ SUBDIRS = part1 part2 part3 part4 part5 part6 part7 # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tutorials/addressbook/part1/part1.pro b/examples/widgets/tutorials/addressbook/part1/part1.pro index 82746da8e5..826ed1aa77 100644 --- a/examples/widgets/tutorials/addressbook/part1/part1.pro +++ b/examples/widgets/tutorials/addressbook/part1/part1.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -8,6 +10,4 @@ QMAKE_PROJECT_NAME = ab_part1 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part1 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part2/part2.pro b/examples/widgets/tutorials/addressbook/part2/part2.pro index 439b9185a6..0ab172872a 100644 --- a/examples/widgets/tutorials/addressbook/part2/part2.pro +++ b/examples/widgets/tutorials/addressbook/part2/part2.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -8,6 +10,4 @@ QMAKE_PROJECT_NAME = ab_part2 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part2 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part3/part3.pro b/examples/widgets/tutorials/addressbook/part3/part3.pro index fd32f00536..7863a22bf2 100644 --- a/examples/widgets/tutorials/addressbook/part3/part3.pro +++ b/examples/widgets/tutorials/addressbook/part3/part3.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -8,6 +10,4 @@ QMAKE_PROJECT_NAME = ab_part3 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part3 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part4/part4.pro b/examples/widgets/tutorials/addressbook/part4/part4.pro index c5caaa87c1..d71328bb0e 100644 --- a/examples/widgets/tutorials/addressbook/part4/part4.pro +++ b/examples/widgets/tutorials/addressbook/part4/part4.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ main.cpp HEADERS = addressbook.h @@ -8,6 +10,4 @@ QMAKE_PROJECT_NAME = ab_part4 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part4 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part5/part5.pro b/examples/widgets/tutorials/addressbook/part5/part5.pro index e779ad5024..7530900f62 100644 --- a/examples/widgets/tutorials/addressbook/part5/part5.pro +++ b/examples/widgets/tutorials/addressbook/part5/part5.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -10,6 +12,4 @@ QMAKE_PROJECT_NAME = ab_part5 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part5 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part6/part6.pro b/examples/widgets/tutorials/addressbook/part6/part6.pro index dd652985ad..88b7147a3f 100644 --- a/examples/widgets/tutorials/addressbook/part6/part6.pro +++ b/examples/widgets/tutorials/addressbook/part6/part6.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -10,6 +12,4 @@ QMAKE_PROJECT_NAME = ab_part6 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part6 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/addressbook/part7/part7.pro b/examples/widgets/tutorials/addressbook/part7/part7.pro index d63690ee11..ef435222cd 100644 --- a/examples/widgets/tutorials/addressbook/part7/part7.pro +++ b/examples/widgets/tutorials/addressbook/part7/part7.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = addressbook.cpp \ finddialog.cpp \ main.cpp @@ -10,6 +12,4 @@ QMAKE_PROJECT_NAME = ab_part7 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/addressbook/part7 INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/gettingStarted/gettingStarted.pro b/examples/widgets/tutorials/gettingStarted/gettingStarted.pro index b18e6565a6..3e37725410 100644 --- a/examples/widgets/tutorials/gettingStarted/gettingStarted.pro +++ b/examples/widgets/tutorials/gettingStarted/gettingStarted.pro @@ -1,5 +1,4 @@ TEMPLATE = subdirs SUBDIRS += dir_gsqt -QT += widgets dir_gsqt.file = gsQt/gsqt.pro diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/gsqt.pro b/examples/widgets/tutorials/gettingStarted/gsQt/gsqt.pro index 956d78aa6e..320f3c3ee4 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/gsqt.pro +++ b/examples/widgets/tutorials/gettingStarted/gsQt/gsqt.pro @@ -5,5 +5,3 @@ SUBDIRS = part1 \ part3 \ part4 \ part5 - -QT += widgets diff --git a/examples/widgets/tutorials/modelview/1_readonly/1_readonly.pro b/examples/widgets/tutorials/modelview/1_readonly/1_readonly.pro index cf066c6b31..51fcbae64d 100644 --- a/examples/widgets/tutorials/modelview/1_readonly/1_readonly.pro +++ b/examples/widgets/tutorials/modelview/1_readonly/1_readonly.pro @@ -2,6 +2,8 @@ TARGET = mv_readonly TEMPLATE = app +QT += widgets + SOURCES += main.cpp \ mymodel.cpp @@ -12,6 +14,4 @@ HEADERS += mymodel.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/1_readonly INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/2_formatting/2_formatting.pro b/examples/widgets/tutorials/modelview/2_formatting/2_formatting.pro index 057196b7c6..d5d34d6f7f 100644 --- a/examples/widgets/tutorials/modelview/2_formatting/2_formatting.pro +++ b/examples/widgets/tutorials/modelview/2_formatting/2_formatting.pro @@ -2,6 +2,8 @@ TARGET = mv_formatting TEMPLATE = app +QT += widgets + SOURCES += main.cpp \ mymodel.cpp @@ -11,6 +13,4 @@ HEADERS += mymodel.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/2_formatting INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/widgets/tutorials/modelview/3_changingmodel/3_changingmodel.pro index 92a1bbf4e5..0e7e587255 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel/3_changingmodel.pro +++ b/examples/widgets/tutorials/modelview/3_changingmodel/3_changingmodel.pro @@ -2,6 +2,8 @@ TARGET = mv_changingmodel TEMPLATE = app +QT += widgets + SOURCES += main.cpp \ mymodel.cpp @@ -11,6 +13,4 @@ HEADERS += mymodel.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/3_changingmodel INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/4_headers/4_headers.pro b/examples/widgets/tutorials/modelview/4_headers/4_headers.pro index 186ea888e0..53effe9b5b 100644 --- a/examples/widgets/tutorials/modelview/4_headers/4_headers.pro +++ b/examples/widgets/tutorials/modelview/4_headers/4_headers.pro @@ -2,6 +2,8 @@ TARGET = mv_headers TEMPLATE = app +QT += widgets + SOURCES += main.cpp \ mymodel.cpp @@ -11,6 +13,4 @@ HEADERS += mymodel.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/4_headers INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/5_edit/5_edit.pro b/examples/widgets/tutorials/modelview/5_edit/5_edit.pro index b4727580af..9a2c34f977 100644 --- a/examples/widgets/tutorials/modelview/5_edit/5_edit.pro +++ b/examples/widgets/tutorials/modelview/5_edit/5_edit.pro @@ -2,6 +2,8 @@ TARGET = mv_edit TEMPLATE = app +QT += widgets + SOURCES += main.cpp \ mainwindow.cpp \ mymodel.cpp @@ -13,6 +15,4 @@ HEADERS += mainwindow.h \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/5_edit INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/6_treeview/6_treeview.pro b/examples/widgets/tutorials/modelview/6_treeview/6_treeview.pro index af3208f9c8..4a874b205a 100644 --- a/examples/widgets/tutorials/modelview/6_treeview/6_treeview.pro +++ b/examples/widgets/tutorials/modelview/6_treeview/6_treeview.pro @@ -1,5 +1,6 @@ TARGET = mv_tree TEMPLATE = app +QT += widgets SOURCES += main.cpp \ mainwindow.cpp HEADERS += mainwindow.h @@ -8,6 +9,4 @@ HEADERS += mainwindow.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/6_treeview INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/7_selections/7_selections.pro b/examples/widgets/tutorials/modelview/7_selections/7_selections.pro index 8ab42e97ef..ef412f0aff 100644 --- a/examples/widgets/tutorials/modelview/7_selections/7_selections.pro +++ b/examples/widgets/tutorials/modelview/7_selections/7_selections.pro @@ -1,5 +1,6 @@ TARGET = mv_selections TEMPLATE = app +QT += widgets SOURCES += main.cpp \ mainwindow.cpp HEADERS += mainwindow.h @@ -8,6 +9,4 @@ HEADERS += mainwindow.h target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview/7_selections INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/modelview/modelview.pro b/examples/widgets/tutorials/modelview/modelview.pro index b21fe5afdc..9a5548aa30 100644 --- a/examples/widgets/tutorials/modelview/modelview.pro +++ b/examples/widgets/tutorials/modelview/modelview.pro @@ -10,5 +10,3 @@ SUBDIRS = 1_readonly \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/modelview INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tutorials/threads/clock/clock.pro b/examples/widgets/tutorials/threads/clock/clock.pro index 9d2687324b..041c02bea8 100644 --- a/examples/widgets/tutorials/threads/clock/clock.pro +++ b/examples/widgets/tutorials/threads/clock/clock.pro @@ -1,3 +1,4 @@ +QT += widgets CONFIG += console TEMPLATE = app SOURCES += main.cpp \ @@ -7,6 +8,3 @@ HEADERS += clockthread.h # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/clock INSTALLS += target - - -QT += widgets diff --git a/examples/widgets/tutorials/threads/movedobject/movedobject.pro b/examples/widgets/tutorials/threads/movedobject/movedobject.pro index 3bf40eb49c..b2ea7e5366 100644 --- a/examples/widgets/tutorials/threads/movedobject/movedobject.pro +++ b/examples/widgets/tutorials/threads/movedobject/movedobject.pro @@ -1,3 +1,4 @@ +QT += widgets CONFIG += console CONFIG -= app_bundle TEMPLATE = app @@ -12,5 +13,3 @@ HEADERS += \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/movedobject INSTALLS += target - -QT += widgets diff --git a/examples/widgets/tutorials/threads/threads.pro b/examples/widgets/tutorials/threads/threads.pro index a95eccaaa0..19718d760c 100644 --- a/examples/widgets/tutorials/threads/threads.pro +++ b/examples/widgets/tutorials/threads/threads.pro @@ -5,6 +5,4 @@ SUBDIRS = hellothread \ clock \ movedobject -contains(QT_CONFIG, concurrent): SUBDIRS += helloconcurrent - -QT += widgets +qtHaveModule(concurrent): SUBDIRS += helloconcurrent diff --git a/examples/widgets/tutorials/widgets/childwidget/childwidget.pro b/examples/widgets/tutorials/widgets/childwidget/childwidget.pro index 4eeab61be5..a227a68593 100644 --- a/examples/widgets/tutorials/widgets/childwidget/childwidget.pro +++ b/examples/widgets/tutorials/widgets/childwidget/childwidget.pro @@ -1,9 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/widgets/childwidget INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/nestedlayouts.pro b/examples/widgets/tutorials/widgets/nestedlayouts/nestedlayouts.pro index e362f16713..471a98121e 100644 --- a/examples/widgets/tutorials/widgets/nestedlayouts/nestedlayouts.pro +++ b/examples/widgets/tutorials/widgets/nestedlayouts/nestedlayouts.pro @@ -1,9 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/widgets/nestedlayouts INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/widgets/toplevel/toplevel.pro b/examples/widgets/tutorials/widgets/toplevel/toplevel.pro index faa91eb0dd..80e2a03ca6 100644 --- a/examples/widgets/tutorials/widgets/toplevel/toplevel.pro +++ b/examples/widgets/tutorials/widgets/toplevel/toplevel.pro @@ -1,9 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/widgets/toplevel INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/tutorials/widgets/widgets.pro b/examples/widgets/tutorials/widgets/widgets.pro index 41cfa1d7f6..4ab34a8f93 100644 --- a/examples/widgets/tutorials/widgets/widgets.pro +++ b/examples/widgets/tutorials/widgets/widgets.pro @@ -4,4 +4,3 @@ SUBDIRS = toplevel childwidget windowlayout nestedlayouts # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/widgets INSTALLS += target -QT += widgets diff --git a/examples/widgets/tutorials/widgets/windowlayout/windowlayout.pro b/examples/widgets/tutorials/widgets/windowlayout/windowlayout.pro index 6fd115591e..87eb7c58a4 100644 --- a/examples/widgets/tutorials/widgets/windowlayout/windowlayout.pro +++ b/examples/widgets/tutorials/widgets/windowlayout/windowlayout.pro @@ -1,9 +1,9 @@ +QT += widgets + SOURCES = main.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/widgets/windowlayout INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index bdac0bde28..87054cff0d 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -20,3 +20,4 @@ SUBDIRS = \ widgets contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows +contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop diff --git a/examples/widgets/widgets/analogclock/analogclock.pro b/examples/widgets/widgets/analogclock/analogclock.pro index 300c4f8ab4..1c6b736995 100644 --- a/examples/widgets/widgets/analogclock/analogclock.pro +++ b/examples/widgets/widgets/analogclock/analogclock.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = analogclock.h SOURCES = analogclock.cpp \ main.cpp @@ -7,6 +9,3 @@ QMAKE_PROJECT_NAME = widgets_analogclock # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/analogclock INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/widgets/calculator/calculator.pro b/examples/widgets/widgets/calculator/calculator.pro index 715d450003..5ee6928c7d 100644 --- a/examples/widgets/widgets/calculator/calculator.pro +++ b/examples/widgets/widgets/calculator/calculator.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = button.h \ calculator.h SOURCES = button.cpp \ @@ -7,6 +9,3 @@ SOURCES = button.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/calculator INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/widgets/calendarwidget/calendarwidget.pro index ad586f11f8..a60f10bf36 100644 --- a/examples/widgets/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/widgets/calendarwidget/calendarwidget.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -5,5 +7,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/calendarwidget INSTALLS += target - -QT += widgets diff --git a/examples/widgets/widgets/charactermap/charactermap.pro b/examples/widgets/widgets/charactermap/charactermap.pro index 370338bf46..e9b6bb7c40 100644 --- a/examples/widgets/widgets/charactermap/charactermap.pro +++ b/examples/widgets/widgets/charactermap/charactermap.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = characterwidget.h \ mainwindow.h SOURCES = characterwidget.cpp \ @@ -8,6 +10,4 @@ SOURCES = characterwidget.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/charactermap INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/codeeditor/codeeditor.pro b/examples/widgets/widgets/codeeditor/codeeditor.pro index 5af4e24322..5618160d17 100644 --- a/examples/widgets/widgets/codeeditor/codeeditor.pro +++ b/examples/widgets/widgets/codeeditor/codeeditor.pro @@ -1,9 +1,8 @@ +QT += widgets + HEADERS = codeeditor.h SOURCES = main.cpp \ codeeditor.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/codeeditor INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/widgets/digitalclock/digitalclock.pro b/examples/widgets/widgets/digitalclock/digitalclock.pro index 9ded97b48c..4e4bc0f557 100644 --- a/examples/widgets/widgets/digitalclock/digitalclock.pro +++ b/examples/widgets/widgets/digitalclock/digitalclock.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = digitalclock.h SOURCES = digitalclock.cpp \ main.cpp @@ -5,5 +7,3 @@ SOURCES = digitalclock.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/digitalclock INSTALLS += target - -QT += widgets diff --git a/examples/widgets/widgets/groupbox/groupbox.pro b/examples/widgets/widgets/groupbox/groupbox.pro index 579f0298c6..9167d26d6d 100644 --- a/examples/widgets/widgets/groupbox/groupbox.pro +++ b/examples/widgets/widgets/groupbox/groupbox.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = window.cpp \ main.cpp @@ -6,6 +8,4 @@ SOURCES = window.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/groupbox INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro index 4227cedadd..7a5256bcac 100644 --- a/examples/widgets/widgets/icons/icons.pro +++ b/examples/widgets/widgets/icons/icons.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = iconpreviewarea.h \ iconsizespinbox.h \ imagedelegate.h \ @@ -24,6 +26,5 @@ wince*: { } DEPLOYMENT += imageFiles } -QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/imageviewer/imageviewer.pro b/examples/widgets/widgets/imageviewer/imageviewer.pro index 611848b093..a0f9cebbda 100644 --- a/examples/widgets/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/widgets/imageviewer/imageviewer.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + HEADERS = imageviewer.h SOURCES = imageviewer.cpp \ main.cpp @@ -10,7 +13,5 @@ INSTALLS += target wince*: { DEPLOYMENT_PLUGIN += qjpeg qgif } -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/lineedits/lineedits.pro b/examples/widgets/widgets/lineedits/lineedits.pro index d8ac14102f..0ab994ea11 100644 --- a/examples/widgets/widgets/lineedits/lineedits.pro +++ b/examples/widgets/widgets/lineedits/lineedits.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -5,5 +7,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/lineedits INSTALLS += target - -QT += widgets diff --git a/examples/widgets/widgets/mousebuttons/buttontester.cpp b/examples/widgets/widgets/mousebuttons/buttontester.cpp index 64910375dc..c64bf76211 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.cpp +++ b/examples/widgets/widgets/mousebuttons/buttontester.cpp @@ -44,30 +44,40 @@ void ButtonTester::mousePressEvent(QMouseEvent *e) { int j = ButtonTester::buttonByNumber (e->button()); - QString result = "Mouse Press: raw button=" + QString::number(j) + " Qt=" + enumNameFromValue(e->button()); + QString result = "Mouse Press: raw button=" + QString::number(j) + + " Qt=" + enumNameFromValue(e->button()); + QString buttonsString = ButtonTester::enumNamesFromMouseButtons(e->buttons()); + result += "\n heldbuttons " + buttonsString; qDebug() << result; this->setText(result); - if (j == 2) { - this->repaint(); - } + this->repaint(); } void ButtonTester::mouseReleaseEvent(QMouseEvent *e) { int j = ButtonTester::buttonByNumber (e->button()); - QString result = "Mouse Release: raw button=" + QString::number(j) + " Qt=" + enumNameFromValue(e->button()); + QString result = "Mouse Release: raw button=" + QString::number(j) + + " Qt=" + enumNameFromValue(e->button()); + QString buttonsString = ButtonTester::enumNamesFromMouseButtons(e->buttons()); + result += "\n heldbuttons " + buttonsString; qDebug() << result; this->setText(result); + this->repaint(); + } void ButtonTester::mouseDoubleClickEvent(QMouseEvent *e) { int j = ButtonTester::buttonByNumber (e->button()); - QString result = "Mouse DoubleClick: raw button=" + QString::number(j) + " Qt=" + enumNameFromValue(e->button()); + QString result = "Mouse DoubleClick: raw button=" + QString::number(j) + + " Qt=" + enumNameFromValue(e->button()); + QString buttonsString = ButtonTester::enumNamesFromMouseButtons(e->buttons()); + result += "\n heldbuttons" + buttonsString; qDebug() << result; this->setText(result); } +#ifndef QT_NO_WHEELEVENT void ButtonTester::wheelEvent (QWheelEvent *e) { QString result; @@ -88,6 +98,7 @@ void ButtonTester::wheelEvent (QWheelEvent *e) qDebug() << result; this->setText(result); } +#endif int ButtonTester::buttonByNumber(const Qt::MouseButton button) { @@ -170,3 +181,38 @@ QString ButtonTester::enumNameFromValue(const Qt::MouseButton button) qDebug("QMouseShortcutEntry::addShortcut contained Invalid Qt::MouseButton value"); return "NoButton"; } + +QString ButtonTester::enumNamesFromMouseButtons(const Qt::MouseButtons buttons) +{ + QString returnText = ""; + if (buttons == Qt::NoButton) return "NoButton"; + if (buttons & Qt::LeftButton) returnText += "LeftButton "; + if (buttons & Qt::RightButton) returnText += "RightButton "; + if (buttons & Qt::MiddleButton) returnText += "MiddleButton "; + if (buttons & Qt::BackButton) returnText += "BackButton "; + if (buttons & Qt::ForwardButton) returnText += "ForwardButton "; + if (buttons & Qt::TaskButton) returnText += "TaskButton "; + if (buttons & Qt::ExtraButton4) returnText += "ExtraButton4 "; + if (buttons & Qt::ExtraButton5) returnText += "ExtraButton5 "; + if (buttons & Qt::ExtraButton6) returnText += "ExtraButton6 "; + if (buttons & Qt::ExtraButton7) returnText += "ExtraButton7 "; + if (buttons & Qt::ExtraButton8) returnText += "ExtraButton8 "; + if (buttons & Qt::ExtraButton9) returnText += "ExtraButton9 "; + if (buttons & Qt::ExtraButton10) returnText += "ExtraButton10 "; + if (buttons & Qt::ExtraButton11) returnText += "ExtraButton11 "; + if (buttons & Qt::ExtraButton12) returnText += "ExtraButton12 "; + if (buttons & Qt::ExtraButton13) returnText += "ExtraButton13 "; + if (buttons & Qt::ExtraButton14) returnText += "ExtraButton14 "; + if (buttons & Qt::ExtraButton15) returnText += "ExtraButton15 "; + if (buttons & Qt::ExtraButton16) returnText += "ExtraButton16 "; + if (buttons & Qt::ExtraButton17) returnText += "ExtraButton17 "; + if (buttons & Qt::ExtraButton18) returnText += "ExtraButton18 "; + if (buttons & Qt::ExtraButton19) returnText += "ExtraButton19 "; + if (buttons & Qt::ExtraButton20) returnText += "ExtraButton20 "; + if (buttons & Qt::ExtraButton21) returnText += "ExtraButton21 "; + if (buttons & Qt::ExtraButton22) returnText += "ExtraButton22 "; + if (buttons & Qt::ExtraButton23) returnText += "ExtraButton23 "; + if (buttons & Qt::ExtraButton24) returnText += "ExtraButton24 "; + return returnText; +} + diff --git a/examples/widgets/widgets/mousebuttons/buttontester.h b/examples/widgets/widgets/mousebuttons/buttontester.h index bb1a7b0335..6db8993486 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.h +++ b/examples/widgets/widgets/mousebuttons/buttontester.h @@ -56,9 +56,12 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent * event); +#endif int buttonByNumber(const Qt::MouseButton button); QString enumNameFromValue(const Qt::MouseButton button); + QString enumNamesFromMouseButtons(const Qt::MouseButtons buttons); }; #endif // BUTTONTESTER_H diff --git a/examples/widgets/widgets/mousebuttons/main.cpp b/examples/widgets/widgets/mousebuttons/main.cpp index 67bbbb8896..1692ac5432 100644 --- a/examples/widgets/widgets/mousebuttons/main.cpp +++ b/examples/widgets/widgets/mousebuttons/main.cpp @@ -48,6 +48,10 @@ int main(int argv, char **args) ButtonTester *testArea = new ButtonTester; testArea->setMinimumSize(500, 350); + +// For this test, Qt::RightButton behaves like any other button. + testArea->setContextMenuPolicy(Qt::NoContextMenu); + testArea->setTextInteractionFlags(Qt::TextSelectableByMouse); testArea->setText("To test your mouse with Qt, press buttons in this area.\nYou may also scroll or tilt your mouse wheel."); QPushButton *quitButton = new QPushButton("Quit"); diff --git a/examples/widgets/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro index d922423373..109e9f411d 100644 --- a/examples/widgets/widgets/movie/movie.pro +++ b/examples/widgets/widgets/movie/movie.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = movieplayer.h SOURCES = main.cpp \ movieplayer.cpp @@ -15,6 +17,4 @@ wince*: { DEPLOYMENT += addFiles } -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/scribble/scribble.pro b/examples/widgets/widgets/scribble/scribble.pro index 674dccff7e..aff0fb442c 100644 --- a/examples/widgets/widgets/scribble/scribble.pro +++ b/examples/widgets/widgets/scribble/scribble.pro @@ -1,3 +1,6 @@ +QT += widgets +qtHaveModule(printsupport): QT += printsupport + HEADERS = mainwindow.h \ scribblearea.h SOURCES = main.cpp \ @@ -7,6 +10,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/scribble INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/widgets/shapedclock/shapedclock.pro b/examples/widgets/widgets/shapedclock/shapedclock.pro index b5cb9c9076..0fe7f59765 100644 --- a/examples/widgets/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/widgets/shapedclock/shapedclock.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = shapedclock.h SOURCES = shapedclock.cpp \ main.cpp @@ -5,6 +7,3 @@ SOURCES = shapedclock.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/shapedclock INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/widgets/sliders/sliders.pro b/examples/widgets/widgets/sliders/sliders.pro index bdc30b896c..6a0e01287d 100644 --- a/examples/widgets/widgets/sliders/sliders.pro +++ b/examples/widgets/widgets/sliders/sliders.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = slidersgroup.h \ window.h SOURCES = main.cpp \ @@ -8,6 +10,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/sliders INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/spinboxes/spinboxes.pro b/examples/widgets/widgets/spinboxes/spinboxes.pro index 55a028c0a5..9638317471 100644 --- a/examples/widgets/widgets/spinboxes/spinboxes.pro +++ b/examples/widgets/widgets/spinboxes/spinboxes.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = window.h SOURCES = main.cpp \ window.cpp @@ -6,6 +8,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/spinboxes INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/styles/styles.pro b/examples/widgets/widgets/styles/styles.pro index f93175997f..598dceef65 100644 --- a/examples/widgets/widgets/styles/styles.pro +++ b/examples/widgets/widgets/styles/styles.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = norwegianwoodstyle.h \ widgetgallery.h SOURCES = main.cpp \ @@ -11,6 +13,4 @@ REQUIRES += "contains(styles, windows)" target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/styles INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/stylesheet/stylesheet.pro b/examples/widgets/widgets/stylesheet/stylesheet.pro index 24590ab3dc..01edb0bbd8 100644 --- a/examples/widgets/widgets/stylesheet/stylesheet.pro +++ b/examples/widgets/widgets/stylesheet/stylesheet.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ stylesheeteditor.h FORMS = mainwindow.ui \ @@ -11,6 +13,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/stylesheet INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/tablet/tablet.pro b/examples/widgets/widgets/tablet/tablet.pro index 2e74cb847b..6867f92ac8 100644 --- a/examples/widgets/widgets/tablet/tablet.pro +++ b/examples/widgets/widgets/tablet/tablet.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mainwindow.h \ tabletcanvas.h \ tabletapplication.h @@ -10,6 +12,4 @@ SOURCES = mainwindow.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/tablet INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/widgets/widgets/tetrix/tetrix.pro b/examples/widgets/widgets/tetrix/tetrix.pro index 5dd5342885..bb9f855fb0 100644 --- a/examples/widgets/widgets/tetrix/tetrix.pro +++ b/examples/widgets/widgets/tetrix/tetrix.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = tetrixboard.h \ tetrixpiece.h \ tetrixwindow.h @@ -9,6 +11,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/tetrix INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/widgets/tooltips/tooltips.pro b/examples/widgets/widgets/tooltips/tooltips.pro index 7262a1aece..d14b8295ba 100644 --- a/examples/widgets/widgets/tooltips/tooltips.pro +++ b/examples/widgets/widgets/tooltips/tooltips.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = shapeitem.h \ sortingbox.h SOURCES = main.cpp \ @@ -8,5 +10,3 @@ RESOURCES = tooltips.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/tooltips INSTALLS += target - -QT += widgets diff --git a/examples/widgets/widgets/wiggly/wiggly.pro b/examples/widgets/widgets/wiggly/wiggly.pro index 17371603dc..0e39f18add 100644 --- a/examples/widgets/widgets/wiggly/wiggly.pro +++ b/examples/widgets/widgets/wiggly/wiggly.pro @@ -1,4 +1,4 @@ -QT += widgets widgets +QT += widgets HEADERS = wigglywidget.h \ dialog.h diff --git a/examples/widgets/widgets/windowflags/windowflags.pro b/examples/widgets/widgets/windowflags/windowflags.pro index e96344c33d..250319983a 100644 --- a/examples/widgets/widgets/windowflags/windowflags.pro +++ b/examples/widgets/widgets/windowflags/windowflags.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = controllerwindow.h \ previewwindow.h SOURCES = controllerwindow.cpp \ @@ -8,6 +10,4 @@ SOURCES = controllerwindow.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/windowflags INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) |