From b2cc13d95aa04a48e67c3bbe9639b379ee161230 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 3 Dec 2012 15:11:51 +0100 Subject: Tag dialog examples and create dialog examples group Change-Id: I0049b841dd5aee806e8aed36af069b0507e3c9f1 Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/widgets/doc/src/classwizard.qdoc | 1 + examples/widgets/doc/src/configdialog.qdoc | 1 + examples/widgets/doc/src/extension.qdoc | 1 + examples/widgets/doc/src/findfiles.qdoc | 1 + examples/widgets/doc/src/licensewizard.qdoc | 1 + examples/widgets/doc/src/standarddialogs.qdoc | 1 + examples/widgets/doc/src/tabdialog.qdoc | 1 + examples/widgets/doc/src/trivialwizard.qdoc | 1 + 8 files changed, 8 insertions(+) (limited to 'examples') 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/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/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/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/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/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/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 -- cgit v1.2.3 From 36d12783c9f8eee133f9ab634f6b54e8a3cd75d4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 30 Nov 2012 16:31:06 +0100 Subject: Fix linking of itemviews and graphicsview examples Change-Id: I6905cc6945e2eb396108f9fb16da042e576e3afb Reviewed-by: Gunnar Sletta --- .../widgets/doc/images/itemviews-editabletreemodel.png | Bin 0 -> 32534 bytes examples/widgets/doc/src/addressbook.qdoc | 2 +- examples/widgets/doc/src/basicgraphicslayouts.qdoc | 2 ++ examples/widgets/doc/src/basicsortfiltermodel.qdoc | 2 +- examples/widgets/doc/src/boxes.qdoc | 2 +- examples/widgets/doc/src/chart.qdoc | 2 +- examples/widgets/doc/src/chip.qdoc | 6 ++++-- examples/widgets/doc/src/coloreditorfactory.qdoc | 2 +- examples/widgets/doc/src/combowidgetmapper.qdoc | 2 +- examples/widgets/doc/src/customsortfiltermodel.qdoc | 2 +- examples/widgets/doc/src/diagramscene.qdoc | 2 +- examples/widgets/doc/src/dirview.qdoc | 2 ++ examples/widgets/doc/src/dragdroprobot.qdoc | 2 +- examples/widgets/doc/src/editabletreemodel.qdoc | 2 +- examples/widgets/doc/src/elasticnodes.qdoc | 6 ++++-- examples/widgets/doc/src/embeddeddialogs.qdoc | 6 ++++-- examples/widgets/doc/src/fetchmore.qdoc | 2 +- examples/widgets/doc/src/frozencolumn.qdoc | 2 +- examples/widgets/doc/src/interview.qdoc | 2 ++ examples/widgets/doc/src/itemviewspuzzle.qdoc | 2 +- examples/widgets/doc/src/padnavigator.qdoc | 2 +- examples/widgets/doc/src/pixelator.qdoc | 2 +- examples/widgets/doc/src/simpledommodel.qdoc | 2 +- examples/widgets/doc/src/simpletreemodel.qdoc | 3 +++ examples/widgets/doc/src/simplewidgetmapper.qdoc | 2 +- examples/widgets/doc/src/spinboxdelegate.qdoc | 2 +- examples/widgets/doc/src/spreadsheet.qdoc | 2 ++ examples/widgets/doc/src/stardelegate.qdoc | 2 +- 28 files changed, 42 insertions(+), 25 deletions(-) create mode 100644 examples/widgets/doc/images/itemviews-editabletreemodel.png (limited to 'examples') diff --git a/examples/widgets/doc/images/itemviews-editabletreemodel.png b/examples/widgets/doc/images/itemviews-editabletreemodel.png new file mode 100644 index 0000000000..a151ea857f Binary files /dev/null and b/examples/widgets/doc/images/itemviews-editabletreemodel.png differ 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/basicgraphicslayouts.qdoc b/examples/widgets/doc/src/basicgraphicslayouts.qdoc index 36ce914018..868943370c 100644 --- a/examples/widgets/doc/src/basicgraphicslayouts.qdoc +++ b/examples/widgets/doc/src/basicgraphicslayouts.qdoc @@ -28,6 +28,8 @@ /*! \example graphicsview/basicgraphicslayouts \title Basic Graphics Layouts Example + \ingroup examples-graphicsview + \brief This example shows how to use some basic layouts. \brief The Basic Graphics Layouts example shows how to use the layout classes in QGraphicsView: QGraphicsLinearLayout and QGraphicsGridLayout. 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/boxes.qdoc b/examples/widgets/doc/src/boxes.qdoc index 96238f1efd..b3ed1f68c8 100644 --- a/examples/widgets/doc/src/boxes.qdoc +++ b/examples/widgets/doc/src/boxes.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/boxes \title Boxes - + \ingroup examples-graphicsview \brief This demo shows Qt's ability to combine advanced OpenGL rendering with the the \l{Graphics View Framework}. 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..e3adb26ced 100644 --- a/examples/widgets/doc/src/chip.qdoc +++ b/examples/widgets/doc/src/chip.qdoc @@ -28,9 +28,11 @@ /*! \example graphicsview/chip \title 40000 Chips - + \ingroup examples-graphicsview \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 + using Graphics View. + + It also shows 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/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/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..55043df475 100644 --- a/examples/widgets/doc/src/diagramscene.qdoc +++ b/examples/widgets/doc/src/diagramscene.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/diagramscene \title Diagram Scene Example - + \ingroup examples-graphicsview \brief This example shows use of Qt's graphics 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/dragdroprobot.qdoc b/examples/widgets/doc/src/dragdroprobot.qdoc index cc5e6bd07d..8187cbfd46 100644 --- a/examples/widgets/doc/src/dragdroprobot.qdoc +++ b/examples/widgets/doc/src/dragdroprobot.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/dragdroprobot \title Drag and Drop Robot Example - + \ingroup examples-graphicsview \brief 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..75ad496592 100644 --- a/examples/widgets/doc/src/elasticnodes.qdoc +++ b/examples/widgets/doc/src/elasticnodes.qdoc @@ -28,9 +28,11 @@ /*! \example graphicsview/elasticnodes \title Elastic Nodes Example - + \ingroup examples-graphicsview \brief 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 + 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; as you zoom in, the graphics remain crisp. diff --git a/examples/widgets/doc/src/embeddeddialogs.qdoc b/examples/widgets/doc/src/embeddeddialogs.qdoc index 878bb9f54a..964150ff0f 100644 --- a/examples/widgets/doc/src/embeddeddialogs.qdoc +++ b/examples/widgets/doc/src/embeddeddialogs.qdoc @@ -28,9 +28,11 @@ /*! \example graphicsview/embeddeddialogs \title Embedded Dialogs - + \ingroup examples-graphicsview \brief This example shows how to embed standard dialogs into - Graphics View. It also shows how you can customize the + Graphics View. + + It also shows how you can customize the proxy class and add window shadows. \image embeddeddialogs-demo.png 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/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/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/padnavigator.qdoc b/examples/widgets/doc/src/padnavigator.qdoc index b063d6de59..90c7c00952 100644 --- a/examples/widgets/doc/src/padnavigator.qdoc +++ b/examples/widgets/doc/src/padnavigator.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/padnavigator \title Pad Navigator Example - + \ingroup examples-graphicsview \brief 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/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/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. -- cgit v1.2.3 From a800228fdaa3111df71a70086a3fc3b0e9866157 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 3 Dec 2012 16:43:45 +0100 Subject: Moved the mainwindow examples from qtdoc Change-Id: I5a11933e86c6c71f68a55e45c7bcfdfc702bf4e6 Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/widgets/doc/src/application.qdoc | 1 + examples/widgets/doc/src/dockwidgets.qdoc | 1 + examples/widgets/doc/src/mainwindow.qdoc | 1 + examples/widgets/doc/src/mdi.qdoc | 1 + examples/widgets/doc/src/menus.qdoc | 1 + examples/widgets/doc/src/recentfiles.qdoc | 1 + examples/widgets/doc/src/sdi.qdoc | 1 + 7 files changed, 7 insertions(+) (limited to 'examples') 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/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/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/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. -- cgit v1.2.3 From 0f8b7deef1e6d2b0d24f83c12c3ce11ed0fc0640 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 4 Dec 2012 14:06:35 +0100 Subject: Move Network Examples from qtdoc to qtbase Move the main example overview and use the \group tag convention to make the list update automatically. Change-Id: Ib2cc8cf7def9a7f3dce6b7ed6d4958771cbdf5cd Reviewed-by: Jerome Pasion Reviewed-by: Paul Olav Tvete --- examples/network/doc/src/blockingfortuneclient.qdoc | 1 + examples/network/doc/src/broadcastreceiver.qdoc | 1 + examples/network/doc/src/broadcastsender.qdoc | 1 + examples/network/doc/src/fortuneclient.qdoc | 1 + examples/network/doc/src/fortuneserver.qdoc | 1 + examples/network/doc/src/googlesuggest.qdoc | 1 + examples/network/doc/src/http.qdoc | 1 + examples/network/doc/src/loopback.qdoc | 1 + examples/network/doc/src/multicastreceiver.qdoc | 1 + examples/network/doc/src/multicastsender.qdoc | 1 + examples/network/doc/src/network-chat.qdoc | 1 + examples/network/doc/src/securesocketclient.qdoc | 1 + examples/network/doc/src/threadedfortuneserver.qdoc | 1 + examples/network/doc/src/torrent.qdoc | 1 + 14 files changed, 14 insertions(+) (limited to 'examples') diff --git a/examples/network/doc/src/blockingfortuneclient.qdoc b/examples/network/doc/src/blockingfortuneclient.qdoc index 581cbe6699..4e105b50a7 100644 --- a/examples/network/doc/src/blockingfortuneclient.qdoc +++ b/examples/network/doc/src/blockingfortuneclient.qdoc @@ -28,6 +28,7 @@ /*! \example blockingfortuneclient \title Blocking Fortune Client Example + \ingroup examples-network \brief The Blocking Fortune Client example shows how to create a client for a network service using QTcpSocket's synchronous API in a non-GUI thread. diff --git a/examples/network/doc/src/broadcastreceiver.qdoc b/examples/network/doc/src/broadcastreceiver.qdoc index 99a4cd3823..374bc29244 100644 --- a/examples/network/doc/src/broadcastreceiver.qdoc +++ b/examples/network/doc/src/broadcastreceiver.qdoc @@ -28,6 +28,7 @@ /*! \example broadcastreceiver \title Broadcast Receiver Example + \ingroup examples-network \brief The Broadcast Receiver example shows how to receive information that is broadcasted over a local network. diff --git a/examples/network/doc/src/broadcastsender.qdoc b/examples/network/doc/src/broadcastsender.qdoc index dc916e3fed..a587c5fddd 100644 --- a/examples/network/doc/src/broadcastsender.qdoc +++ b/examples/network/doc/src/broadcastsender.qdoc @@ -28,6 +28,7 @@ /*! \example broadcastsender \title Broadcast Sender Example + \ingroup examples-network \brief The Broadcast Sender example shows how to broadcast information to multiple clients on a local network. diff --git a/examples/network/doc/src/fortuneclient.qdoc b/examples/network/doc/src/fortuneclient.qdoc index 6ef9155337..f7a4c56020 100644 --- a/examples/network/doc/src/fortuneclient.qdoc +++ b/examples/network/doc/src/fortuneclient.qdoc @@ -28,6 +28,7 @@ /*! \example fortuneclient \title Fortune Client Example + \ingroup examples-network \brief The Fortune Client example shows how to create a client for a simple network service using QTcpSocket. It is intended to be run alongside the diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc index 05e96b4ded..d702bc6bb1 100644 --- a/examples/network/doc/src/fortuneserver.qdoc +++ b/examples/network/doc/src/fortuneserver.qdoc @@ -28,6 +28,7 @@ /*! \example fortuneserver \title Fortune Server Example + \ingroup examples-network \brief The Fortune Server example shows how to create a server for a simple network service. It is intended to be run alongside the diff --git a/examples/network/doc/src/googlesuggest.qdoc b/examples/network/doc/src/googlesuggest.qdoc index ff16cbf9e0..c04e65c3f9 100644 --- a/examples/network/doc/src/googlesuggest.qdoc +++ b/examples/network/doc/src/googlesuggest.qdoc @@ -28,6 +28,7 @@ /*! \example googlesuggest \title Google Suggest Example + \ingroup examples-network \brief The Google Suggest example demonstrates how to use the QNetworkAccessManager class to obtain a list of suggestions from the Google search engine as the diff --git a/examples/network/doc/src/http.qdoc b/examples/network/doc/src/http.qdoc index 67bdbdb558..89223b7894 100644 --- a/examples/network/doc/src/http.qdoc +++ b/examples/network/doc/src/http.qdoc @@ -28,6 +28,7 @@ /*! \example http \title HTTP Example + \ingroup examples-network \brief The HTTP example demonstrates a simple HTTP client that shows how to fetch files specified by URLs from remote hosts. diff --git a/examples/network/doc/src/loopback.qdoc b/examples/network/doc/src/loopback.qdoc index 52518a0028..e278a9e9bd 100644 --- a/examples/network/doc/src/loopback.qdoc +++ b/examples/network/doc/src/loopback.qdoc @@ -28,6 +28,7 @@ /*! \example loopback \title Loopback Example + \ingroup examples-network \brief The Loopback example shows how to communicate between simple clients and servers on a local host. diff --git a/examples/network/doc/src/multicastreceiver.qdoc b/examples/network/doc/src/multicastreceiver.qdoc index fddbafe788..88ed6020d4 100644 --- a/examples/network/doc/src/multicastreceiver.qdoc +++ b/examples/network/doc/src/multicastreceiver.qdoc @@ -28,6 +28,7 @@ /*! \example multicastreceiver \title Multicast Receiver Example + \ingroup examples-network \brief The Multicast Receiever example shows how to receive information that is sent to a multicast group. diff --git a/examples/network/doc/src/multicastsender.qdoc b/examples/network/doc/src/multicastsender.qdoc index 8d8a400769..4ec9defb53 100644 --- a/examples/network/doc/src/multicastsender.qdoc +++ b/examples/network/doc/src/multicastsender.qdoc @@ -28,6 +28,7 @@ /*! \example multicastsender \title Multicast Sender Example + \ingroup examples-network \brief The Multicast Sender example shows how to send information to multiple clients in a multicast group. diff --git a/examples/network/doc/src/network-chat.qdoc b/examples/network/doc/src/network-chat.qdoc index 0430b5219d..cd5ec4b348 100644 --- a/examples/network/doc/src/network-chat.qdoc +++ b/examples/network/doc/src/network-chat.qdoc @@ -28,6 +28,7 @@ /*! \example network-chat \title Network Chat Example + \ingroup examples-network \brief The Network Chat example demonstrates a stateful peer-to-peer Chat client that uses broadcasting with QUdpSocket and QNetworkInterface to discover diff --git a/examples/network/doc/src/securesocketclient.qdoc b/examples/network/doc/src/securesocketclient.qdoc index 16986292af..a61a00e833 100644 --- a/examples/network/doc/src/securesocketclient.qdoc +++ b/examples/network/doc/src/securesocketclient.qdoc @@ -28,6 +28,7 @@ /*! \example securesocketclient \title Secure Socket Client Example + \ingroup examples-network \brief The Secure Socket Client example shows how to use QSslSocket to communicate over an encrypted (SSL) connection. It also demonstrates how diff --git a/examples/network/doc/src/threadedfortuneserver.qdoc b/examples/network/doc/src/threadedfortuneserver.qdoc index f8441bcc2f..43a7e88241 100644 --- a/examples/network/doc/src/threadedfortuneserver.qdoc +++ b/examples/network/doc/src/threadedfortuneserver.qdoc @@ -28,6 +28,7 @@ /*! \example threadedfortuneserver \title Threaded Fortune Server Example + \ingroup examples-network \brief The Threaded Fortune Server example shows how to create a server for a simple network service that uses threads to handle requests from different diff --git a/examples/network/doc/src/torrent.qdoc b/examples/network/doc/src/torrent.qdoc index ef13ef6ed9..791464c9a4 100644 --- a/examples/network/doc/src/torrent.qdoc +++ b/examples/network/doc/src/torrent.qdoc @@ -28,6 +28,7 @@ /*! \example torrent \title Torrent Example + \ingroup examples-network \brief The Torrent example is a functional BitTorrent client that illustrates how to write a complex TCP/IP application using Qt. -- cgit v1.2.3 From 422b8dd24ec99caed2a22735f53ffbef110a35ad Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 5 Dec 2012 11:43:14 +0100 Subject: Fix compile with -DQT_NO_DRAGANDDROP Change-Id: Ic7b42ae164f913f270c8350c2de6ce35f0be8c2a Reviewed-by: David Faure --- examples/network/torrent/mainwindow.cpp | 6 ++++++ examples/widgets/itemviews/itemviews.pro | 1 + examples/widgets/widgets.pro | 1 + 3 files changed, 8 insertions(+) (limited to 'examples') diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp index 1b10241f6e..b574429808 100644 --- a/examples/network/torrent/mainwindow.cpp +++ b/examples/network/torrent/mainwindow.cpp @@ -52,12 +52,14 @@ class TorrentView : public QTreeWidget public: TorrentView(QWidget *parent = 0); +#ifndef QT_NO_DRAGANDDROP signals: void fileDropped(const QString &fileName); protected: void dragMoveEvent(QDragMoveEvent *event); void dropEvent(QDropEvent *event); +#endif }; // TorrentViewDelegate is used to draw the progress bars. @@ -688,9 +690,12 @@ void MainWindow::closeEvent(QCloseEvent *) TorrentView::TorrentView(QWidget *parent) : QTreeWidget(parent) { +#ifndef QT_NO_DRAGANDDROP setAcceptDrops(true); +#endif } +#ifndef QT_NO_DRAGANDDROP void TorrentView::dragMoveEvent(QDragMoveEvent *event) { // Accept file actions with a '.torrent' extension. @@ -708,5 +713,6 @@ void TorrentView::dropEvent(QDropEvent *event) if (QFile::exists(fileName) && fileName.toLower().endsWith(".torrent")) emit fileDropped(fileName); } +#endif #include "mainwindow.moc" diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro index 60512e2b66..4109e002b6 100644 --- a/examples/widgets/itemviews/itemviews.pro +++ b/examples/widgets/itemviews/itemviews.pro @@ -20,3 +20,4 @@ SUBDIRS = addressbook \ stardelegate QT += widgets +contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle 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 -- cgit v1.2.3 From f775f6dd887e1744816d1320fd50092df93f0371 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sun, 2 Dec 2012 22:53:25 +0100 Subject: Fix compile with -DQT_NO_WHEELEVENT Change-Id: Icc345e2a361fc233d7debfa88bef2a3a8375fa8f Reviewed-by: David Faure --- examples/threads/mandelbrot/mandelbrotwidget.cpp | 2 ++ examples/threads/mandelbrot/mandelbrotwidget.h | 2 ++ examples/widgets/graphicsview/chip/view.cpp | 2 ++ examples/widgets/graphicsview/chip/view.h | 2 ++ examples/widgets/graphicsview/elasticnodes/graphwidget.cpp | 2 ++ examples/widgets/graphicsview/elasticnodes/graphwidget.h | 2 ++ examples/widgets/painting/affine/xform.cpp | 2 ++ examples/widgets/painting/affine/xform.h | 2 ++ examples/widgets/widgets/mousebuttons/buttontester.cpp | 2 ++ examples/widgets/widgets/mousebuttons/buttontester.h | 2 ++ 10 files changed, 20 insertions(+) (limited to 'examples') diff --git a/examples/threads/mandelbrot/mandelbrotwidget.cpp b/examples/threads/mandelbrot/mandelbrotwidget.cpp index c1ec029548..3a10a7a726 100644 --- a/examples/threads/mandelbrot/mandelbrotwidget.cpp +++ b/examples/threads/mandelbrot/mandelbrotwidget.cpp @@ -162,6 +162,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event) } //! [11] +#ifndef QT_NO_WHEELEVENT //! [12] void MandelbrotWidget::wheelEvent(QWheelEvent *event) { @@ -170,6 +171,7 @@ void MandelbrotWidget::wheelEvent(QWheelEvent *event) zoom(pow(ZoomInFactor, numSteps)); } //! [12] +#endif //! [13] void MandelbrotWidget::mousePressEvent(QMouseEvent *event) diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h index ea5fdc53c1..238a2bdca1 100644 --- a/examples/threads/mandelbrot/mandelbrotwidget.h +++ b/examples/threads/mandelbrot/mandelbrotwidget.h @@ -58,7 +58,9 @@ protected: void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent *event); void keyPressEvent(QKeyEvent *event); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *event); +#endif void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); 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 +#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/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/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/widgets/mousebuttons/buttontester.cpp b/examples/widgets/widgets/mousebuttons/buttontester.cpp index 64910375dc..9a631b9fa2 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.cpp +++ b/examples/widgets/widgets/mousebuttons/buttontester.cpp @@ -68,6 +68,7 @@ void ButtonTester::mouseDoubleClickEvent(QMouseEvent *e) this->setText(result); } +#ifndef QT_NO_WHEELEVENT void ButtonTester::wheelEvent (QWheelEvent *e) { QString result; @@ -88,6 +89,7 @@ void ButtonTester::wheelEvent (QWheelEvent *e) qDebug() << result; this->setText(result); } +#endif int ButtonTester::buttonByNumber(const Qt::MouseButton button) { diff --git a/examples/widgets/widgets/mousebuttons/buttontester.h b/examples/widgets/widgets/mousebuttons/buttontester.h index bb1a7b0335..2f8db560f4 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.h +++ b/examples/widgets/widgets/mousebuttons/buttontester.h @@ -56,7 +56,9 @@ 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); }; -- cgit v1.2.3 From 4519d810d1d2be3af17bdd77edac2361620f9d2d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 5 Dec 2012 13:46:03 +0100 Subject: Doc: Fix some more links Change-Id: I94c853532cd3ed9bf18e6d471f99560e04131fdf Reviewed-by: Jerome Pasion --- examples/widgets/doc/src/fridgemagnets.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') 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 -- cgit v1.2.3 From 52aad26ceee8287fa56089e459868c0f69fa94f9 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 4 Dec 2012 17:57:27 +0100 Subject: Doc: Added documentation for the collidingmice example Task-number: QTBUG-27515 Change-Id: I1bc11d381c0ea8f6ef7ea32093d7e981ca9db91e Reviewed-by: Jerome Pasion --- .../widgets/doc/images/collidingmice-example.png | Bin 0 -> 59824 bytes .../widgets/doc/src/collidingmice-example.qdoc | 271 +++++++++++++++++++++ 2 files changed, 271 insertions(+) create mode 100644 examples/widgets/doc/images/collidingmice-example.png create mode 100644 examples/widgets/doc/src/collidingmice-example.qdoc (limited to 'examples') diff --git a/examples/widgets/doc/images/collidingmice-example.png b/examples/widgets/doc/images/collidingmice-example.png new file mode 100644 index 0000000000..41561de394 Binary files /dev/null and b/examples/widgets/doc/images/collidingmice-example.png differ diff --git a/examples/widgets/doc/src/collidingmice-example.qdoc b/examples/widgets/doc/src/collidingmice-example.qdoc new file mode 100644 index 0000000000..3994d75c2b --- /dev/null +++ b/examples/widgets/doc/src/collidingmice-example.qdoc @@ -0,0 +1,271 @@ +/**************************************************************************** +** +** 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 + + 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. +*/ -- cgit v1.2.3 From 328df640f39906e4af17d5b8aca888289c3535ba Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 5 Dec 2012 14:40:38 +0100 Subject: Fix compile with -DQT_NO_TRANSLATION Change-Id: Ia6929f871485476e8b5bb14e7bf8117d0c562841 Reviewed-by: David Faure --- examples/examples.pro | 1 + examples/widgets/dialogs/classwizard/main.cpp | 2 ++ examples/widgets/dialogs/licensewizard/main.cpp | 4 +++- examples/widgets/dialogs/standarddialogs/main.cpp | 2 ++ examples/widgets/dialogs/trivialwizard/trivialwizard.cpp | 3 ++- examples/widgets/tools/tools.pro | 2 ++ 6 files changed, 12 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/examples.pro b/examples/examples.pro index 7c149ff7ac..db444b5d12 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -24,3 +24,4 @@ contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl contains(QT_CONFIG, dbus): SUBDIRS += dbus contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent +contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= linguist 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/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/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/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/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 -- cgit v1.2.3 From 22e3111127d31cc6440f1a13833205a72c9c4ab6 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 6 Dec 2012 10:33:23 +0100 Subject: Fix reference to example paths This eliminates seven EXAMPLE PATH DOES NOT EXIST warnings. Change-Id: Iaa6267138a1799fb775f0034805d5691bfa40d7c Reviewed-by: Christian Stenger Reviewed-by: Jerome Pasion --- examples/gui/doc/analogclockwindow.qdoc | 2 +- examples/gui/doc/openglwindow.qdoc | 2 +- examples/gui/doc/rasterwindow.qdoc | 2 +- examples/threads/doc/src/mandelbrot.qdoc | 2 +- examples/threads/doc/src/queuedcustomtype.qdoc | 2 +- examples/threads/doc/src/semaphores.qdoc | 2 +- examples/threads/doc/src/waitconditions.qdoc | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/gui/doc/analogclockwindow.qdoc b/examples/gui/doc/analogclockwindow.qdoc index ebe9f9a418..ff361a27b1 100644 --- a/examples/gui/doc/analogclockwindow.qdoc +++ b/examples/gui/doc/analogclockwindow.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example gui/analogclock + \example analogclock \title Analog Clock Window Example \brief The Analog Clock Window example shows how to draw the contents of diff --git a/examples/gui/doc/openglwindow.qdoc b/examples/gui/doc/openglwindow.qdoc index 9d693bc50e..f5af944a31 100644 --- a/examples/gui/doc/openglwindow.qdoc +++ b/examples/gui/doc/openglwindow.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example gui/openglwindow + \example openglwindow \title OpenGL Window Example \brief This example shows how to create a minimal QWindow based application diff --git a/examples/gui/doc/rasterwindow.qdoc b/examples/gui/doc/rasterwindow.qdoc index 971b921d30..f246533c4f 100644 --- a/examples/gui/doc/rasterwindow.qdoc +++ b/examples/gui/doc/rasterwindow.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example gui/rasterwindow + \example rasterwindow \title Raster Window Example \brief This example shows how to create a minimal QWindow based diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index 842f4222ae..45ef2ba9f7 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example threads/mandelbrot + \example mandelbrot \title Mandelbrot Example The Mandelbrot example shows how to use a worker thread to diff --git a/examples/threads/doc/src/queuedcustomtype.qdoc b/examples/threads/doc/src/queuedcustomtype.qdoc index a1f2d54a21..35e6185d3b 100644 --- a/examples/threads/doc/src/queuedcustomtype.qdoc +++ b/examples/threads/doc/src/queuedcustomtype.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example threads/queuedcustomtype + \example queuedcustomtype \title Queued Custom Type Example The Queued Custom Type example shows how to send custom types between diff --git a/examples/threads/doc/src/semaphores.qdoc b/examples/threads/doc/src/semaphores.qdoc index a712cb6414..bea0447f02 100644 --- a/examples/threads/doc/src/semaphores.qdoc +++ b/examples/threads/doc/src/semaphores.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example threads/semaphores + \example semaphores \title Semaphores Example The Semaphores example shows how to use QSemaphore to control diff --git a/examples/threads/doc/src/waitconditions.qdoc b/examples/threads/doc/src/waitconditions.qdoc index 3ca1970685..6d42719f8d 100644 --- a/examples/threads/doc/src/waitconditions.qdoc +++ b/examples/threads/doc/src/waitconditions.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example threads/waitconditions + \example waitconditions \title Wait Conditions Example The Wait Conditions example shows how to use QWaitCondition and -- cgit v1.2.3 From ae8533e4ae3ae2ca32a5dcfc4302d40ee0e2fb0f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 6 Dec 2012 11:50:33 +0100 Subject: doc: Fix Graphics View example docs Make the same layout of the new graphics view example documentation as we had before (except by using annotatedlist instead of hardcoding the links). I've also moved four examples from qtdoc to qtbase so that they can be included in this documentation. Change-Id: Ic2202ade119cadd98d036f1bd77e91dae49b5677 Reviewed-by: Jerome Pasion Reviewed-by: Paul Olav Tvete --- examples/widgets/doc/src/basicgraphicslayouts.qdoc | 2 +- examples/widgets/doc/src/blurpicker.qdoc | 2 ++ examples/widgets/doc/src/embeddeddialogs.qdoc | 2 +- examples/widgets/doc/src/fademessage.qdoc | 2 ++ .../widgets/doc/src/graphicsview-anchorlayout.qdoc | 36 ++++++++++++++++++++ .../widgets/doc/src/graphicsview-flowlayout.qdoc | 38 ++++++++++++++++++++++ .../doc/src/graphicsview-simpleanchorlayout.qdoc | 36 ++++++++++++++++++++ .../doc/src/graphicsview-weatheranchorlayout.qdoc | 36 ++++++++++++++++++++ examples/widgets/doc/src/lighting.qdoc | 2 ++ 9 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 examples/widgets/doc/src/graphicsview-anchorlayout.qdoc create mode 100644 examples/widgets/doc/src/graphicsview-flowlayout.qdoc create mode 100644 examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc create mode 100644 examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc (limited to 'examples') diff --git a/examples/widgets/doc/src/basicgraphicslayouts.qdoc b/examples/widgets/doc/src/basicgraphicslayouts.qdoc index 868943370c..2ff9a90680 100644 --- a/examples/widgets/doc/src/basicgraphicslayouts.qdoc +++ b/examples/widgets/doc/src/basicgraphicslayouts.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/basicgraphicslayouts \title Basic Graphics Layouts Example - \ingroup examples-graphicsview + \ingroup examples-graphicsview-layout \brief This example shows how to use some basic layouts. \brief The Basic Graphics Layouts example shows how to use the layout classes diff --git a/examples/widgets/doc/src/blurpicker.qdoc b/examples/widgets/doc/src/blurpicker.qdoc index aa89ba3cd8..bacd7474e3 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 This example shows the use of QGraphicsBlurEffect. \image blurpickereffect-example.png */ diff --git a/examples/widgets/doc/src/embeddeddialogs.qdoc b/examples/widgets/doc/src/embeddeddialogs.qdoc index 964150ff0f..1dbb7dc83a 100644 --- a/examples/widgets/doc/src/embeddeddialogs.qdoc +++ b/examples/widgets/doc/src/embeddeddialogs.qdoc @@ -28,7 +28,7 @@ /*! \example graphicsview/embeddeddialogs \title Embedded Dialogs - \ingroup examples-graphicsview + \ingroup examples-graphicsview-layout \brief This example shows how to embed standard dialogs into Graphics View. diff --git a/examples/widgets/doc/src/fademessage.qdoc b/examples/widgets/doc/src/fademessage.qdoc index e50f434e56..335384d5bd 100644 --- a/examples/widgets/doc/src/fademessage.qdoc +++ b/examples/widgets/doc/src/fademessage.qdoc @@ -28,6 +28,8 @@ /*! \example effects/fademessage \title Fade Message Effect Example + \ingroup examples-graphicsview-graphicseffects + \brief This example shows the use of QGraphicsColorizeEffect. \div { style="text-align: center"} \inlineimage fademessageeffect-example.png diff --git a/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc new file mode 100644 index 0000000000..78aa1feb95 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** 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 This example shows how to use QGraphicsAnchorLayout. + + The Anchor Layout example demonstrates the use of the QGraphicsAnchorLayout + class. +*/ diff --git a/examples/widgets/doc/src/graphicsview-flowlayout.qdoc b/examples/widgets/doc/src/graphicsview-flowlayout.qdoc new file mode 100644 index 0000000000..c754fa2d53 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-flowlayout.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/flowlayout + \title Graphics View Flow Layout Example + \ingroup examples-graphicsview-layout + \brief This example shows how to make a flow layout in Graphics View. + + The Graphics View Flow Layout example shows the use of a flow layout + in a Graphics View widget. + + 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..2ff804ab46 --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** 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 This example shows how basic use of QGraphicsAnchorLayout. + + The Simple Anchor Layout example shows the basic use of the + QGraphicsAnchorLayout class. +*/ diff --git a/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc new file mode 100644 index 0000000000..8b7b9c498d --- /dev/null +++ b/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** 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 This example shows advanced use of QGraphicsAnchorLayout. + + The Weather Anchor Layout example shows more complex use of the + QGraphicsAnchorLayout class to create a real-world window layout. +*/ diff --git a/examples/widgets/doc/src/lighting.qdoc b/examples/widgets/doc/src/lighting.qdoc index e457d20ada..8277f0e5b8 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 This example shows the use of QGraphicsDropShadowEffect. \image lightingeffect-example.png */ -- cgit v1.2.3 From fb9551b7d0a5cd3db1ab6bb58a6cf342b2076100 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 6 Dec 2012 14:07:41 +0100 Subject: doc: Add missing images in richtext example docs Copied from Qt 4.8 Change-Id: Ic98a5e87305dbf9bb0df7ae071c42bb42a803b10 Reviewed-by: Paul Olav Tvete --- examples/widgets/doc/images/calendar-example.png | Bin 0 -> 13539 bytes examples/widgets/doc/images/orderform-example.png | Bin 0 -> 17404 bytes examples/widgets/doc/images/textedit-demo.png | Bin 0 -> 46980 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/widgets/doc/images/calendar-example.png create mode 100644 examples/widgets/doc/images/orderform-example.png create mode 100644 examples/widgets/doc/images/textedit-demo.png (limited to 'examples') diff --git a/examples/widgets/doc/images/calendar-example.png b/examples/widgets/doc/images/calendar-example.png new file mode 100644 index 0000000000..895ce76b09 Binary files /dev/null and b/examples/widgets/doc/images/calendar-example.png differ diff --git a/examples/widgets/doc/images/orderform-example.png b/examples/widgets/doc/images/orderform-example.png new file mode 100644 index 0000000000..c8545ad23a Binary files /dev/null and b/examples/widgets/doc/images/orderform-example.png differ diff --git a/examples/widgets/doc/images/textedit-demo.png b/examples/widgets/doc/images/textedit-demo.png new file mode 100644 index 0000000000..3cf2883a12 Binary files /dev/null and b/examples/widgets/doc/images/textedit-demo.png differ -- cgit v1.2.3 From 51e7aeb29bc804b904656083d4317c8239c6f8b0 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 6 Dec 2012 14:54:01 +0100 Subject: Fix compile with -DQT_NO_SYSTEMTRAYICON Change-Id: Icca0bef7efca77a841b30f40692144663e7ae913 Reviewed-by: Marc Mutz --- examples/widgets/desktop/systray/main.cpp | 25 ++++++++++++++++++++++++- examples/widgets/desktop/systray/window.cpp | 5 +++++ examples/widgets/desktop/systray/window.h | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'examples') 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 -#include +#ifndef QT_NO_SYSTEMTRAYICON + +#include #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 +#include + +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 #include @@ -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 + +#ifndef QT_NO_SYSTEMTRAYICON + #include QT_BEGIN_NAMESPACE @@ -109,4 +112,6 @@ private: }; //! [0] +#endif // QT_NO_SYSTEMTRAYICON + #endif -- cgit v1.2.3 From 7da7bbcd874197054df5e5691d41d4e2dbe55f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 5 Dec 2012 17:38:58 +0100 Subject: Removed requestOrientation() API from QWindow. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are no proper implementations of this API, and as it stands it only acts to confuse anyone who stumbles across it. It will be better to revisit the full cross platform orientation API story for 5.1. Change-Id: Iff7054a32c6e5e4ad0cc0493a5e4ecc35a6ec4f3 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Shawn Rutledge Reviewed-by: Tor Arne Vestbø --- examples/opengl/paintedwindow/paintedwindow.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/opengl/paintedwindow/paintedwindow.cpp b/examples/opengl/paintedwindow/paintedwindow.cpp index 0920e6e89d..3aa21a04b6 100644 --- a/examples/opengl/paintedwindow/paintedwindow.cpp +++ b/examples/opengl/paintedwindow/paintedwindow.cpp @@ -70,12 +70,10 @@ PaintedWindow::PaintedWindow() m_animation->setEndValue(qreal(1)); m_animation->setDuration(500); - requestOrientation(Qt::PortraitOrientation); - QRect screenGeometry = screen()->availableGeometry(); QPoint center = screenGeometry.center(); - QRect windowRect = screen()->isLandscape(orientation()) ? QRect(0, 0, 640, 480) : QRect(0, 0, 480, 640); + QRect windowRect = screen()->isLandscape(screen()->orientation()) ? QRect(0, 0, 640, 480) : QRect(0, 0, 480, 640); setGeometry(QRect(center - windowRect.center(), windowRect.size())); m_rotation = 0; @@ -142,13 +140,13 @@ void PaintedWindow::orientationChanged(Qt::ScreenOrientation newOrientation) QPainter p; p.begin(&m_prevImage); - p.setTransform(screen()->transformBetween(contentOrientation(), orientation(), rect)); - paint(&p, screen()->mapBetween(contentOrientation(), orientation(), rect)); + p.setTransform(screen()->transformBetween(contentOrientation(), screen()->orientation(), rect)); + paint(&p, screen()->mapBetween(contentOrientation(), screen()->orientation(), rect)); p.end(); p.begin(&m_nextImage); - p.setTransform(screen()->transformBetween(newOrientation, orientation(), rect)); - paint(&p, screen()->mapBetween(newOrientation, orientation(), rect)); + p.setTransform(screen()->transformBetween(newOrientation, screen()->orientation(), rect)); + paint(&p, screen()->mapBetween(newOrientation, screen()->orientation(), rect)); p.end(); m_deltaRotation = screen()->angleBetween(newOrientation, contentOrientation()); @@ -207,9 +205,9 @@ void PaintedWindow::paint() painter.setOpacity(m_rotation); painter.drawImage(0, 0, m_nextImage); } else { - QRect mapped = screen()->mapBetween(contentOrientation(), orientation(), rect); + QRect mapped = screen()->mapBetween(contentOrientation(), screen()->orientation(), rect); - painter.setTransform(screen()->transformBetween(contentOrientation(), orientation(), rect)); + painter.setTransform(screen()->transformBetween(contentOrientation(), screen()->orientation(), rect)); paint(&painter, mapped); painter.end(); } -- cgit v1.2.3 From ed043bf24a85a3364a92b2f24073b003569a0cdb Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 6 Dec 2012 16:40:55 +0100 Subject: Doc: Updated outdated docs to use new macro Change-Id: I9a3528112fba1db988592d9f4f470ec678e81e1a Reviewed-by: Jerome Pasion --- examples/widgets/doc/src/plugandpaint.qdoc | 25 ++++++++++++++-------- .../basictools/basictoolsplugin.h | 2 ++ 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc index 88433a5e2f..86fc202974 100644 --- a/examples/widgets/doc/src/plugandpaint.qdoc +++ b/examples/widgets/doc/src/plugandpaint.qdoc @@ -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/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] -- cgit v1.2.3 From aa3a75ce145b6402578fc5b527d8a7c6a57cf765 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 7 Dec 2012 12:33:47 +0100 Subject: QtBase: Doc: Fix Links to designer manual. Change-Id: I87f68fb70aa773c44b90b58bd56fc5585a7e4107 Reviewed-by: Leena Miettinen --- examples/widgets/richtext/textedit/textedit.qdoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples') 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. -- cgit v1.2.3 From b22eb09b4803fae3a003c3a007e827a53b24bd68 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 10 Dec 2012 14:50:53 +0100 Subject: Fixed installation of gui examples' targets Change-Id: Ie945ffac56ed83d2dc4605a073bcab4ef6f290ac Reviewed-by: Oswald Buddenhagen --- examples/gui/analogclock/analogclock.pro | 3 +++ examples/gui/openglwindow/openglwindow.pro | 3 +++ examples/gui/rasterwindow/rasterwindow.pro | 3 +++ 3 files changed, 9 insertions(+) (limited to 'examples') diff --git a/examples/gui/analogclock/analogclock.pro b/examples/gui/analogclock/analogclock.pro index 7e0360d28a..2183c6888a 100644 --- a/examples/gui/analogclock/analogclock.pro +++ b/examples/gui/analogclock/analogclock.pro @@ -2,3 +2,6 @@ include(../rasterwindow/rasterwindow.pri) SOURCES += \ main.cpp + +target.path = $$[QT_INSTALL_EXAMPLES]/gui/analogclock +INSTALLS += target diff --git a/examples/gui/openglwindow/openglwindow.pro b/examples/gui/openglwindow/openglwindow.pro index 6a664f9a96..93f18f3d3f 100644 --- a/examples/gui/openglwindow/openglwindow.pro +++ b/examples/gui/openglwindow/openglwindow.pro @@ -2,3 +2,6 @@ include(openglwindow.pri) SOURCES += \ main.cpp + +target.path = $$[QT_INSTALL_EXAMPLES]/gui/openglwindow +INSTALLS += target diff --git a/examples/gui/rasterwindow/rasterwindow.pro b/examples/gui/rasterwindow/rasterwindow.pro index 0ea830b037..8ca4f7a89d 100644 --- a/examples/gui/rasterwindow/rasterwindow.pro +++ b/examples/gui/rasterwindow/rasterwindow.pro @@ -2,3 +2,6 @@ include(rasterwindow.pri) SOURCES += \ main.cpp + +target.path = $$[QT_INSTALL_EXAMPLES]/gui/rasterwindow +INSTALLS += target -- cgit v1.2.3 From 2a9144541577d24ca010fe6a219f514a2cf208dc Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Dec 2012 13:23:10 +0100 Subject: Mark \brief comments in thread examples. Change-Id: Ib496b1e500820774354c20003edb22748324cb5f Reviewed-by: Jerome Pasion --- examples/threads/doc/src/mandelbrot.qdoc | 2 +- examples/threads/doc/src/queuedcustomtype.qdoc | 2 +- examples/threads/doc/src/semaphores.qdoc | 2 +- examples/threads/doc/src/waitconditions.qdoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index 45ef2ba9f7..a76b856616 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -29,7 +29,7 @@ \example mandelbrot \title Mandelbrot Example - The Mandelbrot example shows how to use a worker thread to + \brief The Mandelbrot example shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop. diff --git a/examples/threads/doc/src/queuedcustomtype.qdoc b/examples/threads/doc/src/queuedcustomtype.qdoc index 35e6185d3b..43d47d42cc 100644 --- a/examples/threads/doc/src/queuedcustomtype.qdoc +++ b/examples/threads/doc/src/queuedcustomtype.qdoc @@ -29,7 +29,7 @@ \example queuedcustomtype \title Queued Custom Type Example - The Queued Custom Type example shows how to send custom types between + \brief The Queued Custom Type example shows how to send custom types between threads with queued signals and slots. \image queuedcustomtype-example.png diff --git a/examples/threads/doc/src/semaphores.qdoc b/examples/threads/doc/src/semaphores.qdoc index bea0447f02..0b811f9466 100644 --- a/examples/threads/doc/src/semaphores.qdoc +++ b/examples/threads/doc/src/semaphores.qdoc @@ -29,7 +29,7 @@ \example semaphores \title Semaphores Example - The Semaphores example shows how to use QSemaphore to control + \brief The Semaphores example shows how to use QSemaphore to control access to a circular buffer shared by a producer thread and a consumer thread. diff --git a/examples/threads/doc/src/waitconditions.qdoc b/examples/threads/doc/src/waitconditions.qdoc index 6d42719f8d..ea49a93d60 100644 --- a/examples/threads/doc/src/waitconditions.qdoc +++ b/examples/threads/doc/src/waitconditions.qdoc @@ -29,7 +29,7 @@ \example waitconditions \title Wait Conditions Example - The Wait Conditions example shows how to use QWaitCondition and + \brief The Wait Conditions example shows how to use QWaitCondition and QMutex to control access to a circular buffer shared by a producer thread and a consumer thread. -- cgit v1.2.3 From 6a9eb8ed01e002393b2fb26838cefadf8d41f036 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Thu, 6 Dec 2012 19:27:20 +0100 Subject: Doc: Added documentation for the examples - Moved documentation for the Qt XML, Qt Widgets, Qt Concurrent, and Qt Network examples from qtdoc. - Grouped the documentation pages under relevant groups - Fixed \snippet paths Task-number: QTBUG-27515 Change-Id: I43c22a679e2eefbb48e3cd5893aa2afd3d905863 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../network/doc/src/blockingfortuneclient.qdoc | 4 +- examples/network/doc/src/broadcastreceiver.qdoc | 5 +- examples/network/doc/src/broadcastsender.qdoc | 5 +- examples/network/doc/src/fortuneclient.qdoc | 4 +- examples/network/doc/src/fortuneserver.qdoc | 6 +- examples/network/doc/src/googlesuggest.qdoc | 6 +- examples/network/doc/src/http.qdoc | 5 +- examples/network/doc/src/loopback.qdoc | 5 +- examples/network/doc/src/multicastreceiver.qdoc | 5 +- examples/network/doc/src/multicastsender.qdoc | 5 +- examples/network/doc/src/network-chat.qdoc | 6 +- examples/network/doc/src/network-download.qdoc | 41 +++++ .../network/doc/src/network-downloadmanager.qdoc | 41 +++++ examples/network/doc/src/securesocketclient.qdoc | 8 +- examples/network/doc/src/torrent.qdoc | 5 +- .../doc/images/imagescaling_example.png | Bin 0 -> 23710 bytes .../doc/src/qtconcurrent-imagescaling.qdoc | 38 ++++ .../qtconcurrent/map/doc/src/qtconcurrent-map.qdoc | 38 ++++ .../doc/images/qtconcurrent-progressdialog.png | Bin 0 -> 4608 bytes .../doc/src/qtconcurrent-progressdialog.qdoc | 38 ++++ .../doc/src/qtconcurrent-runfunction.qdoc | 39 +++++ .../wordcount/doc/src/qtconcurrent-wordcount.qdoc | 39 +++++ examples/threads/doc/src/mandelbrot.qdoc | 2 + examples/threads/doc/src/queuedcustomtype.qdoc | 2 + examples/threads/doc/src/semaphores.qdoc | 2 + examples/threads/doc/src/waitconditions.qdoc | 2 + .../doc/images/graphicsanchorlayout-example.png | Bin 0 -> 11592 bytes .../doc/images/graphicsflowlayout-example.png | Bin 0 -> 15345 bytes .../images/graphicssimpleanchorlayout-example.png | Bin 0 -> 13715 bytes .../doc/images/weatheranchorlayout-example.png | Bin 0 -> 88805 bytes examples/widgets/doc/src/basicgraphicslayouts.qdoc | 4 +- examples/widgets/doc/src/blurpicker.qdoc | 2 +- examples/widgets/doc/src/boxes.qdoc | 3 +- examples/widgets/doc/src/chip.qdoc | 5 +- .../widgets/doc/src/collidingmice-example.qdoc | 2 + examples/widgets/doc/src/diagramscene.qdoc | 2 +- examples/widgets/doc/src/dragdroprobot.qdoc | 4 +- examples/widgets/doc/src/elasticnodes.qdoc | 6 +- examples/widgets/doc/src/embeddeddialogs.qdoc | 6 +- examples/widgets/doc/src/fademessage.qdoc | 4 +- .../widgets/doc/src/graphicsview-anchorlayout.qdoc | 4 +- .../widgets/doc/src/graphicsview-flowlayout.qdoc | 4 +- .../doc/src/graphicsview-simpleanchorlayout.qdoc | 4 +- .../doc/src/graphicsview-weatheranchorlayout.qdoc | 4 +- examples/widgets/doc/src/lighting.qdoc | 2 +- examples/widgets/doc/src/padnavigator.qdoc | 4 +- .../xml/doc/images/xmlstreamexample-filemenu.png | Bin 0 -> 9380 bytes .../xml/doc/images/xmlstreamexample-helpmenu.png | Bin 0 -> 10856 bytes .../xml/doc/images/xmlstreamexample-screenshot.png | Bin 0 -> 22323 bytes examples/xml/doc/src/qxmlstreambookmarks.qdoc | 194 +++++++++++++++++++++ examples/xml/doc/src/saxbookmarks.qdoc | 7 +- 51 files changed, 552 insertions(+), 60 deletions(-) create mode 100644 examples/network/doc/src/network-download.qdoc create mode 100644 examples/network/doc/src/network-downloadmanager.qdoc create mode 100644 examples/qtconcurrent/imagescaling/doc/images/imagescaling_example.png create mode 100644 examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc create mode 100644 examples/qtconcurrent/map/doc/src/qtconcurrent-map.qdoc create mode 100644 examples/qtconcurrent/progressdialog/doc/images/qtconcurrent-progressdialog.png create mode 100644 examples/qtconcurrent/progressdialog/doc/src/qtconcurrent-progressdialog.qdoc create mode 100644 examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc create mode 100644 examples/qtconcurrent/wordcount/doc/src/qtconcurrent-wordcount.qdoc create mode 100644 examples/widgets/doc/images/graphicsanchorlayout-example.png create mode 100644 examples/widgets/doc/images/graphicsflowlayout-example.png create mode 100644 examples/widgets/doc/images/graphicssimpleanchorlayout-example.png create mode 100644 examples/widgets/doc/images/weatheranchorlayout-example.png create mode 100644 examples/xml/doc/images/xmlstreamexample-filemenu.png create mode 100644 examples/xml/doc/images/xmlstreamexample-helpmenu.png create mode 100644 examples/xml/doc/images/xmlstreamexample-screenshot.png create mode 100644 examples/xml/doc/src/qxmlstreambookmarks.qdoc (limited to 'examples') diff --git a/examples/network/doc/src/blockingfortuneclient.qdoc b/examples/network/doc/src/blockingfortuneclient.qdoc index 4e105b50a7..c16fd60248 100644 --- a/examples/network/doc/src/blockingfortuneclient.qdoc +++ b/examples/network/doc/src/blockingfortuneclient.qdoc @@ -29,9 +29,7 @@ \example blockingfortuneclient \title Blocking Fortune Client Example \ingroup examples-network - - \brief The Blocking Fortune Client example shows how to create a client for a - network service using QTcpSocket's synchronous API in a non-GUI thread. + \brief Demonstrates how to create a client for a network service \image blockingfortuneclient-example.png diff --git a/examples/network/doc/src/broadcastreceiver.qdoc b/examples/network/doc/src/broadcastreceiver.qdoc index 374bc29244..2ab3c6be67 100644 --- a/examples/network/doc/src/broadcastreceiver.qdoc +++ b/examples/network/doc/src/broadcastreceiver.qdoc @@ -29,9 +29,10 @@ \example broadcastreceiver \title Broadcast Receiver Example \ingroup examples-network + \brief Demonstrates how to receive information broadcasted over a local network. - \brief The Broadcast Receiver example shows how to receive information that is broadcasted - over a local network. + This example uses the Qt Network APIs to demonstrate how to receive + messages broadcasted over a local network. \image broadcastreceiver-example.png */ diff --git a/examples/network/doc/src/broadcastsender.qdoc b/examples/network/doc/src/broadcastsender.qdoc index a587c5fddd..a9aa1f96d8 100644 --- a/examples/network/doc/src/broadcastsender.qdoc +++ b/examples/network/doc/src/broadcastsender.qdoc @@ -29,9 +29,10 @@ \example broadcastsender \title Broadcast Sender Example \ingroup examples-network + \brief Demonstrates how to broadcast information to multiple clients on a local network. - \brief The Broadcast Sender example shows how to broadcast information to multiple clients - on a local network. + This example uses Qt Network APIs to demonstrate how to broadcast messages + to multiple clients over a local network. \image broadcastsender-example.png */ diff --git a/examples/network/doc/src/fortuneclient.qdoc b/examples/network/doc/src/fortuneclient.qdoc index f7a4c56020..1d69415f3c 100644 --- a/examples/network/doc/src/fortuneclient.qdoc +++ b/examples/network/doc/src/fortuneclient.qdoc @@ -29,9 +29,9 @@ \example fortuneclient \title Fortune Client Example \ingroup examples-network + \brief Demonstrates how to create a client for a network service - \brief The Fortune Client example shows how to create a client for a simple - network service using QTcpSocket. It is intended to be run alongside the + This example uses QTcpSocket, and is intended to be run alongside the \l{fortuneserver}{Fortune Server} example or the \l{threadedfortuneserver}{Threaded Fortune Server} example. diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc index d702bc6bb1..7422120975 100644 --- a/examples/network/doc/src/fortuneserver.qdoc +++ b/examples/network/doc/src/fortuneserver.qdoc @@ -29,15 +29,15 @@ \example fortuneserver \title Fortune Server Example \ingroup examples-network + \brief Demonstrates how to create a server for a network service. - \brief The Fortune Server example shows how to create a server for a simple - network service. It is intended to be run alongside the + This example is intended to be run alongside the \l{fortuneclient}{Fortune Client} example or the \l{blockingfortuneclient}{Blocking Fortune Client} example. \image fortuneserver-example.png Screenshot of the Fortune Server example - This example uses QTcpServer to accept incoming TCP connections, and a + It uses QTcpServer to accept incoming TCP connections, and a simple QDataStream based data transfer protocol to write a fortune to the connecting client (from the \l{fortuneclient}{Fortune Client} example), before closing the connection. diff --git a/examples/network/doc/src/googlesuggest.qdoc b/examples/network/doc/src/googlesuggest.qdoc index c04e65c3f9..b53c394d76 100644 --- a/examples/network/doc/src/googlesuggest.qdoc +++ b/examples/network/doc/src/googlesuggest.qdoc @@ -29,10 +29,10 @@ \example googlesuggest \title Google Suggest Example \ingroup examples-network + \brief Obtains the list of search recommendations by the Google search engine - \brief The Google Suggest example demonstrates how to use the QNetworkAccessManager - class to obtain a list of suggestions from the Google search engine as the - user types into a QLineEdit. + The example uses the QNetworkAccessManager to obtain the list of search + recommendations by Google as the user types into a QLineEdit. \image googlesuggest-example.png diff --git a/examples/network/doc/src/http.qdoc b/examples/network/doc/src/http.qdoc index 89223b7894..62cfffd603 100644 --- a/examples/network/doc/src/http.qdoc +++ b/examples/network/doc/src/http.qdoc @@ -29,9 +29,10 @@ \example http \title HTTP Example \ingroup examples-network + \brief Demonstrates a simple HTTP client - \brief The HTTP example demonstrates a simple HTTP client that shows how to fetch files - specified by URLs from remote hosts. + This example demonstrates how a simple HTTP client can fetch files + from remote hosts. \image http-example.png */ diff --git a/examples/network/doc/src/loopback.qdoc b/examples/network/doc/src/loopback.qdoc index e278a9e9bd..6d74a187fd 100644 --- a/examples/network/doc/src/loopback.qdoc +++ b/examples/network/doc/src/loopback.qdoc @@ -29,9 +29,10 @@ \example loopback \title Loopback Example \ingroup examples-network + \brief Demonstrates the client-server communication on a local host - \brief The Loopback example shows how to communicate between simple clients and servers on a local - host. + The example demonstrates how the clients and servers on a local host + communicate with each other. \image loopback-example.png */ diff --git a/examples/network/doc/src/multicastreceiver.qdoc b/examples/network/doc/src/multicastreceiver.qdoc index 88ed6020d4..62174f5d4d 100644 --- a/examples/network/doc/src/multicastreceiver.qdoc +++ b/examples/network/doc/src/multicastreceiver.qdoc @@ -29,9 +29,8 @@ \example multicastreceiver \title Multicast Receiver Example \ingroup examples-network + \brief Demonstrates how to receive information sent to a multicast group - \brief The Multicast Receiever example shows how to receive information that is - sent to a multicast group. - + This example demonstrates how to receive messages sent to a multicast group \image multicastreceiver-example.png */ diff --git a/examples/network/doc/src/multicastsender.qdoc b/examples/network/doc/src/multicastsender.qdoc index 4ec9defb53..c4b93ea0a6 100644 --- a/examples/network/doc/src/multicastsender.qdoc +++ b/examples/network/doc/src/multicastsender.qdoc @@ -29,9 +29,10 @@ \example multicastsender \title Multicast Sender Example \ingroup examples-network + \brief Demonstrates how to send messages to a multicast group - \brief The Multicast Sender example shows how to send information to multiple - clients in a multicast group. + This example demonstrates how to send messages to the clients of a + multicast group. \image multicastsender-example.png */ diff --git a/examples/network/doc/src/network-chat.qdoc b/examples/network/doc/src/network-chat.qdoc index cd5ec4b348..b95a13098f 100644 --- a/examples/network/doc/src/network-chat.qdoc +++ b/examples/network/doc/src/network-chat.qdoc @@ -29,10 +29,10 @@ \example network-chat \title Network Chat Example \ingroup examples-network + \brief Demonstrates a stateful peer-to-peer Chat client - \brief The Network Chat example demonstrates a stateful peer-to-peer Chat client - that uses broadcasting with QUdpSocket and QNetworkInterface to discover - its peers. + This example uses broadcasting with QUdpSocket and QNetworkInterface to + discover its peers. \image network-chat-example.png */ diff --git a/examples/network/doc/src/network-download.qdoc b/examples/network/doc/src/network-download.qdoc new file mode 100644 index 0000000000..1144361fb5 --- /dev/null +++ b/examples/network/doc/src/network-download.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** 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 network/download + \title Network Download Example + \brief Demonstrates how to use networking APIs for multiple downloads + \ingroup examples-network + + The Network Download example shows how to perform multiple downloads in + parallel using the QNetworkAccessManager class. + + This example is designed to be run from the command-line. + + The \l{Network Download Manager Example} implements a more complex system + that places files in a queue for sequential downloading. +*/ diff --git a/examples/network/doc/src/network-downloadmanager.qdoc b/examples/network/doc/src/network-downloadmanager.qdoc new file mode 100644 index 0000000000..9722996d30 --- /dev/null +++ b/examples/network/doc/src/network-downloadmanager.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** 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 network/downloadmanager + \title Network Download Manager Example + \brief Demonstrates how to use the networking APIs for multiple downloads + \ingroup examples-network + + The Network Download example shows how to implement a queue for multiple + downloads using the QNetworkAccessManager class. + + This example is designed to be run from the command-line. + + See the \l{Network Download Example} for a simpler version of this example + that obtains multiple files in parallel. +*/ diff --git a/examples/network/doc/src/securesocketclient.qdoc b/examples/network/doc/src/securesocketclient.qdoc index a61a00e833..e025b51931 100644 --- a/examples/network/doc/src/securesocketclient.qdoc +++ b/examples/network/doc/src/securesocketclient.qdoc @@ -29,11 +29,11 @@ \example securesocketclient \title Secure Socket Client Example \ingroup examples-network + \brief Demonstrates how to communicate over an encrypted (SSL) connection - \brief The Secure Socket Client example shows how to use QSslSocket to - communicate over an encrypted (SSL) connection. It also demonstrates how - to deal with authenticity problems, and how to display security and - certificate information. + This example uses QSslSocket to demonstrate how to communicate over an + encrypted connection, deal with authenticity problems, and display security + and certificate information. \image securesocketclient.png \image securesocketclient2.png diff --git a/examples/network/doc/src/torrent.qdoc b/examples/network/doc/src/torrent.qdoc index 791464c9a4..939ebcbc6b 100644 --- a/examples/network/doc/src/torrent.qdoc +++ b/examples/network/doc/src/torrent.qdoc @@ -29,9 +29,10 @@ \example torrent \title Torrent Example \ingroup examples-network + \brief Demonstrates complex TCP/IP operations - \brief The Torrent example is a functional BitTorrent client that - illustrates how to write a complex TCP/IP application using Qt. + This example demonstrates some of the complex TCP/IP operations + supported by the Qt Network APIs. \image torrent-example.png diff --git a/examples/qtconcurrent/imagescaling/doc/images/imagescaling_example.png b/examples/qtconcurrent/imagescaling/doc/images/imagescaling_example.png new file mode 100644 index 0000000000..7c6794132a Binary files /dev/null and b/examples/qtconcurrent/imagescaling/doc/images/imagescaling_example.png differ diff --git a/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc new file mode 100644 index 0000000000..4cf07e8edb --- /dev/null +++ b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.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 qtconcurrent/imagescaling + \title Image Scaling Example + \bried Demonstrates how to asynchronously scale images. + \ingroup qtconcurrentexamples + + The QtConcurrent Map example shows how to use the asynchronous + QtConcurrent API to load and scale a collection of images. + + \image imagescaling_example.png +*/ diff --git a/examples/qtconcurrent/map/doc/src/qtconcurrent-map.qdoc b/examples/qtconcurrent/map/doc/src/qtconcurrent-map.qdoc new file mode 100644 index 0000000000..7522baf2c4 --- /dev/null +++ b/examples/qtconcurrent/map/doc/src/qtconcurrent-map.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 qtconcurrent/map + \title Map Example + \brief Demonstrates how to scale images synchronously. + \ingroup qtconcurrentexamples + + The QtConcurrent Map example shows how to use the synchronous (blocking) + QtConcurrent API to scale a collection of images. + + This is a command-line application. +*/ diff --git a/examples/qtconcurrent/progressdialog/doc/images/qtconcurrent-progressdialog.png b/examples/qtconcurrent/progressdialog/doc/images/qtconcurrent-progressdialog.png new file mode 100644 index 0000000000..2e8b7735ad Binary files /dev/null and b/examples/qtconcurrent/progressdialog/doc/images/qtconcurrent-progressdialog.png differ diff --git a/examples/qtconcurrent/progressdialog/doc/src/qtconcurrent-progressdialog.qdoc b/examples/qtconcurrent/progressdialog/doc/src/qtconcurrent-progressdialog.qdoc new file mode 100644 index 0000000000..aa5cd517a5 --- /dev/null +++ b/examples/qtconcurrent/progressdialog/doc/src/qtconcurrent-progressdialog.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 qtconcurrent/progressdialog + \title QtConcurrent Progress Dialog Example + \brief Demonstrates how to monitor the progress of the active processes. + \ingroup qtconcurrentexamples + + The QtConcurrent Progress Dialog example shows how to use the + QFutureWatcher class to monitor the progress of a long-running operation. + + \image qtconcurrent-progressdialog.png +*/ diff --git a/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc b/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc new file mode 100644 index 0000000000..1c4e367240 --- /dev/null +++ b/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** 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 qtconcurrent/runfunction + \title Run Function Example + \brief Demonstrates how to run standard functions concurrently. + \ingroup qtconcurrentexamples + + The QtConcurrent Run Function example shows how to apply concurrency to + a standard function, using QFuture instances to retrieve return values + at a later time. + + This is a command-line application. +*/ diff --git a/examples/qtconcurrent/wordcount/doc/src/qtconcurrent-wordcount.qdoc b/examples/qtconcurrent/wordcount/doc/src/qtconcurrent-wordcount.qdoc new file mode 100644 index 0000000000..b8d04fa553 --- /dev/null +++ b/examples/qtconcurrent/wordcount/doc/src/qtconcurrent-wordcount.qdoc @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** 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 qtconcurrent/wordcount + \title QtConcurrent Word Count Example + \brief Demonstrates how to use the map-reduce algorithm + \ingroup qtconcurrentexamples + + The QtConcurrent Word Count example demonstrates the use of the map-reduce + algorithm when applied to the problem of counting words in a collection + of files. + + This is a command-line application. +*/ diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index a76b856616..8ef8d0b01a 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -28,6 +28,8 @@ /*! \example mandelbrot \title Mandelbrot Example + \brief Demonstrates multi-thread programming using Qt + \ingroup qtconcurrent-mtexamples \brief The Mandelbrot example shows how to use a worker thread to perform heavy computations without blocking the main thread's diff --git a/examples/threads/doc/src/queuedcustomtype.qdoc b/examples/threads/doc/src/queuedcustomtype.qdoc index 43d47d42cc..df825b2db3 100644 --- a/examples/threads/doc/src/queuedcustomtype.qdoc +++ b/examples/threads/doc/src/queuedcustomtype.qdoc @@ -28,6 +28,8 @@ /*! \example queuedcustomtype \title Queued Custom Type Example + \brief Demonstrates multi-thread programming using Qt + \ingroup qtconcurrent-mtexamples \brief The Queued Custom Type example shows how to send custom types between threads with queued signals and slots. diff --git a/examples/threads/doc/src/semaphores.qdoc b/examples/threads/doc/src/semaphores.qdoc index 0b811f9466..4cfccf00f8 100644 --- a/examples/threads/doc/src/semaphores.qdoc +++ b/examples/threads/doc/src/semaphores.qdoc @@ -28,6 +28,8 @@ /*! \example semaphores \title Semaphores Example + \brief Demonstrates multi-thread programming using Qt + \ingroup qtconcurrent-mtexamples \brief The Semaphores example shows how to use QSemaphore to control access to a circular buffer shared by a producer thread and a diff --git a/examples/threads/doc/src/waitconditions.qdoc b/examples/threads/doc/src/waitconditions.qdoc index ea49a93d60..6969e46491 100644 --- a/examples/threads/doc/src/waitconditions.qdoc +++ b/examples/threads/doc/src/waitconditions.qdoc @@ -28,6 +28,8 @@ /*! \example waitconditions \title Wait Conditions Example + \brief Demonstrates multi-thread programming using Qt + \ingroup qtconcurrent-mtexamples \brief The Wait Conditions example shows how to use QWaitCondition and QMutex to control access to a circular buffer shared by a diff --git a/examples/widgets/doc/images/graphicsanchorlayout-example.png b/examples/widgets/doc/images/graphicsanchorlayout-example.png new file mode 100644 index 0000000000..d30d6839d9 Binary files /dev/null and b/examples/widgets/doc/images/graphicsanchorlayout-example.png differ diff --git a/examples/widgets/doc/images/graphicsflowlayout-example.png b/examples/widgets/doc/images/graphicsflowlayout-example.png new file mode 100644 index 0000000000..a5f9b3dc40 Binary files /dev/null and b/examples/widgets/doc/images/graphicsflowlayout-example.png differ diff --git a/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png b/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png new file mode 100644 index 0000000000..d073b12c0c Binary files /dev/null and b/examples/widgets/doc/images/graphicssimpleanchorlayout-example.png differ diff --git a/examples/widgets/doc/images/weatheranchorlayout-example.png b/examples/widgets/doc/images/weatheranchorlayout-example.png new file mode 100644 index 0000000000..59d3b55b7a Binary files /dev/null and b/examples/widgets/doc/images/weatheranchorlayout-example.png differ diff --git a/examples/widgets/doc/src/basicgraphicslayouts.qdoc b/examples/widgets/doc/src/basicgraphicslayouts.qdoc index 2ff9a90680..70f92a838a 100644 --- a/examples/widgets/doc/src/basicgraphicslayouts.qdoc +++ b/examples/widgets/doc/src/basicgraphicslayouts.qdoc @@ -29,9 +29,9 @@ \example graphicsview/basicgraphicslayouts \title Basic Graphics Layouts Example \ingroup examples-graphicsview-layout - \brief This example shows how to use some basic layouts. + \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/blurpicker.qdoc b/examples/widgets/doc/src/blurpicker.qdoc index bacd7474e3..06426c2ab3 100644 --- a/examples/widgets/doc/src/blurpicker.qdoc +++ b/examples/widgets/doc/src/blurpicker.qdoc @@ -29,7 +29,7 @@ \example effects/blurpicker \title Blur Picker Effect Example \ingroup examples-graphicsview-graphicseffects - \brief This example shows the use of QGraphicsBlurEffect. + \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 b3ed1f68c8..6ad50fff9f 100644 --- a/examples/widgets/doc/src/boxes.qdoc +++ b/examples/widgets/doc/src/boxes.qdoc @@ -29,8 +29,7 @@ \example graphicsview/boxes \title Boxes \ingroup examples-graphicsview - \brief This demo shows Qt's ability to combine advanced OpenGL rendering with the - the \l{Graphics View Framework}. + \brief Combines advanced OpenGL rendering with the Graphics View framework \image boxes-demo.png diff --git a/examples/widgets/doc/src/chip.qdoc b/examples/widgets/doc/src/chip.qdoc index e3adb26ced..6fd15ac09c 100644 --- a/examples/widgets/doc/src/chip.qdoc +++ b/examples/widgets/doc/src/chip.qdoc @@ -29,10 +29,9 @@ \example graphicsview/chip \title 40000 Chips \ingroup examples-graphicsview - \brief This demo shows how to visualize a huge scene with 40000 chip items - using Graphics View. + \brief Visualizes a huge graphic view scene with 40000 chip items - 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/collidingmice-example.qdoc b/examples/widgets/doc/src/collidingmice-example.qdoc index 3994d75c2b..b6187677b8 100644 --- a/examples/widgets/doc/src/collidingmice-example.qdoc +++ b/examples/widgets/doc/src/collidingmice-example.qdoc @@ -28,6 +28,8 @@ /*! \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 diff --git a/examples/widgets/doc/src/diagramscene.qdoc b/examples/widgets/doc/src/diagramscene.qdoc index 55043df475..4ad74cfee9 100644 --- a/examples/widgets/doc/src/diagramscene.qdoc +++ b/examples/widgets/doc/src/diagramscene.qdoc @@ -29,7 +29,7 @@ \example graphicsview/diagramscene \title Diagram Scene Example \ingroup examples-graphicsview - \brief This example shows use of Qt's graphics framework. + \brief Demonstrate how to use the Graphics View framework \image diagramscene.png diff --git a/examples/widgets/doc/src/dragdroprobot.qdoc b/examples/widgets/doc/src/dragdroprobot.qdoc index 8187cbfd46..f58f3cfdf2 100644 --- a/examples/widgets/doc/src/dragdroprobot.qdoc +++ b/examples/widgets/doc/src/dragdroprobot.qdoc @@ -29,7 +29,9 @@ \example graphicsview/dragdroprobot \title Drag and Drop Robot Example \ingroup examples-graphicsview - \brief The Drag and Drop Robot example shows how to implement Drag and Drop in a + \brief Demonstrates how to drag and drop items in a graphics view + + 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/elasticnodes.qdoc b/examples/widgets/doc/src/elasticnodes.qdoc index 75ad496592..bfca70d2f1 100644 --- a/examples/widgets/doc/src/elasticnodes.qdoc +++ b/examples/widgets/doc/src/elasticnodes.qdoc @@ -29,10 +29,10 @@ \example graphicsview/elasticnodes \title Elastic Nodes Example \ingroup examples-graphicsview - \brief The Elastic Nodes example shows how to implement edges between nodes in a - graph, with basic interaction. + \brief Demonstrates how to interact with graphical items in a scene - You can click to drag a node around, and + 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; as you zoom in, the graphics remain crisp. diff --git a/examples/widgets/doc/src/embeddeddialogs.qdoc b/examples/widgets/doc/src/embeddeddialogs.qdoc index 1dbb7dc83a..34e800d75a 100644 --- a/examples/widgets/doc/src/embeddeddialogs.qdoc +++ b/examples/widgets/doc/src/embeddeddialogs.qdoc @@ -29,10 +29,10 @@ \example graphicsview/embeddeddialogs \title Embedded Dialogs \ingroup examples-graphicsview-layout - \brief This example shows how to embed standard dialogs into - Graphics View. + \brief Demonstrates how to embed dialogs into a graphics view - It also shows how you can customize the + 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. \image embeddeddialogs-demo.png diff --git a/examples/widgets/doc/src/fademessage.qdoc b/examples/widgets/doc/src/fademessage.qdoc index 335384d5bd..dcd429521d 100644 --- a/examples/widgets/doc/src/fademessage.qdoc +++ b/examples/widgets/doc/src/fademessage.qdoc @@ -29,9 +29,9 @@ \example effects/fademessage \title Fade Message Effect Example \ingroup examples-graphicsview-graphicseffects - \brief This example shows the use of QGraphicsColorizeEffect. + \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/graphicsview-anchorlayout.qdoc b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc index 78aa1feb95..98c0958918 100644 --- a/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc +++ b/examples/widgets/doc/src/graphicsview-anchorlayout.qdoc @@ -29,8 +29,10 @@ \example graphicsview/anchorlayout \title Anchor Layout Example \ingroup examples-graphicsview-layout - \brief This example shows how to use QGraphicsAnchorLayout. + \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 index c754fa2d53..52d97164c3 100644 --- a/examples/widgets/doc/src/graphicsview-flowlayout.qdoc +++ b/examples/widgets/doc/src/graphicsview-flowlayout.qdoc @@ -29,10 +29,12 @@ \example graphicsview/flowlayout \title Graphics View Flow Layout Example \ingroup examples-graphicsview-layout - \brief This example shows how to make a flow layout in Graphics View. + \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 index 2ff804ab46..480c7c4e0c 100644 --- a/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc +++ b/examples/widgets/doc/src/graphicsview-simpleanchorlayout.qdoc @@ -29,8 +29,10 @@ \example graphicsview/simpleanchorlayout \title Simple Anchor Layout Example \ingroup examples-graphicsview-layout - \brief This example shows how basic use of QGraphicsAnchorLayout. + \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 index 8b7b9c498d..88a5c60fb5 100644 --- a/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc +++ b/examples/widgets/doc/src/graphicsview-weatheranchorlayout.qdoc @@ -29,8 +29,10 @@ \example graphicsview/weatheranchorlayout \title Weather Anchor Layout Example \ingroup examples-graphicsview-layout - \brief This example shows advanced use of QGraphicsAnchorLayout. + \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/lighting.qdoc b/examples/widgets/doc/src/lighting.qdoc index 8277f0e5b8..e519bacb91 100644 --- a/examples/widgets/doc/src/lighting.qdoc +++ b/examples/widgets/doc/src/lighting.qdoc @@ -29,7 +29,7 @@ \example effects/lighting \title Lighting Effect Example \ingroup examples-graphicsview-graphicseffects - \brief This example shows the use of QGraphicsDropShadowEffect. + \brief Demonstrates how to apply effects on items in the view \image lightingeffect-example.png */ diff --git a/examples/widgets/doc/src/padnavigator.qdoc b/examples/widgets/doc/src/padnavigator.qdoc index 90c7c00952..7b5e54e5ff 100644 --- a/examples/widgets/doc/src/padnavigator.qdoc +++ b/examples/widgets/doc/src/padnavigator.qdoc @@ -29,7 +29,9 @@ \example graphicsview/padnavigator \title Pad Navigator Example \ingroup examples-graphicsview - \brief The Pad Navigator Example shows how you can use Graphics View together with + \brief Demonstrates how to create animated user interface + + 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/xml/doc/images/xmlstreamexample-filemenu.png b/examples/xml/doc/images/xmlstreamexample-filemenu.png new file mode 100644 index 0000000000..e074fb7c41 Binary files /dev/null and b/examples/xml/doc/images/xmlstreamexample-filemenu.png differ diff --git a/examples/xml/doc/images/xmlstreamexample-helpmenu.png b/examples/xml/doc/images/xmlstreamexample-helpmenu.png new file mode 100644 index 0000000000..0dc4392b94 Binary files /dev/null and b/examples/xml/doc/images/xmlstreamexample-helpmenu.png differ diff --git a/examples/xml/doc/images/xmlstreamexample-screenshot.png b/examples/xml/doc/images/xmlstreamexample-screenshot.png new file mode 100644 index 0000000000..bbaa423061 Binary files /dev/null and b/examples/xml/doc/images/xmlstreamexample-screenshot.png differ diff --git a/examples/xml/doc/src/qxmlstreambookmarks.qdoc b/examples/xml/doc/src/qxmlstreambookmarks.qdoc new file mode 100644 index 0000000000..dd7708a290 --- /dev/null +++ b/examples/xml/doc/src/qxmlstreambookmarks.qdoc @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** 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 xml/streambookmarks + \title QXmlStream Bookmarks Example + \brief Demonstrates how to read and write to XBEL files + \ingroup xml-examples + + The QXmlStream Bookmarks example provides a reader for XML Bookmark + Exchange Language (XBEL) files using Qt's QXmlStreamReader class + for reading, and QXmlStreamWriter class for writing the files. + + \image xmlstreamexample-screenshot.png + + \section1 XbelWriter Class Definition + + The \c XbelWriter class contains a private instance of QXmlStreamWriter, + which provides an XML writer with a streaming API. \c XbelWriter also + has a reference to the QTreeWidget instance where the bookmark hierarchy + is stored. + + \snippet streambookmarks/xbelwriter.h 0 + + \section1 XbelWriter Class Implementation + + The \c XbelWriter constructor accepts a \a treeWidget to initialize within + its definition. We enable \l{QXmlStreamWriter}'s auto-formatting property + to ensure line-breaks and indentations are added automatically to empty + sections between elements, increasing readability as the data is split into + several lines. + + \snippet streambookmarks/xbelwriter.cpp 0 + + The \c writeFile() function accepts a QIODevice object and sets it using + \c setDevice(). This function then writes the document type + definition(DTD), the start element, the version, and \c{treeWidget}'s + top-level items. + + \snippet streambookmarks/xbelwriter.cpp 1 + + The \c writeItem() function accepts a QTreeWidgetItem object and writes it + to the stream, depending on its \c tagName, which can either be a "folder", + "bookmark", or "separator". + + \snippet streambookmarks/xbelwriter.cpp 2 + + \section1 XbelReader Class Definition + + The \c XbelReader contains a private instance of QXmlStreamReader, the + companion class to QXmlStreamWriter. \c XbelReader also contains a + reference to the QTreeWidget that is used to group the bookmarks according + to their hierarchy. + + \snippet streambookmarks/xbelreader.h 0 + + \section1 XbelReader Class Implementation + + The \c XbelReader constructor accepts a QTreeWidget to initialize the + \c treeWidget within its definition. A QStyle object is used to set + \c{treeWidget}'s style property. The \c folderIcon is set to QIcon::Normal + mode where the pixmap is only displayed when the user is not interacting + with the icon. The QStyle::SP_DirClosedIcon, QStyle::SP_DirOpenIcon, and + QStyle::SP_FileIcon correspond to standard pixmaps that follow the style + of your GUI. + + \snippet streambookmarks/xbelreader.cpp 0 + + The \c read() function accepts a QIODevice and sets it using + \l{QXmlStreamReader::}{setDevice()}. The actual process of reading only + takes place if the file is a valid XBEL 1.0 file. Note that the XML input + needs to be well-formed to be accepted by QXmlStreamReader. Otherwise, the + \l{QXmlStreamReader::}{raiseError()} function is used to display an error + message. Since the XBEL reader is only concerned with reading XML elements, + it makes extensive use of the \l{QXmlStreamReader::}{readNextStartElement()} + convenience function. + + \snippet streambookmarks/xbelreader.cpp 1 + + The \c errorString() function is used if an error occurred, in order to + obtain a description of the error complete with line and column number + information. + + \snippet streambookmarks/xbelreader.cpp 2 + + The \c readXBEL() function reads the name of a startElement and calls + the appropriate function to read it, depending on whether if its a + "folder", "bookmark" or "separator". Otherwise, it calls + \l{QXmlStreamReader::}{skipCurrentElement()}. The Q_ASSERT() macro is used + to provide a pre-condition for the function. + + \snippet streambookmarks/xbelreader.cpp 3 + + The \c readTitle() function reads the bookmark's title. + + \snippet streambookmarks/xbelreader.cpp 4 + + The \c readSeparator() function creates a separator and sets its flags. + The text is set to 30 "0xB7", the HEX equivalent for period. The element + is then skipped using \l{QXmlStreamReader::}{skipCurrentElement()}. + + \snippet streambookmarks/xbelreader.cpp 5 + + \section1 MainWindow Class Definition + + The \c MainWindow class is a subclass of QMainWindow, with a + \c File menu and a \c Help menu. + + \snippet streambookmarks/mainwindow.h 0 + + \section1 MainWindow Class Implementation + + The \c MainWindow constructor instantiates the QTreeWidget object, \c + treeWidget and sets its header with a QStringList object, \c labels. + The constructor also invokes \c createActions() and \c createMenus() + to set up the menus and their corresponding actions. The \c statusBar() + is used to display the message "Ready" and the window's size is fixed + to 480x320 pixels. + + \snippet streambookmarks/mainwindow.cpp 0 + + The \c open() function enables the user to open an XBEL file using + QFileDialog::getOpenFileName(). A warning message is displayed along + with the \c fileName and \c errorString if the file cannot be read or + if there is a parse error. + + \snippet streambookmarks/mainwindow.cpp 1 + + The \c saveAs() function displays a QFileDialog, prompting the user for + a \c fileName using QFileDialog::getSaveFileName(). Similar to the + \c open() function, this function also displays a warning message if + the file cannot be written to. + + \snippet streambookmarks/mainwindow.cpp 2 + + The \c about() function displays a QMessageBox with a brief description + of the example. + + \snippet streambookmarks/mainwindow.cpp 3 + + In order to implement the \c open(), \c saveAs(), \c exit(), \c about() + and \c aboutQt() functions, we connect them to QAction objects and + add them to the \c fileMenu and \c helpMenu. The connections are as shown + below: + + \snippet streambookmarks/mainwindow.cpp 4 + + The \c createMenus() function creates the \c fileMenu and \c helpMenu + and adds the QAction objects to them in order to create the menu shown + in the screenshot below: + + \table + \row + \li \inlineimage xmlstreamexample-filemenu.png + \li \inlineimage xmlstreamexample-helpmenu.png + \endtable + + \snippet streambookmarks/mainwindow.cpp 5 + + \section1 \c{main()} Function + + The \c main() function instantiates \c MainWindow and invokes the \c show() + function. + + \snippet streambookmarks/main.cpp 0 + + See the \l{http://pyxml.sourceforge.net/topics/xbel/} + {XML Bookmark Exchange Language Resource Page} for more information + about XBEL files. +*/ diff --git a/examples/xml/doc/src/saxbookmarks.qdoc b/examples/xml/doc/src/saxbookmarks.qdoc index 9ed7611184..d45549bc1e 100644 --- a/examples/xml/doc/src/saxbookmarks.qdoc +++ b/examples/xml/doc/src/saxbookmarks.qdoc @@ -28,13 +28,14 @@ /*! \example saxbookmarks \title SAX Bookmarks Example + \brief Demonstrates how to read XBEL files + \ingroup xml-examples - \brief The SAX Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) - files that uses Qt's SAX-based API to read and parse the files. The DOM Bookmarks + This example uses Qt's SAX API to read and parse the files. The DOM Bookmarks example provides an alternative way to read this type of file. \image saxbookmarks-example.png See the \l{XML Bookmark Exchange Language Resource Page} for more - information about XBEL files. + information about XBEL files. */ -- cgit v1.2.3 From 41a503bb756124a69f99dd9241bf777b1eda762d Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 11 Dec 2012 08:48:09 +0100 Subject: Hardcoded url to RFC3174 QTBUG-28500 Corrected in torrent.qdoc Change-Id: Idb1bf1ed869c0db80e557832a61d6eb28585c77a Reviewed-by: Jerome Pasion --- examples/network/doc/src/torrent.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/network/doc/src/torrent.qdoc b/examples/network/doc/src/torrent.qdoc index 939ebcbc6b..4bd70eed97 100644 --- a/examples/network/doc/src/torrent.qdoc +++ b/examples/network/doc/src/torrent.qdoc @@ -39,7 +39,7 @@ \section1 License Information The implementation of the US Secure Hash Algorithm 1 (SHA1) in this example is - derived from the original description in \l{RFC 3174}. + derived from the original description in \l{http://www.rfc-editor.org/rfc/rfc3174.txt}{RFC 3174}. \legalese Copyright (C) The Internet Society (2001). All Rights Reserved. -- cgit v1.2.3 From b8d0bde59c00471b915c8f876e16fda9fd5f435e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Dec 2012 19:29:33 +0100 Subject: install a sane top-level examples.pro file generally, don't install anything from the top-level examples dirs automatically. the global README and the aggregator examples.pro are installed explicitly. Change-Id: I5f6b8760f37d917b800fa85979896a471778cac0 Reviewed-by: hjk Reviewed-by: Joerg Bornemann --- examples/aggregate/examples.pro | 6 ++++++ examples/examples.pro | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 examples/aggregate/examples.pro (limited to 'examples') diff --git a/examples/aggregate/examples.pro b/examples/aggregate/examples.pro new file mode 100644 index 0000000000..bf5e48fd59 --- /dev/null +++ b/examples/aggregate/examples.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs + +sd = $$files(*) +for(d, sd): \ + exists($$d/$${d}.pro): \ + SUBDIRS += $$d diff --git a/examples/examples.pro b/examples/examples.pro index db444b5d12..06ef0adcab 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -25,3 +25,9 @@ contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl contains(QT_CONFIG, dbus): SUBDIRS += dbus contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= linguist + +aggregate.files = aggregate/examples.pro +aggregate.path = $$[QT_INSTALL_EXAMPLES] +readme.files = README +readme.path = $$[QT_INSTALL_EXAMPLES] +INSTALLS += aggregate readme -- cgit v1.2.3 From 508db17de38b2940d95742319abcb84ee4ca8b86 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 11 Dec 2012 16:58:14 +0100 Subject: Some fixes to the OpenGL docs in GUI Change-Id: I6415ff16b1765a5814d50a4cd39db00495d43073 Reviewed-by: Paul Olav Tvete --- examples/gui/doc/images/openglwindow-example.png | Bin 0 -> 19920 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/gui/doc/images/openglwindow-example.png (limited to 'examples') diff --git a/examples/gui/doc/images/openglwindow-example.png b/examples/gui/doc/images/openglwindow-example.png new file mode 100644 index 0000000000..63ba4ed2f4 Binary files /dev/null and b/examples/gui/doc/images/openglwindow-example.png differ -- cgit v1.2.3 From e262f221aa706146b4c1349dc0ced3ea59108e18 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 12 Dec 2012 16:56:53 +0100 Subject: Docs: Fix references Change-Id: I48173186afb874d307010f4f303d0e4f97ec0287 Reviewed-by: Jerome Pasion --- examples/widgets/doc/src/plugandpaint.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc index 86fc202974..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. -- cgit v1.2.3 From 92bd9aecfb69ebe525ba88dc78ce85e3ca7ed9c2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 30 Nov 2012 19:37:02 +0100 Subject: Fix empty window title regression, add application display name to window title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This increases consistency a lot: all windows and dialogs from a Qt application will show the app display name in the caption, on Windows and X11. This helps identifying which app a dialog belongs to, which is especially useful when the dialog is very generic and shows up unexpectedly. For compatibility reasons, the app name is added to the caption only if setApplicationDisplayName() was called -- or if the caption would be completely empty. The standard Qt4 case (setWindowTitle + no display name) is unchanged. Change-Id: Ib284c62c1f4c0bc923e5bc2d10247d95e9aa76c1 Reviewed-by: Samuel Rødal --- examples/widgets/dialogs/configdialog/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'examples') 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(); } -- cgit v1.2.3 From 4d6bf271c799e0d31b674c76fda54c493ce641a8 Mon Sep 17 00:00:00 2001 From: Rick Stockton Date: Thu, 13 Dec 2012 22:46:54 -0800 Subject: Enhance example qtbase/examples/widgets/widgets/mousebuttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Display and QDebug() of Qt::MouseButtons values. (I.e., Buttons believed to be in 'Pressed' State by Qt.) Assists in platform plugin mouse software debug. Task-number: QTBUG-28603 Change-Id: I4a7a3ac44a8cc7eb1eceb9f348493b58b12dbd69 Reviewed-by: Oliver Wolff Reviewed-by: Samuel Rødal --- .../widgets/widgets/mousebuttons/buttontester.cpp | 56 +++++++++++++++++++--- .../widgets/widgets/mousebuttons/buttontester.h | 1 + examples/widgets/widgets/mousebuttons/main.cpp | 4 ++ 3 files changed, 55 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/widgets/widgets/mousebuttons/buttontester.cpp b/examples/widgets/widgets/mousebuttons/buttontester.cpp index 9a631b9fa2..c64bf76211 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.cpp +++ b/examples/widgets/widgets/mousebuttons/buttontester.cpp @@ -44,26 +44,35 @@ 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); } @@ -172,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 2f8db560f4..6db8993486 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.h +++ b/examples/widgets/widgets/mousebuttons/buttontester.h @@ -61,6 +61,7 @@ protected: #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"); -- cgit v1.2.3 From a0a4c06736a71fedb69f01c1c4c423173a2a665e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 12 Dec 2012 14:15:38 +0100 Subject: Doc: remove example docs that were moved to qttools Remove docs and images for Multiple Inheritance and Text Finder examples that were moved to qttools/uitools. Change-Id: I29e8f76b2512e329c354a6d3676c9b2e09e35726 Reviewed-by: Friedemann Kleint Reviewed-by: David Schulz --- examples/tools/doc/textfinder.qdoc | 159 --------------------- .../images/textfinder-example-userinterface.png | Bin 7900 -> 0 bytes 2 files changed, 159 deletions(-) delete mode 100644 examples/tools/doc/textfinder.qdoc delete mode 100644 examples/widgets/doc/images/textfinder-example-userinterface.png (limited to 'examples') diff --git a/examples/tools/doc/textfinder.qdoc b/examples/tools/doc/textfinder.qdoc deleted file mode 100644 index f958cf8623..0000000000 --- a/examples/tools/doc/textfinder.qdoc +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** 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 uitools/textfinder - \title Text Finder Example - - \brief The Text Finder example demonstrates how to dynamically process forms - using the QtUiTools module. Dynamic form processing enables a form to - be processed at run-time only by changing the UI file for the project. - The program allows the user to look up a particular word within the - contents of a text file. This text file is included in the project's - resource and is loaded into the display at startup. - - \table - \row \li \inlineimage textfinder-example-find.png - \li \inlineimage textfinder-example-find2.png - \endtable - - \section1 Setting Up The Resource File - - The resources required for Text Finder are: - \list - \li \e{textfinder.ui} - the user interface file created in QtDesigner - \li \e{input.txt} - a text file containing some text to be displayed - in the QTextEdit - \endlist - - \e{textfinder.ui} contains all the necessary QWidget objects for the - Text Finder. A QLineEdit is used for the user input, a QTextEdit is - used to display the contents of \e{input.txt}, a QLabel is used to - display the text "Keyword", and a QPushButton is used for the "Find" - button. The screenshot below shows the preview obtained in QtDesigner. - - \image textfinder-example-userinterface.png - - A \e{textfinder.qrc} file is used to store both the \e{textfinder.ui} - and \e{input.txt} in the application's executable. The file contains - the following code: - - \quotefile examples/uitools/textfinder/textfinder.qrc - - For more information on resource files, see \l{The Qt Resource System}. - - To generate a form at run-time, the example is linked against the - QtUiTools module library. This is done in the \c{textfinder.pro} file - that contains the following lines: - - \snippet doc/src/snippets/code/doc_src_examples_textfinder.pro 0 - - \section1 TextFinder Class Definition - - The \c TextFinder class is a subclass of QWidget and it hosts the - \l{QWidget}s we need to access in the user interface. The QLabel in the - user interface is not declared here as we do not need to access it. - - \snippet examples/uitools/textfinder/textfinder.h 0 - - The slot \c{on_findButton_clicked()} is a slot named according to the - \l{Using a Designer UI File in Your Application#Automatic Connections} - {Automatic Connection} naming convention required - by \c uic. - - \section1 TextFinder Class Implementation - - The \c TextFinder class's constructor calls the \c loadUiFile() function - and then uses \c qFindChild() to access the user interface's - \l{QWidget}s. - - \snippet examples/uitools/textfinder/textfinder.cpp 0 - - We then use QMetaObject's system to enable signal and slot connections. - - \snippet examples/uitools/textfinder/textfinder.cpp 2 - - The loadTextFile() function is called to load \c{input.txt} into - QTextEdit to displays its contents. - - \snippet examples/uitools/textfinder/textfinder.cpp 3a - - The \c{TextFinder}'s layout is set with \l{QWidget::}{setLayout()}. - - \snippet examples/uitools/textfinder/textfinder.cpp 3b - - Finally, the window title is set to \e {Text Finder} and \c isFirstTime is - set to true. - - \c isFirstTime is used as a flag to indicate whether the search operation - has been performed more than once. This is further explained with the - \c{on_findButton_clicked()} function. - - The \c{loadUiFile()} function is used to load the user interface file - previously created in QtDesigner. The QUiLoader class is instantiated - and its \c load() function is used to load the form into \c{formWidget} - that acts as a place holder for the user interface. The function then - returns \c{formWidget} to its caller. - - \snippet examples/uitools/textfinder/textfinder.cpp 4 - - As mentioned earlier, the loadTextFile() function loads \e{input.txt} - into QTextEdit to display its contents. Data is read using QTextStream - into a QString object, \c line with the QTextStream::readAll() function. - The contents of \c line are then appended to \c{ui_textEdit}. - - \snippet examples/uitools/textfinder/textfinder.cpp 5 - - The \c{on_findButton_clicked()} function is a slot that is connected to - \c{ui_findButton}'s \c clicked() signal. The \c searchString is extracted - from the \c ui_lineEdit and the \c document is extracted from \c textEdit. - In event there is an empty \c searchString, a QMessageBox is used, - requesting the user to enter a word. Otherwise, we traverse through the - words in \c ui_textEdit, and highlight all ocurrences of the - \c searchString . Two QTextCursor objects are used: One to traverse through - the words in \c line and another to keep track of the edit blocks. - - \snippet examples/uitools/textfinder/textfinder.cpp 7 - - The \c isFirstTime flag is set to false the moment \c findButton is - clicked. This is necessary to undo the previous text highlight before - highlighting the user's next search string. Also, the \c found flag - is used to indicate if the \c searchString was found within the contents - of \c ui_textEdit. If it was not found, a QMessageBox is used - to inform the user. - - \snippet examples/uitools/textfinder/textfinder.cpp 9 - - \section1 \c main() Function - - \snippet examples/uitools/textfinder/main.cpp 0 - - The \c main() function initialises the \e{textfinder.qrc} resource file - and instantiates as well as displays \c TextFinder. - - \sa {Calculator Builder Example}, {World Time Clock Builder Example} - */ diff --git a/examples/widgets/doc/images/textfinder-example-userinterface.png b/examples/widgets/doc/images/textfinder-example-userinterface.png deleted file mode 100644 index 2bebe2e9dd..0000000000 Binary files a/examples/widgets/doc/images/textfinder-example-userinterface.png and /dev/null differ -- cgit v1.2.3 From d64c4662f01ffc94c68e7c9f7abdb6309e67e489 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 12 Dec 2012 11:20:30 +0100 Subject: QtBase: Removed moved linguist examples. Linguist examples are now in qttools. Change-Id: I8abfff50d81cda143a080711bf9583e7be777009 Reviewed-by: Leena Miettinen --- examples/examples.pro | 2 - examples/ja_JP/linguist/hellotr/hellotr.pro | 11 ---- examples/ja_JP/linguist/hellotr/main.cpp | 70 -------------------- examples/linguist/README | 6 -- examples/linguist/arrowpad/arrowpad.cpp | 64 ------------------ examples/linguist/arrowpad/arrowpad.h | 68 ------------------- examples/linguist/arrowpad/arrowpad.pro | 18 ----- examples/linguist/arrowpad/main.cpp | 63 ------------------ examples/linguist/arrowpad/mainwindow.cpp | 61 ----------------- examples/linguist/arrowpad/mainwindow.h | 68 ------------------- examples/linguist/hellotr/hellotr.pro | 13 ---- examples/linguist/hellotr/main.cpp | 70 -------------------- examples/linguist/linguist.pro | 6 -- examples/linguist/trollprint/main.cpp | 60 ----------------- examples/linguist/trollprint/mainwindow.cpp | 95 --------------------------- examples/linguist/trollprint/mainwindow.h | 74 --------------------- examples/linguist/trollprint/printpanel.cpp | 85 ------------------------ examples/linguist/trollprint/printpanel.h | 69 ------------------- examples/linguist/trollprint/trollprint.pro | 14 ---- examples/linguist/trollprint/trollprint_pt.ts | 65 ------------------ 20 files changed, 982 deletions(-) delete mode 100644 examples/ja_JP/linguist/hellotr/hellotr.pro delete mode 100644 examples/ja_JP/linguist/hellotr/main.cpp delete mode 100644 examples/linguist/README delete mode 100644 examples/linguist/arrowpad/arrowpad.cpp delete mode 100644 examples/linguist/arrowpad/arrowpad.h delete mode 100644 examples/linguist/arrowpad/arrowpad.pro delete mode 100644 examples/linguist/arrowpad/main.cpp delete mode 100644 examples/linguist/arrowpad/mainwindow.cpp delete mode 100644 examples/linguist/arrowpad/mainwindow.h delete mode 100644 examples/linguist/hellotr/hellotr.pro delete mode 100644 examples/linguist/hellotr/main.cpp delete mode 100644 examples/linguist/linguist.pro delete mode 100644 examples/linguist/trollprint/main.cpp delete mode 100644 examples/linguist/trollprint/mainwindow.cpp delete mode 100644 examples/linguist/trollprint/mainwindow.h delete mode 100644 examples/linguist/trollprint/printpanel.cpp delete mode 100644 examples/linguist/trollprint/printpanel.h delete mode 100644 examples/linguist/trollprint/trollprint.pro delete mode 100644 examples/linguist/trollprint/trollprint_pt.ts (limited to 'examples') diff --git a/examples/examples.pro b/examples/examples.pro index 06ef0adcab..e1c3611836 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -11,7 +11,6 @@ SUBDIRS = \ !contains(QT_CONFIG, no-widgets) { SUBDIRS += widgets \ ipc \ - linguist \ sql \ tools \ touch \ @@ -24,7 +23,6 @@ contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl contains(QT_CONFIG, dbus): SUBDIRS += dbus contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent -contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= linguist aggregate.files = aggregate/examples.pro aggregate.path = $$[QT_INSTALL_EXAMPLES] diff --git a/examples/ja_JP/linguist/hellotr/hellotr.pro b/examples/ja_JP/linguist/hellotr/hellotr.pro deleted file mode 100644 index e4a1ee11bb..0000000000 --- a/examples/ja_JP/linguist/hellotr/hellotr.pro +++ /dev/null @@ -1,11 +0,0 @@ -#! [0] -SOURCES = main.cpp -#! [0] #! [1] -TRANSLATIONS = hellotr_ja.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr -INSTALLS += target - -QT += widgets diff --git a/examples/ja_JP/linguist/hellotr/main.cpp b/examples/ja_JP/linguist/hellotr/main.cpp deleted file mode 100644 index df4546f4b5..0000000000 --- a/examples/ja_JP/linguist/hellotr/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -//! [0] -#include -//! [0] - -//! [1] //! [2] -int main(int argc, char *argv[]) -//! [1] //! [3] //! [4] -{ - QApplication app(argc, argv); -//! [3] - -//! [5] - QTranslator translator; -//! [5] //! [6] - translator.load("hellotr_ja"); -//! [6] //! [7] - app.installTranslator(&translator); -//! [4] //! [7] - -//! [8] - QPushButton hello(QPushButton::tr("Hello world!")); -//! [8] - hello.resize(100, 30); - - hello.show(); - return app.exec(); -} -//! [2] diff --git a/examples/linguist/README b/examples/linguist/README deleted file mode 100644 index 15817742da..0000000000 --- a/examples/linguist/README +++ /dev/null @@ -1,6 +0,0 @@ -Internationalization is a core feature of Qt. These examples show how to -access translation and localization facilities at run-time. - - -Documentation for these examples can be found via the Examples -link in the main Qt documentation. diff --git a/examples/linguist/arrowpad/arrowpad.cpp b/examples/linguist/arrowpad/arrowpad.cpp deleted file mode 100644 index 7b33238295..0000000000 --- a/examples/linguist/arrowpad/arrowpad.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "arrowpad.h" - -ArrowPad::ArrowPad(QWidget *parent) - : QWidget(parent) -{ -//! [0] - upButton = new QPushButton(tr("&Up")); -//! [0] //! [1] - downButton = new QPushButton(tr("&Down")); -//! [1] //! [2] - leftButton = new QPushButton(tr("&Left")); -//! [2] //! [3] - rightButton = new QPushButton(tr("&Right")); -//! [3] - - QGridLayout *mainLayout = new QGridLayout; - mainLayout->addWidget(upButton, 0, 1); - mainLayout->addWidget(leftButton, 1, 0); - mainLayout->addWidget(rightButton, 1, 2); - mainLayout->addWidget(downButton, 2, 1); - setLayout(mainLayout); -} diff --git a/examples/linguist/arrowpad/arrowpad.h b/examples/linguist/arrowpad/arrowpad.h deleted file mode 100644 index 30ebf98e92..0000000000 --- a/examples/linguist/arrowpad/arrowpad.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ARROWPAD_H -#define ARROWPAD_H - -#include - -QT_BEGIN_NAMESPACE -class QPushButton; -QT_END_NAMESPACE - -//! [0] -class ArrowPad : public QWidget -//! [0] //! [1] -{ -//! [1] //! [2] - Q_OBJECT -//! [2] - -public: - ArrowPad(QWidget *parent = 0); - -private: - QPushButton *upButton; - QPushButton *downButton; - QPushButton *leftButton; - QPushButton *rightButton; -}; - -#endif diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro deleted file mode 100644 index 3b5916684b..0000000000 --- a/examples/linguist/arrowpad/arrowpad.pro +++ /dev/null @@ -1,18 +0,0 @@ -#! [0] -HEADERS = arrowpad.h \ - mainwindow.h -SOURCES = arrowpad.cpp \ - main.cpp \ - mainwindow.cpp -#! [0] #! [1] -TRANSLATIONS = arrowpad_fr.ts \ - arrowpad_nl.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/arrowpad/main.cpp b/examples/linguist/arrowpad/main.cpp deleted file mode 100644 index c43b17556f..0000000000 --- a/examples/linguist/arrowpad/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" - -//! [0] -int main(int argc, char *argv[]) -//! [0] //! [1] -{ - QApplication app(argc, argv); - - QString locale = QLocale::system().name(); - -//! [2] - QTranslator translator; -//! [2] //! [3] - translator.load(QString("arrowpad_") + locale); - app.installTranslator(&translator); -//! [1] //! [3] - - MainWindow mainWindow; - mainWindow.show(); - return app.exec(); -} diff --git a/examples/linguist/arrowpad/mainwindow.cpp b/examples/linguist/arrowpad/mainwindow.cpp deleted file mode 100644 index 75a489e518..0000000000 --- a/examples/linguist/arrowpad/mainwindow.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "arrowpad.h" -#include "mainwindow.h" - -MainWindow::MainWindow() -{ -//! [0] - arrowPad = new ArrowPad; -//! [0] - setCentralWidget(arrowPad); - -//! [1] - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcuts(QKeySequence::Quit); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); -//! [1] - - fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(exitAct); -} diff --git a/examples/linguist/arrowpad/mainwindow.h b/examples/linguist/arrowpad/mainwindow.h deleted file mode 100644 index 7ccac6ac59..0000000000 --- a/examples/linguist/arrowpad/mainwindow.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -QT_END_NAMESPACE -class ArrowPad; - -//! [0] -class MainWindow : public QMainWindow -//! [0] //! [1] -{ - Q_OBJECT -//! [1] - -public: - MainWindow(); - -private: - ArrowPad *arrowPad; - QMenu *fileMenu; - QAction *exitAct; -}; - -#endif diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro deleted file mode 100644 index 38e5a5b366..0000000000 --- a/examples/linguist/hellotr/hellotr.pro +++ /dev/null @@ -1,13 +0,0 @@ -#! [0] -SOURCES = main.cpp -#! [0] #! [1] -TRANSLATIONS = hellotr_la.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/hellotr/main.cpp b/examples/linguist/hellotr/main.cpp deleted file mode 100644 index 12433f8414..0000000000 --- a/examples/linguist/hellotr/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -//! [0] -#include -//! [0] - -//! [1] //! [2] -int main(int argc, char *argv[]) -//! [1] //! [3] //! [4] -{ - QApplication app(argc, argv); -//! [3] - -//! [5] - QTranslator translator; -//! [5] //! [6] - translator.load("hellotr_la"); -//! [6] //! [7] - app.installTranslator(&translator); -//! [4] //! [7] - -//! [8] - QPushButton hello(QPushButton::tr("Hello world!")); -//! [8] - hello.resize(100, 30); - - hello.show(); - return app.exec(); -} -//! [2] diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro deleted file mode 100644 index 6109ef0045..0000000000 --- a/examples/linguist/linguist.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = arrowpad \ - hellotr \ - trollprint - -QT += widgets diff --git a/examples/linguist/trollprint/main.cpp b/examples/linguist/trollprint/main.cpp deleted file mode 100644 index 9438d987b2..0000000000 --- a/examples/linguist/trollprint/main.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QString locale = QLocale::system().name(); - -//! [0] - QTranslator translator; - translator.load(QString("trollprint_") + locale); - app.installTranslator(&translator); -//! [0] - - MainWindow mainWindow; - mainWindow.show(); - return app.exec(); -} diff --git a/examples/linguist/trollprint/mainwindow.cpp b/examples/linguist/trollprint/mainwindow.cpp deleted file mode 100644 index d98aba6f3d..0000000000 --- a/examples/linguist/trollprint/mainwindow.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" -#include "printpanel.h" - -MainWindow::MainWindow() -{ - printPanel = new PrintPanel; - setCentralWidget(printPanel); - - createActions(); - createMenus(); - -//! [0] - setWindowTitle(tr("Troll Print 1.0")); -//! [0] -} - -void MainWindow::about() -{ - QMessageBox::information(this, tr("About Troll Print 1.0"), - tr("Troll Print 1.0.\n\n" - "Copyright 1999 Software, Inc.")); -} - -//! [1] -void MainWindow::createActions() -{ -//! [2] - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcut(tr("Ctrl+Q", "Quit")); -//! [2] - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - - aboutAct = new QAction(tr("&About"), this); - aboutAct->setShortcut(Qt::Key_F1); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); - - aboutQtAct = new QAction(tr("About &Qt"), this); - connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); -} - -void MainWindow::createMenus() -//! [1] //! [3] -{ - QMenu *fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(exitAct); - - menuBar()->addSeparator(); - - QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); - helpMenu->addAction(aboutAct); - helpMenu->addAction(aboutQtAct); -} -//! [3] diff --git a/examples/linguist/trollprint/mainwindow.h b/examples/linguist/trollprint/mainwindow.h deleted file mode 100644 index d55d6fb897..0000000000 --- a/examples/linguist/trollprint/mainwindow.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -QT_END_NAMESPACE -class PrintPanel; - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - -private slots: - void about(); - -private: - void createActions(); - void createMenus(); - - PrintPanel *printPanel; - QMenu *fileMenu; - QMenu *helpMenu; - QAction *exitAct; - QAction *aboutAct; - QAction *aboutQtAct; -}; - -#endif diff --git a/examples/linguist/trollprint/printpanel.cpp b/examples/linguist/trollprint/printpanel.cpp deleted file mode 100644 index 163fc6de11..0000000000 --- a/examples/linguist/trollprint/printpanel.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "printpanel.h" - -//! [0] -PrintPanel::PrintPanel(QWidget *parent) - : QWidget(parent) -{ -/* - QLabel *label = new QLabel(tr("TROLL PRINT")); - label->setAlignment(Qt::AlignCenter); -*/ -//! [0] - -//! [1] - twoSidedGroupBox = new QGroupBox(tr("2-sided")); - twoSidedEnabledRadio = new QRadioButton(tr("Enabled")); - twoSidedDisabledRadio = new QRadioButton(tr("Disabled")); -//! [1] //! [2] - twoSidedDisabledRadio->setChecked(true); - - colorsGroupBox = new QGroupBox(tr("Colors")); - colorsEnabledRadio = new QRadioButton(tr("Enabled")); - colorsDisabledRadio = new QRadioButton(tr("Disabled")); -//! [2] - colorsDisabledRadio->setChecked(true); - - QHBoxLayout *twoSidedLayout = new QHBoxLayout; - twoSidedLayout->addWidget(twoSidedEnabledRadio); - twoSidedLayout->addWidget(twoSidedDisabledRadio); - twoSidedGroupBox->setLayout(twoSidedLayout); - - QHBoxLayout *colorsLayout = new QHBoxLayout; - colorsLayout->addWidget(colorsEnabledRadio); - colorsLayout->addWidget(colorsDisabledRadio); - colorsGroupBox->setLayout(colorsLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; -/* - mainLayout->addWidget(label); -*/ - mainLayout->addWidget(twoSidedGroupBox); - mainLayout->addWidget(colorsGroupBox); - setLayout(mainLayout); -} diff --git a/examples/linguist/trollprint/printpanel.h b/examples/linguist/trollprint/printpanel.h deleted file mode 100644 index a773a29700..0000000000 --- a/examples/linguist/trollprint/printpanel.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PRINTPANEL_H -#define PRINTPANEL_H - -#include - -QT_BEGIN_NAMESPACE -class QGroupBox; -class QRadioButton; -QT_END_NAMESPACE - -//! [0] -class PrintPanel : public QWidget -{ - Q_OBJECT -//! [0] - -public: - PrintPanel(QWidget *parent = 0); - -private: - QGroupBox *twoSidedGroupBox; - QGroupBox *colorsGroupBox; - QRadioButton *twoSidedEnabledRadio; - QRadioButton *twoSidedDisabledRadio; - QRadioButton *colorsEnabledRadio; - QRadioButton *colorsDisabledRadio; -}; - -#endif diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro deleted file mode 100644 index f4f60c41cf..0000000000 --- a/examples/linguist/trollprint/trollprint.pro +++ /dev/null @@ -1,14 +0,0 @@ -HEADERS = mainwindow.h \ - printpanel.h -SOURCES = main.cpp \ - mainwindow.cpp \ - printpanel.cpp -TRANSLATIONS = trollprint_pt.ts - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/trollprint/trollprint_pt.ts b/examples/linguist/trollprint/trollprint_pt.ts deleted file mode 100644 index e5871bd087..0000000000 --- a/examples/linguist/trollprint/trollprint_pt.ts +++ /dev/null @@ -1,65 +0,0 @@ - - - MainWindow - - Troll Print 1.0 - Troll Imprimir 1.0 - - - E&xit - &Sair - - - &About - &Sobre - - - About &Qt - Sobre &Qt - - - &File - &Arquivo - - - &Help - A&juda - - - About Troll Print 1.0 - Sobre Troll Imprimir 1.0 - - - Troll Print 1.0. - -Copyright 1999 Software, Inc. - Troll Imprimir 1.0 - -Copyright 1999 Software, Inc. - - - Ctrl+Q - Quit - Ctrl+Q - - - - PrintPanel - - 2-sided - 2-lados - - - Enabled - Ativado - - - Disabled - Desativado - - - Colors - Cores - - - -- cgit v1.2.3 From 5a8a1eb4afffd2e23f5392a21727713a334dbd3a Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 10 Dec 2012 15:35:44 +0100 Subject: Entered hardcoded url workaround QTBUG-28500 Url for OpenGL Registry Url for Khronos OpenGL ES API Registry Change-Id: I682ddcedf1e06d589e5c44e364936c78fd9219a5 Reviewed-by: Jerome Pasion --- examples/gui/doc/openglwindow.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/gui/doc/openglwindow.qdoc b/examples/gui/doc/openglwindow.qdoc index f5af944a31..d26fd477af 100644 --- a/examples/gui/doc/openglwindow.qdoc +++ b/examples/gui/doc/openglwindow.qdoc @@ -105,8 +105,8 @@ QOpenGLContext::functions(). QOpenGLFunctions gives access to all the OpenGL ES 2.0 level OpenGL calls that are not already standard in both OpenGL ES 2.0 and desktop OpenGL. For more information about the OpenGL and - OpenGL ES APIs, refer to the official \l{OpenGL Registry} and - \l{Khronos OpenGL ES API Registry}. + OpenGL ES APIs, refer to the official \l{http://www.opengl.org/registry/}{OpenGL Registry} and + \l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}. If animation has been enabled with OpenGLWindow::setAnimating(true), we call renderLater() to put another update request on the event loop. -- cgit v1.2.3 From 834359cc66d1fe5623d490c72ba6e597aca9015e Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 11 Dec 2012 18:53:10 +0100 Subject: Doc: Added documentation for dbus and touch examples Change-Id: I68b6679e1f3454d93081136a77fc5462e434b61e Reviewed-by: Jerome Pasion --- .../doc/images/remotecontrolledcar-car-example.png | Bin 0 -> 8833 bytes .../doc/src/dbus-remotecontrolledcar.qdoc | 36 +++++++++++++++++++ .../touch/dials/doc/images/touch-dials-example.png | Bin 0 -> 17676 bytes examples/touch/dials/doc/src/touch-dials.qdoc | 38 +++++++++++++++++++++ .../touch/knobs/doc/images/touch-knobs-example.png | Bin 0 -> 1290 bytes examples/touch/knobs/doc/src/touch-knobs.qdoc | 38 +++++++++++++++++++++ 6 files changed, 112 insertions(+) create mode 100644 examples/dbus/remotecontrolledcar/doc/images/remotecontrolledcar-car-example.png create mode 100644 examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc create mode 100644 examples/touch/dials/doc/images/touch-dials-example.png create mode 100644 examples/touch/dials/doc/src/touch-dials.qdoc create mode 100644 examples/touch/knobs/doc/images/touch-knobs-example.png create mode 100644 examples/touch/knobs/doc/src/touch-knobs.qdoc (limited to 'examples') diff --git a/examples/dbus/remotecontrolledcar/doc/images/remotecontrolledcar-car-example.png b/examples/dbus/remotecontrolledcar/doc/images/remotecontrolledcar-car-example.png new file mode 100644 index 0000000000..7e08340c80 Binary files /dev/null and b/examples/dbus/remotecontrolledcar/doc/images/remotecontrolledcar-car-example.png differ diff --git a/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc b/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc new file mode 100644 index 0000000000..05c750803e --- /dev/null +++ b/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** 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 dbus/remotecontrolledcar + \title D-Bus Remote Controlled Car Example + + The Remote Controlled Car example shows how to use D-Bus to control one + application using another. + + \image remotecontrolledcar-car-example.png +*/ diff --git a/examples/touch/dials/doc/images/touch-dials-example.png b/examples/touch/dials/doc/images/touch-dials-example.png new file mode 100644 index 0000000000..60e1776fc3 Binary files /dev/null and b/examples/touch/dials/doc/images/touch-dials-example.png differ diff --git a/examples/touch/dials/doc/src/touch-dials.qdoc b/examples/touch/dials/doc/src/touch-dials.qdoc new file mode 100644 index 0000000000..c18d068e3f --- /dev/null +++ b/examples/touch/dials/doc/src/touch-dials.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 touch/dials + \title Touch Dials Example + \ingroup touchinputexamples + \brief Shows how to apply touch to a set of standard Qt widgets + + The Touch Dials example shows how to apply touch to a set of + standard Qt widgets. + + \image touch-dials-example.png +*/ diff --git a/examples/touch/knobs/doc/images/touch-knobs-example.png b/examples/touch/knobs/doc/images/touch-knobs-example.png new file mode 100644 index 0000000000..1cbd90d101 Binary files /dev/null and b/examples/touch/knobs/doc/images/touch-knobs-example.png differ diff --git a/examples/touch/knobs/doc/src/touch-knobs.qdoc b/examples/touch/knobs/doc/src/touch-knobs.qdoc new file mode 100644 index 0000000000..548b0bad05 --- /dev/null +++ b/examples/touch/knobs/doc/src/touch-knobs.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 touch/knobs + \title Touch Knobs Example + \ingroup touchinputexamples + \brief Shows how to create custom controls that accept touch input + + The Touch Knobs example shows how to create custom controls that + accept touch input. + + \image touch-knobs-example.png +*/ -- cgit v1.2.3 From 1ac5d97800ffa7441b3a5df220e0334aab557c10 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 12 Dec 2012 12:22:42 +0100 Subject: Entered hardcoded url to XaoS as a workaround Symbel from external-resource.qdoc not working, so replace it with the url. Corrected in mandelbrot.qdoc Task-number : QTBUG-27512 Change-Id: Ibf54bf707deb73f1cf22d347839dcd347382ecd9 Reviewed-by: Jerome Pasion --- examples/threads/doc/src/mandelbrot.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index 8ef8d0b01a..02da084810 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -37,7 +37,7 @@ The heavy computation here is the Mandelbrot set, probably the world's most famous fractal. These days, while sophisticated - programs such as \l{XaoS} that provide real-time zooming in the + programs such as \l{http://xaos.sourceforge.net/}{XaoS} that provide real-time zooming in the Mandelbrot set, the standard Mandelbrot algorithm is just slow enough for our purposes. -- cgit v1.2.3 From eaa31066bc159829d35d9b4099d42355cec3dae1 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Wed, 12 Dec 2012 16:32:44 +0100 Subject: D-Bus Examples: added qdoc files and path Change-Id: I59b3db3f3c5d076b60a2e6f909d7919d5126a1e6 Reviewed-by: hjk Reviewed-by: Jerome Pasion --- examples/dbus/doc/src/chat.qdoc | 31 ++++++++++++++++++++++++++ examples/dbus/doc/src/complexpingpong.qdoc | 31 ++++++++++++++++++++++++++ examples/dbus/doc/src/listnames.qdoc | 31 ++++++++++++++++++++++++++ examples/dbus/doc/src/pingpong.qdoc | 31 ++++++++++++++++++++++++++ examples/dbus/doc/src/remotecontrolledcar.qdoc | 31 ++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 examples/dbus/doc/src/chat.qdoc create mode 100644 examples/dbus/doc/src/complexpingpong.qdoc create mode 100644 examples/dbus/doc/src/listnames.qdoc create mode 100644 examples/dbus/doc/src/pingpong.qdoc create mode 100644 examples/dbus/doc/src/remotecontrolledcar.qdoc (limited to 'examples') diff --git a/examples/dbus/doc/src/chat.qdoc b/examples/dbus/doc/src/chat.qdoc new file mode 100644 index 0000000000..b06338d87e --- /dev/null +++ b/examples/dbus/doc/src/chat.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** 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 chat + \title D-Bus Chat Example +*/ diff --git a/examples/dbus/doc/src/complexpingpong.qdoc b/examples/dbus/doc/src/complexpingpong.qdoc new file mode 100644 index 0000000000..60b0e10feb --- /dev/null +++ b/examples/dbus/doc/src/complexpingpong.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** 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 complexpingpong + \title D-Bus Complex Ping Pong Example +*/ diff --git a/examples/dbus/doc/src/listnames.qdoc b/examples/dbus/doc/src/listnames.qdoc new file mode 100644 index 0000000000..e5dc2671dd --- /dev/null +++ b/examples/dbus/doc/src/listnames.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** 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 listnames + \title D-Bus List Names Example +*/ diff --git a/examples/dbus/doc/src/pingpong.qdoc b/examples/dbus/doc/src/pingpong.qdoc new file mode 100644 index 0000000000..f16ecb9c98 --- /dev/null +++ b/examples/dbus/doc/src/pingpong.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** 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 pingpong + \title D-Bus Ping Pong Example +*/ diff --git a/examples/dbus/doc/src/remotecontrolledcar.qdoc b/examples/dbus/doc/src/remotecontrolledcar.qdoc new file mode 100644 index 0000000000..cb91ac28b6 --- /dev/null +++ b/examples/dbus/doc/src/remotecontrolledcar.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** 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 remotecontrolledcar + \title D-Bus Remote Controlled Car Example +*/ -- cgit v1.2.3 From 127f9e109869897c144d86be3a7999a2e1b4dea7 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Dec 2012 16:27:17 +0100 Subject: Fix mandlebrot and imagescaling example qdoc markup. Change-Id: I5c9802cab917203092d93fca73b166d2dfeb64bc Reviewed-by: Jerome Pasion --- .../imagescaling/doc/src/qtconcurrent-imagescaling.qdoc | 5 ++--- examples/threads/doc/src/mandelbrot.qdoc | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc index 4cf07e8edb..c270bda102 100644 --- a/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc +++ b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc @@ -28,11 +28,10 @@ /*! \example qtconcurrent/imagescaling \title Image Scaling Example - \bried Demonstrates how to asynchronously scale images. + \brief Demonstrates how to asynchronously scale images. \ingroup qtconcurrentexamples + \image imagescaling_example.png The QtConcurrent Map example shows how to use the asynchronous QtConcurrent API to load and scale a collection of images. - - \image imagescaling_example.png */ diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index 02da084810..6ca0909f12 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -28,21 +28,21 @@ /*! \example mandelbrot \title Mandelbrot Example - \brief Demonstrates multi-thread programming using Qt \ingroup qtconcurrent-mtexamples - \brief The Mandelbrot example shows how to use a worker thread to + \brief The Mandelbrot example demonstrates multi-thread programming + using Qt. It shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop. + \image mandelbrot-example.png Screenshot of the Mandelbrot example + The heavy computation here is the Mandelbrot set, probably the world's most famous fractal. These days, while sophisticated programs such as \l{http://xaos.sourceforge.net/}{XaoS} that provide real-time zooming in the Mandelbrot set, the standard Mandelbrot algorithm is just slow enough for our purposes. - \image mandelbrot-example.png Screenshot of the Mandelbrot example - In real life, the approach described here is applicable to a large set of problems, including synchronous network I/O and database access, where the user interface must remain responsive -- cgit v1.2.3 From 63693430c7cb8e8ede611eb9e99f305370d11ff9 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 17 Dec 2012 12:43:26 +0100 Subject: OpenGL examples: Add error message about ANGLE on Windows These OpenGL examples require a Desktop OpenGL and will not build with OpenGL ES 2.0. This means those examples do not build on Windows with the default configuration using ANGLE. ANGLE is wrapping OpenGL ES 2.0 to DirectX and does not support the full Desktop OpenGL feature set. Since this is confusing for Windows users that do not know about ANGLE this patch adds an explicit error message describing the solution. (configuring Qt with -opengl desktop) Task-number: QTBUG-28590 Change-Id: I782e6830b9e282ddcc8a2ee0a47faf3579d36aab Reviewed-by: hjk Reviewed-by: Oswald Buddenhagen --- examples/opengl/framebufferobject2/framebufferobject2.pro | 6 ++++++ examples/opengl/grabber/grabber.pro | 6 ++++++ examples/opengl/hellogl/hellogl.pro | 6 ++++++ examples/opengl/overpainting/overpainting.pro | 6 ++++++ examples/opengl/pbuffers/pbuffers.pro | 6 ++++++ examples/opengl/pbuffers2/pbuffers2.pro | 6 ++++++ examples/opengl/samplebuffers/samplebuffers.pro | 6 ++++++ 7 files changed, 42 insertions(+) (limited to 'examples') diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro index d26751ab0e..3a0dbb4446 100644 --- a/examples/opengl/framebufferobject2/framebufferobject2.pro +++ b/examples/opengl/framebufferobject2/framebufferobject2.pro @@ -10,3 +10,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro index a60dbbe2dc..c4c54c7c32 100644 --- a/examples/opengl/grabber/grabber.pro +++ b/examples/opengl/grabber/grabber.pro @@ -11,3 +11,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro index acaca35635..42913835a2 100644 --- a/examples/opengl/hellogl/hellogl.pro +++ b/examples/opengl/hellogl/hellogl.pro @@ -16,3 +16,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro index 08fe9b3dae..141c8cb7ce 100644 --- a/examples/opengl/overpainting/overpainting.pro +++ b/examples/opengl/overpainting/overpainting.pro @@ -15,3 +15,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro index 1a9882c45d..57bb3aa32a 100644 --- a/examples/opengl/pbuffers/pbuffers.pro +++ b/examples/opengl/pbuffers/pbuffers.pro @@ -11,3 +11,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro index 31fd22cced..c53309d1fa 100644 --- a/examples/opengl/pbuffers2/pbuffers2.pro +++ b/examples/opengl/pbuffers2/pbuffers2.pro @@ -9,3 +9,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2 INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro index 5793ea3e68..d16993adfe 100644 --- a/examples/opengl/samplebuffers/samplebuffers.pro +++ b/examples/opengl/samplebuffers/samplebuffers.pro @@ -9,3 +9,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} -- cgit v1.2.3 From 09331062bb705e5778f346b701a38454905ec1e0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2012 19:17:20 +0100 Subject: remove some unnecessary CONFIG additions qt is already added by spec_pre.prf, warn_on and depend_includepath by default_pre.prf. Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093 Reviewed-by: Joerg Bornemann --- .../widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro | 1 - .../widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro | 1 - examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro | 1 - examples/widgets/itemviews/interview/interview.pro | 1 - examples/widgets/itemviews/simpledommodel/simpledommodel.pro | 1 - examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro | 1 - examples/widgets/richtext/textedit/textedit.pro | 2 -- 7 files changed, 8 deletions(-) (limited to 'examples') diff --git a/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro index 6c0924cf7f..7390cec23f 100644 --- a/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro +++ b/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro @@ -1,7 +1,6 @@ HEADERS = window.h SOURCES = main.cpp \ window.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/basicsortfiltermodel diff --git a/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro index 66ea1063c8..488a755b9d 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro +++ b/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro @@ -3,7 +3,6 @@ HEADERS = mysortfilterproxymodel.h \ SOURCES = main.cpp \ mysortfilterproxymodel.cpp \ window.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/customsortfiltermodel diff --git a/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro b/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro index fcbdfd997f..a83b6fc5bf 100644 --- a/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro +++ b/examples/widgets/itemviews/editabletreemodel/editabletreemodel.pro @@ -7,7 +7,6 @@ SOURCES = mainwindow.cpp \ treeitem.cpp \ treemodel.cpp \ main.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/editabletreemodel diff --git a/examples/widgets/itemviews/interview/interview.pro b/examples/widgets/itemviews/interview/interview.pro index 08dd9b991e..a61d77613c 100644 --- a/examples/widgets/itemviews/interview/interview.pro +++ b/examples/widgets/itemviews/interview/interview.pro @@ -1,6 +1,5 @@ TEMPLATE = app -CONFIG += qt warn_on HEADERS += model.h SOURCES += model.cpp main.cpp RESOURCES += interview.qrc 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..674b8e8c68 100644 --- a/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro +++ b/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro @@ -4,7 +4,6 @@ RESOURCES = simpletreemodel.qrc SOURCES = treeitem.cpp \ treemodel.cpp \ main.cpp -CONFIG += qt # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/simpletreemodel diff --git a/examples/widgets/richtext/textedit/textedit.pro b/examples/widgets/richtext/textedit/textedit.pro index a2090231c5..fb99e0ee2b 100644 --- a/examples/widgets/richtext/textedit/textedit.pro +++ b/examples/widgets/richtext/textedit/textedit.pro @@ -1,8 +1,6 @@ TEMPLATE = app TARGET = textedit -CONFIG += qt warn_on - HEADERS = textedit.h SOURCES = textedit.cpp \ main.cpp -- cgit v1.2.3 From 6c88c7db638618402db06fb0e57c60a3ed8e1064 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2012 21:12:53 +0100 Subject: remove QT+=widgets from SUBDIRS projects it makes no sense whatsoever Change-Id: Ica7c764575079a12512ee2eb62a995ebbefa09a0 Reviewed-by: Joerg Bornemann --- examples/dbus/complexpingpong/complexpingpong.pro | 1 - examples/dbus/dbus.pro | 2 -- examples/dbus/pingpong/pingpong.pro | 1 - examples/dbus/remotecontrolledcar/remotecontrolledcar.pro | 2 -- examples/embedded/embedded.pro | 2 -- examples/gestures/gestures.pro | 2 -- examples/ipc/ipc.pro | 2 -- examples/opengl/opengl.pro | 2 -- examples/widgets/animation/animation.pro | 2 -- examples/widgets/desktop/desktop.pro | 2 -- examples/widgets/dialogs/dialogs.pro | 2 -- examples/widgets/draganddrop/draganddrop.pro | 1 - examples/widgets/effects/effects.pro | 2 -- examples/widgets/graphicsview/graphicsview.pro | 2 -- examples/widgets/itemviews/itemviews.pro | 2 -- examples/widgets/layouts/layouts.pro | 2 -- examples/widgets/mainwindows/mainwindows.pro | 2 -- examples/widgets/painting/painting.pro | 2 -- examples/widgets/tools/echoplugin/echoplugin.pro | 2 -- examples/widgets/tools/plugandpaintplugins/plugandpaintplugins.pro | 2 -- examples/widgets/tools/styleplugin/styleplugin.pro | 2 -- examples/widgets/tutorials/addressbook-fr/addressbook-fr.pro | 1 - examples/widgets/tutorials/addressbook/addressbook.pro | 2 -- examples/widgets/tutorials/gettingStarted/gettingStarted.pro | 1 - examples/widgets/tutorials/gettingStarted/gsQt/gsqt.pro | 2 -- examples/widgets/tutorials/modelview/modelview.pro | 2 -- examples/widgets/tutorials/threads/threads.pro | 2 -- examples/widgets/tutorials/widgets/widgets.pro | 1 - 28 files changed, 50 deletions(-) (limited to 'examples') diff --git a/examples/dbus/complexpingpong/complexpingpong.pro b/examples/dbus/complexpingpong/complexpingpong.pro index 1dfeff92ac..cd618d549d 100644 --- a/examples/dbus/complexpingpong/complexpingpong.pro +++ b/examples/dbus/complexpingpong/complexpingpong.pro @@ -2,4 +2,3 @@ TEMPLATE = subdirs CONFIG += ordered win32:CONFIG += console SUBDIRS = complexping.pro complexpong.pro -QT += widgets diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro index 89d42bf7fe..200dfb2484 100644 --- a/examples/dbus/dbus.pro +++ b/examples/dbus/dbus.pro @@ -7,5 +7,3 @@ SUBDIRS = listnames \ SUBDIRS += chat \ remotecontrolledcar } - -QT += widgets diff --git a/examples/dbus/pingpong/pingpong.pro b/examples/dbus/pingpong/pingpong.pro index 701e778676..07fca74c9a 100644 --- a/examples/dbus/pingpong/pingpong.pro +++ b/examples/dbus/pingpong/pingpong.pro @@ -2,4 +2,3 @@ TEMPLATE = subdirs CONFIG += ordered win32:CONFIG += console SUBDIRS = ping.pro pong.pro -QT += widgets diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro index f5a0c27435..2a1fddb500 100644 --- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro +++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro @@ -1,5 +1,3 @@ TEMPLATE = subdirs SUBDIRS = car \ controller - -QT += widgets diff --git a/examples/embedded/embedded.pro b/examples/embedded/embedded.pro index aa01bda368..d7d69d3efe 100644 --- a/examples/embedded/embedded.pro +++ b/examples/embedded/embedded.pro @@ -3,5 +3,3 @@ SUBDIRS = styleexample raycasting flickable digiflip SUBDIRS += lightmaps SUBDIRS += flightinfo - -QT += widgets widgets diff --git a/examples/gestures/gestures.pro b/examples/gestures/gestures.pro index 678fbc5829..35b60bef38 100644 --- a/examples/gestures/gestures.pro +++ b/examples/gestures/gestures.pro @@ -2,5 +2,3 @@ TEMPLATE = \ subdirs SUBDIRS = \ imagegestures - -QT += widgets diff --git a/examples/ipc/ipc.pro b/examples/ipc/ipc.pro index ba3990d869..ffa313beef 100644 --- a/examples/ipc/ipc.pro +++ b/examples/ipc/ipc.pro @@ -2,5 +2,3 @@ TEMPLATE = subdirs # no QSharedMemory !vxworks:!qnx:SUBDIRS = sharedmemory !wince*: SUBDIRS += localfortuneserver localfortuneclient - -QT += widgets diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index 1a6ac3aeb2..25c337fdad 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -26,5 +26,3 @@ SUBDIRS += hellowindow \ paintedwindow EXAMPLE_FILES = shared - -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/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/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/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/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/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro index f7142709c8..901533a8de 100644 --- a/examples/widgets/graphicsview/graphicsview.pro +++ b/examples/widgets/graphicsview/graphicsview.pro @@ -18,5 +18,3 @@ contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ SUBDIRS += boxes } - -QT += widgets diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro index 4109e002b6..5d5eef1b0f 100644 --- a/examples/widgets/itemviews/itemviews.pro +++ b/examples/widgets/itemviews/itemviews.pro @@ -18,6 +18,4 @@ SUBDIRS = addressbook \ spinboxdelegate \ spreadsheet \ stardelegate - -QT += widgets contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle 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/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/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/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/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/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/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/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/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/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/threads.pro b/examples/widgets/tutorials/threads/threads.pro index a95eccaaa0..4d51120794 100644 --- a/examples/widgets/tutorials/threads/threads.pro +++ b/examples/widgets/tutorials/threads/threads.pro @@ -6,5 +6,3 @@ SUBDIRS = hellothread \ movedobject contains(QT_CONFIG, concurrent): SUBDIRS += helloconcurrent - -QT += widgets 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 -- cgit v1.2.3 From 2ac3f92296d16432f2ed3af916271d6848547f36 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2012 21:13:33 +0100 Subject: clean up example project files, mostly wrt QT+=widgets move QT+=widgets (and printsupport) statements before the install statements, and de-duplicate some cases. also move some TARGET assignments to a more conventional place. Change-Id: I6140d8611680f66c24490e5894e4eb90cae95635 Reviewed-by: Joerg Bornemann --- examples/embedded/flickable/flickable.pro | 3 ++- examples/embedded/raycasting/raycasting.pro | 2 +- examples/gestures/imagegestures/imagegestures.pro | 4 ++-- examples/ipc/sharedmemory/sharedmemory.pro | 4 ++-- examples/network/blockingfortuneclient/blockingfortuneclient.pro | 3 +-- examples/network/broadcastreceiver/broadcastreceiver.pro | 3 +-- examples/network/broadcastsender/broadcastsender.pro | 3 +-- examples/network/fortuneclient/fortuneclient.pro | 3 +-- examples/network/fortuneserver/fortuneserver.pro | 3 +-- examples/network/http/http.pro | 3 +-- examples/network/loopback/loopback.pro | 3 +-- examples/network/multicastreceiver/multicastreceiver.pro | 3 +-- examples/network/threadedfortuneserver/threadedfortuneserver.pro | 3 +-- examples/network/torrent/torrent.pro | 4 +--- examples/qmake/precompile/precompile.pro | 2 +- examples/qtestlib/tutorial1/tutorial1.pro | 5 ++--- examples/qtestlib/tutorial2/tutorial2.pro | 5 ++--- examples/qtestlib/tutorial3/tutorial3.pro | 5 ++--- examples/qtestlib/tutorial4/tutorial4.pro | 5 ++--- examples/qtestlib/tutorial5/tutorial5.pro | 5 ++--- examples/threads/mandelbrot/mandelbrot.pro | 4 ++-- examples/tools/contiguouscache/contiguouscache.pro | 4 ++-- examples/touch/dials/dials.pro | 4 ++-- examples/touch/fingerpaint/fingerpaint.pro | 6 +++--- examples/touch/knobs/knobs.pro | 4 ++-- examples/touch/pinchzoom/pinchzoom.pro | 4 ++-- examples/webkit/webkit-guide/webkit-guide.pro | 2 -- examples/widgets/animation/animatedtiles/animatedtiles.pro | 4 ++-- examples/widgets/animation/appchooser/appchooser.pro | 4 ++-- examples/widgets/animation/easing/easing.pro | 5 ++--- examples/widgets/animation/moveblocks/moveblocks.pro | 4 ++-- examples/widgets/animation/states/states.pro | 4 ++-- examples/widgets/animation/stickman/stickman.pro | 4 ++-- examples/widgets/desktop/screenshot/screenshot.pro | 3 ++- examples/widgets/dialogs/classwizard/classwizard.pro | 3 ++- examples/widgets/dialogs/configdialog/configdialog.pro | 3 ++- examples/widgets/dialogs/extension/extension.pro | 3 ++- examples/widgets/dialogs/findfiles/findfiles.pro | 4 ++-- examples/widgets/dialogs/licensewizard/licensewizard.pro | 3 ++- examples/widgets/dialogs/sipdialog/sipdialog.pro | 4 ++-- examples/widgets/dialogs/standarddialogs/standarddialogs.pro | 4 ++-- examples/widgets/dialogs/tabdialog/tabdialog.pro | 3 ++- examples/widgets/dialogs/trivialwizard/trivialwizard.pro | 3 ++- examples/widgets/draganddrop/draggableicons/draggableicons.pro | 4 ++-- examples/widgets/draganddrop/draggabletext/draggabletext.pro | 5 ++--- examples/widgets/draganddrop/dropsite/dropsite.pro | 3 ++- examples/widgets/draganddrop/fridgemagnets/fridgemagnets.pro | 5 ++--- examples/widgets/draganddrop/puzzle/puzzle.pro | 3 ++- examples/widgets/effects/blurpicker/blurpicker.pro | 4 ++-- examples/widgets/effects/fademessage/fademessage.pro | 3 ++- examples/widgets/effects/lighting/lighting.pro | 5 ++--- examples/widgets/graphicsview/anchorlayout/anchorlayout.pro | 8 ++++---- .../graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro | 4 ++-- examples/widgets/graphicsview/collidingmice/collidingmice.pro | 5 ++--- examples/widgets/graphicsview/diagramscene/diagramscene.pro | 4 ++-- examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pro | 4 ++-- examples/widgets/graphicsview/elasticnodes/elasticnodes.pro | 4 ++-- examples/widgets/graphicsview/embeddeddialogs/embeddeddialogs.pro | 4 ++-- .../graphicsview/simpleanchorlayout/simpleanchorlayout.pro | 7 ++++--- examples/widgets/itemviews/addressbook/addressbook.pro | 4 ++-- .../itemviews/basicsortfiltermodel/basicsortfiltermodel.pro | 4 ++-- examples/widgets/itemviews/chart/chart.pro | 5 ++--- .../widgets/itemviews/coloreditorfactory/coloreditorfactory.pro | 5 ++--- .../widgets/itemviews/combowidgetmapper/combowidgetmapper.pro | 3 ++- .../itemviews/customsortfiltermodel/customsortfiltermodel.pro | 4 ++-- examples/widgets/itemviews/dirview/dirview.pro | 4 ++-- .../widgets/itemviews/editabletreemodel/editabletreemodel.pro | 4 ++-- examples/widgets/itemviews/fetchmore/fetchmore.pro | 4 ++-- examples/widgets/itemviews/frozencolumn/frozencolumn.pro | 3 ++- examples/widgets/itemviews/interview/interview.pro | 3 +-- examples/widgets/itemviews/pixelator/pixelator.pro | 6 +++--- examples/widgets/itemviews/puzzle/puzzle.pro | 5 ++--- examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro | 4 ++-- .../widgets/itemviews/simplewidgetmapper/simplewidgetmapper.pro | 4 ++-- examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro | 4 ++-- examples/widgets/itemviews/stardelegate/stardelegate.pro | 4 ++-- examples/widgets/layouts/basiclayouts/basiclayouts.pro | 4 ++-- examples/widgets/layouts/borderlayout/borderlayout.pro | 4 ++-- examples/widgets/layouts/dynamiclayouts/dynamiclayouts.pro | 4 ++-- examples/widgets/layouts/flowlayout/flowlayout.pro | 4 ++-- examples/widgets/mainwindows/application/application.pro | 4 ++-- examples/widgets/mainwindows/dockwidgets/dockwidgets.pro | 6 +++--- examples/widgets/mainwindows/mainwindow/mainwindow.pro | 4 ++-- examples/widgets/mainwindows/mdi/mdi.pro | 4 ++-- examples/widgets/mainwindows/menus/menus.pro | 4 ++-- examples/widgets/mainwindows/recentfiles/recentfiles.pro | 4 ++-- examples/widgets/mainwindows/sdi/sdi.pro | 4 ++-- examples/widgets/painting/basicdrawing/basicdrawing.pro | 4 ++-- examples/widgets/painting/concentriccircles/concentriccircles.pro | 5 ++--- examples/widgets/painting/fontsampler/fontsampler.pro | 6 +++--- examples/widgets/painting/imagecomposition/imagecomposition.pro | 5 ++--- examples/widgets/painting/painterpaths/painterpaths.pro | 5 ++--- examples/widgets/painting/shared/shared.pro | 4 ++-- examples/widgets/painting/transformations/transformations.pro | 4 ++-- examples/widgets/richtext/calendar/calendar.pro | 4 ++-- examples/widgets/richtext/orderform/orderform.pro | 6 +++--- examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro | 4 ++-- examples/widgets/richtext/textedit/textedit.pro | 6 +++--- examples/widgets/scroller/graphicsview/graphicsview.pro | 3 ++- .../widgets/statemachine/eventtransitions/eventtransitions.pro | 4 ++-- examples/widgets/statemachine/rogue/rogue.pro | 5 ++--- examples/widgets/statemachine/trafficlight/trafficlight.pro | 3 ++- examples/widgets/statemachine/twowaybutton/twowaybutton.pro | 3 ++- examples/widgets/tools/codecs/codecs.pro | 4 ++-- examples/widgets/tools/completer/completer.pro | 4 ++-- examples/widgets/tools/customcompleter/customcompleter.pro | 4 ++-- examples/widgets/tools/echoplugin/echowindow/echowindow.pro | 4 ++-- examples/widgets/tools/echoplugin/plugin/plugin.pro | 3 +-- examples/widgets/tools/i18n/i18n.pro | 4 ++-- examples/widgets/tools/plugandpaint/plugandpaint.pro | 4 ++-- .../widgets/tools/plugandpaintplugins/basictools/basictools.pro | 3 +-- .../tools/plugandpaintplugins/extrafilters/extrafilters.pro | 3 +-- examples/widgets/tools/regexp/regexp.pro | 4 ++-- examples/widgets/tools/settingseditor/settingseditor.pro | 4 ++-- examples/widgets/tools/styleplugin/plugin/plugin.pro | 4 +--- examples/widgets/tools/styleplugin/stylewindow/stylewindow.pro | 4 ++-- examples/widgets/tools/treemodelcompleter/treemodelcompleter.pro | 4 ++-- examples/widgets/tools/undo/undo.pro | 4 ++-- examples/widgets/tools/undoframework/undoframework.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part1/part1.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part2/part2.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part3/part3.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part4/part4.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part5/part5.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part6/part6.pro | 4 ++-- examples/widgets/tutorials/addressbook-fr/part7/part7.pro | 4 ++-- examples/widgets/tutorials/addressbook/part1/part1.pro | 4 ++-- examples/widgets/tutorials/addressbook/part2/part2.pro | 4 ++-- examples/widgets/tutorials/addressbook/part3/part3.pro | 4 ++-- examples/widgets/tutorials/addressbook/part4/part4.pro | 4 ++-- examples/widgets/tutorials/addressbook/part5/part5.pro | 4 ++-- examples/widgets/tutorials/addressbook/part6/part6.pro | 4 ++-- examples/widgets/tutorials/addressbook/part7/part7.pro | 4 ++-- examples/widgets/tutorials/modelview/1_readonly/1_readonly.pro | 4 ++-- .../widgets/tutorials/modelview/2_formatting/2_formatting.pro | 4 ++-- .../tutorials/modelview/3_changingmodel/3_changingmodel.pro | 4 ++-- examples/widgets/tutorials/modelview/4_headers/4_headers.pro | 4 ++-- examples/widgets/tutorials/modelview/5_edit/5_edit.pro | 4 ++-- examples/widgets/tutorials/modelview/6_treeview/6_treeview.pro | 3 +-- .../widgets/tutorials/modelview/7_selections/7_selections.pro | 3 +-- examples/widgets/tutorials/threads/clock/clock.pro | 4 +--- examples/widgets/tutorials/threads/movedobject/movedobject.pro | 3 +-- examples/widgets/tutorials/widgets/childwidget/childwidget.pro | 4 ++-- .../widgets/tutorials/widgets/nestedlayouts/nestedlayouts.pro | 4 ++-- examples/widgets/tutorials/widgets/toplevel/toplevel.pro | 4 ++-- examples/widgets/tutorials/widgets/windowlayout/windowlayout.pro | 4 ++-- examples/widgets/widgets/analogclock/analogclock.pro | 5 ++--- examples/widgets/widgets/calculator/calculator.pro | 5 ++--- examples/widgets/widgets/calendarwidget/calendarwidget.pro | 4 ++-- examples/widgets/widgets/charactermap/charactermap.pro | 4 ++-- examples/widgets/widgets/codeeditor/codeeditor.pro | 5 ++--- examples/widgets/widgets/digitalclock/digitalclock.pro | 4 ++-- examples/widgets/widgets/groupbox/groupbox.pro | 4 ++-- examples/widgets/widgets/icons/icons.pro | 3 ++- examples/widgets/widgets/imageviewer/imageviewer.pro | 5 +++-- examples/widgets/widgets/lineedits/lineedits.pro | 4 ++-- examples/widgets/widgets/movie/movie.pro | 4 ++-- examples/widgets/widgets/scribble/scribble.pro | 6 +++--- examples/widgets/widgets/shapedclock/shapedclock.pro | 5 ++--- examples/widgets/widgets/sliders/sliders.pro | 4 ++-- examples/widgets/widgets/spinboxes/spinboxes.pro | 4 ++-- examples/widgets/widgets/styles/styles.pro | 4 ++-- examples/widgets/widgets/stylesheet/stylesheet.pro | 4 ++-- examples/widgets/widgets/tablet/tablet.pro | 4 ++-- examples/widgets/widgets/tetrix/tetrix.pro | 5 ++--- examples/widgets/widgets/tooltips/tooltips.pro | 4 ++-- examples/widgets/widgets/wiggly/wiggly.pro | 2 +- examples/widgets/widgets/windowflags/windowflags.pro | 4 ++-- 168 files changed, 324 insertions(+), 351 deletions(-) (limited to 'examples') diff --git a/examples/embedded/flickable/flickable.pro b/examples/embedded/flickable/flickable.pro index 3bc86c661f..5929207414 100644 --- a/examples/embedded/flickable/flickable.pro +++ b/examples/embedded/flickable/flickable.pro @@ -1,6 +1,7 @@ +QT += widgets + SOURCES = flickable.cpp main.cpp HEADERS = flickable.h target.path = $$[QT_INSTALL_EXAMPLES]/embedded/flickable INSTALLS += target -QT += widgets widgets diff --git a/examples/embedded/raycasting/raycasting.pro b/examples/embedded/raycasting/raycasting.pro index 79b560ffeb..51bf4bf4b0 100644 --- a/examples/embedded/raycasting/raycasting.pro +++ b/examples/embedded/raycasting/raycasting.pro @@ -1,7 +1,7 @@ TEMPLATE = app +QT += widgets SOURCES = raycasting.cpp RESOURCES += raycasting.qrc target.path = $$[QT_INSTALL_EXAMPLES]/embedded/raycasting INSTALLS += target -QT += widgets widgets diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro index 7844cc2ea1..c40c29564f 100644 --- a/examples/gestures/imagegestures/imagegestures.pro +++ b/examples/gestures/imagegestures/imagegestures.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = imagewidget.h \ mainwidget.h SOURCES = imagewidget.cpp \ @@ -8,5 +10,3 @@ SOURCES = imagewidget.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures INSTALLS += target -QT += widgets - diff --git a/examples/ipc/sharedmemory/sharedmemory.pro b/examples/ipc/sharedmemory/sharedmemory.pro index f6f2fc3c42..0d25a30b1b 100644 --- a/examples/ipc/sharedmemory/sharedmemory.pro +++ b/examples/ipc/sharedmemory/sharedmemory.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp \ dialog.cpp @@ -12,6 +14,4 @@ EXAMPLE_FILES = *.png target.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory INSTALLS += target -QT += widgets - simulator: warning(This example does not work on Simulator platform) diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro index bcf5346d35..2bd1f78c14 100644 --- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro +++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro @@ -1,11 +1,10 @@ -QT += widgets +QT += network widgets HEADERS = blockingclient.h \ fortunethread.h SOURCES = blockingclient.cpp \ main.cpp \ fortunethread.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro index e1708f36da..edadf1c28d 100644 --- a/examples/network/broadcastreceiver/broadcastreceiver.pro +++ b/examples/network/broadcastreceiver/broadcastreceiver.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = receiver.h SOURCES = receiver.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro index 611b617471..4c5af7f849 100644 --- a/examples/network/broadcastsender/broadcastsender.pro +++ b/examples/network/broadcastsender/broadcastsender.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = sender.h SOURCES = sender.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index b921941da3..8b376d9c53 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = client.h SOURCES = client.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index cfcf680f81..8c8ad3f0d3 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = server.h SOURCES = server.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro index 1543584cf5..2f2d3b00ae 100644 --- a/examples/network/http/http.pro +++ b/examples/network/http/http.pro @@ -1,10 +1,9 @@ -QT += widgets +QT += network widgets HEADERS += httpwindow.h SOURCES += httpwindow.cpp \ main.cpp FORMS += authenticationdialog.ui -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/http diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro index c7b8d060b8..14b22daa57 100644 --- a/examples/network/loopback/loopback.pro +++ b/examples/network/loopback/loopback.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = dialog.h SOURCES = dialog.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/loopback diff --git a/examples/network/multicastreceiver/multicastreceiver.pro b/examples/network/multicastreceiver/multicastreceiver.pro index bbba25a626..6906fc6cb5 100644 --- a/examples/network/multicastreceiver/multicastreceiver.pro +++ b/examples/network/multicastreceiver/multicastreceiver.pro @@ -1,9 +1,8 @@ -QT += widgets +QT += network widgets HEADERS = receiver.h SOURCES = receiver.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/multicastreceiver diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro index cb6be41d33..2538701b94 100644 --- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro +++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro @@ -1,4 +1,4 @@ -QT += widgets +QT += network widgets HEADERS = dialog.h \ fortuneserver.h \ @@ -7,7 +7,6 @@ SOURCES = dialog.cpp \ fortuneserver.cpp \ fortunethread.cpp \ main.cpp -QT += network # install target.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro index a080ec07e2..76887ae649 100644 --- a/examples/network/torrent/torrent.pro +++ b/examples/network/torrent/torrent.pro @@ -1,4 +1,4 @@ -QT += widgets +QT += network widgets HEADERS += addtorrentdialog.h \ bencodeparser.h \ @@ -29,8 +29,6 @@ SOURCES += main.cpp \ FORMS += forms/addtorrentform.ui RESOURCES += icons.qrc -QT += network - # install target.path = $$[QT_INSTALL_EXAMPLES]/network/torrent INSTALLS += target diff --git a/examples/qmake/precompile/precompile.pro b/examples/qmake/precompile/precompile.pro index b51677023a..6a23d82c32 100644 --- a/examples/qmake/precompile/precompile.pro +++ b/examples/qmake/precompile/precompile.pro @@ -8,6 +8,7 @@ TEMPLATE = app LANGUAGE = C++ CONFIG += console precompile_header CONFIG -= app_bundle +QT += widgets # Use Precompiled headers (PCH) PRECOMPILED_HEADER = stable.h @@ -21,4 +22,3 @@ SOURCES = main.cpp \ util.cpp FORMS = mydialog.ui #! [0] -QT += widgets diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro index 8e77a9c5ff..d0d45ceb04 100644 --- a/examples/qtestlib/tutorial1/tutorial1.pro +++ b/examples/qtestlib/tutorial1/tutorial1.pro @@ -1,8 +1,7 @@ +QT += widgets testlib + SOURCES = testqstring.cpp -QT += testlib # install target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1 INSTALLS += target - -QT += widgets diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro index 58e70d4508..039c047fa8 100644 --- a/examples/qtestlib/tutorial2/tutorial2.pro +++ b/examples/qtestlib/tutorial2/tutorial2.pro @@ -1,8 +1,7 @@ +QT += widgets testlib + SOURCES = testqstring.cpp -QT += testlib # install target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial2 INSTALLS += target - -QT += widgets diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro index 918dbf1187..297b0c9926 100644 --- a/examples/qtestlib/tutorial3/tutorial3.pro +++ b/examples/qtestlib/tutorial3/tutorial3.pro @@ -1,8 +1,7 @@ +QT += widgets testlib + SOURCES = testgui.cpp -QT += testlib # install target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial3 INSTALLS += target - -QT += widgets diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro index f7b40dd4ca..4c1f431563 100644 --- a/examples/qtestlib/tutorial4/tutorial4.pro +++ b/examples/qtestlib/tutorial4/tutorial4.pro @@ -1,8 +1,7 @@ +QT += widgets testlib + SOURCES = testgui.cpp -QT += testlib # install target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial4 INSTALLS += target - -QT += widgets diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro index facb21ea14..8499fd2085 100644 --- a/examples/qtestlib/tutorial5/tutorial5.pro +++ b/examples/qtestlib/tutorial5/tutorial5.pro @@ -1,8 +1,7 @@ +QT += widgets testlib + SOURCES = benchmarking.cpp -QT += testlib # install target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial5 INSTALLS += target - -QT += widgets diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro index 08c320fff6..45f21baf08 100644 --- a/examples/threads/mandelbrot/mandelbrot.pro +++ b/examples/threads/mandelbrot/mandelbrot.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mandelbrotwidget.h \ renderthread.h SOURCES = main.cpp \ @@ -9,5 +11,3 @@ unix:!mac:!vxworks:!integrity:LIBS += -lm # install target.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot INSTALLS += target - -QT += widgets diff --git a/examples/tools/contiguouscache/contiguouscache.pro b/examples/tools/contiguouscache/contiguouscache.pro index 62cf862795..71130389be 100644 --- a/examples/tools/contiguouscache/contiguouscache.pro +++ b/examples/tools/contiguouscache/contiguouscache.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = randomlistmodel.h SOURCES = randomlistmodel.cpp \ main.cpp @@ -5,7 +7,5 @@ SOURCES = randomlistmodel.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/tools/contiguouscache INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro index 0da1103432..aeba956892 100644 --- a/examples/touch/dials/dials.pro +++ b/examples/touch/dials/dials.pro @@ -1,10 +1,10 @@ +QT += widgets + SOURCES += main.cpp FORMS += dials.ui # install target.path = $$[QT_INSTALL_EXAMPLES]/touch/dials INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro index a9083b39ca..5093c8ad8d 100644 --- a/examples/touch/fingerpaint/fingerpaint.pro +++ b/examples/touch/fingerpaint/fingerpaint.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): QT += printsupport + HEADERS = mainwindow.h \ scribblearea.h SOURCES = main.cpp \ @@ -8,7 +11,4 @@ SOURCES = main.cpp \ target.path = $$[QT_INSTALL_EXAMPLES]/touch/fingerpaint 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/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro index 7540a4b2cf..6a10a0776f 100644 --- a/examples/touch/knobs/knobs.pro +++ b/examples/touch/knobs/knobs.pro @@ -1,10 +1,10 @@ +QT += widgets + HEADERS = knob.h SOURCES = main.cpp knob.cpp # install target.path = $$[QT_INSTALL_EXAMPLES]/touch/knobs INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro index df7ce246c3..5c101b2f5c 100644 --- a/examples/touch/pinchzoom/pinchzoom.pro +++ b/examples/touch/pinchzoom/pinchzoom.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS += \ mouse.h \ graphicsview.h @@ -12,7 +14,5 @@ RESOURCES += \ # install target.path = $$[QT_INSTALL_EXAMPLES]/touch/pinchzoom INSTALLS += target -QT += widgets - simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/webkit/webkit-guide/webkit-guide.pro b/examples/webkit/webkit-guide/webkit-guide.pro index 6614b6d52c..a2c2dd4a20 100644 --- a/examples/webkit/webkit-guide/webkit-guide.pro +++ b/examples/webkit/webkit-guide/webkit-guide.pro @@ -254,5 +254,3 @@ js/form_tapper.js \ js/mob_condjs.js \ js/mobile.js \ js/storage.js \ - -QT += widgets 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/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/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/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/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/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/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/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.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/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/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/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/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/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 7390cec23f..2469a4ef20 100644 --- a/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro +++ b/examples/widgets/itemviews/basicsortfiltermodel/basicsortfiltermodel.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/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 488a755b9d..b722e606d3 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro +++ b/examples/widgets/itemviews/customsortfiltermodel/customsortfiltermodel.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = mysortfilterproxymodel.h \ window.h SOURCES = main.cpp \ @@ -7,5 +9,3 @@ SOURCES = main.cpp \ # 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 a83b6fc5bf..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 \ @@ -11,5 +13,3 @@ SOURCES = mainwindow.cpp \ # 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 a61d77613c..0e480e939c 100644 --- a/examples/widgets/itemviews/interview/interview.pro +++ b/examples/widgets/itemviews/interview/interview.pro @@ -1,4 +1,5 @@ TEMPLATE = app +QT += widgets HEADERS += model.h SOURCES += model.cpp main.cpp @@ -12,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/pixelator/pixelator.pro b/examples/widgets/itemviews/pixelator/pixelator.pro index 37e54f937a..b844e7c3a4 100644 --- a/examples/widgets/itemviews/pixelator/pixelator.pro +++ b/examples/widgets/itemviews/pixelator/pixelator.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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/simpletreemodel/simpletreemodel.pro b/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro index 674b8e8c68..82484c9971 100644 --- a/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro +++ b/examples/widgets/itemviews/simpletreemodel/simpletreemodel.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = treeitem.h \ treemodel.h RESOURCES = simpletreemodel.qrc @@ -8,5 +10,3 @@ SOURCES = treeitem.cpp \ # 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/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/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..4bccf49399 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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/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/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/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/fontsampler/fontsampler.pro b/examples/widgets/painting/fontsampler/fontsampler.pro index c32fc40572..8325da0175 100644 --- a/examples/widgets/painting/fontsampler/fontsampler.pro +++ b/examples/widgets/painting/fontsampler/fontsampler.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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/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/shared/shared.pro b/examples/widgets/painting/shared/shared.pro index 2a71c7d487..42b474a946 100644 --- a/examples/widgets/painting/shared/shared.pro +++ b/examples/widgets/painting/shared/shared.pro @@ -3,15 +3,15 @@ CONFIG += static contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { 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..1477d6ecab 100644 --- a/examples/widgets/richtext/orderform/orderform.pro +++ b/examples/widgets/richtext/orderform/orderform.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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 fb99e0ee2b..36f860c5a8 100644 --- a/examples/widgets/richtext/textedit/textedit.pro +++ b/examples/widgets/richtext/textedit/textedit.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): QT += printsupport + TEMPLATE = app TARGET = textedit @@ -16,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/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/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/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/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/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/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/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/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/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/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/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/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/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/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..3378db7fb6 100644 --- a/examples/widgets/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/widgets/imageviewer/imageviewer.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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/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..8c35ba777f 100644 --- a/examples/widgets/widgets/scribble/scribble.pro +++ b/examples/widgets/widgets/scribble/scribble.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): 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) -- cgit v1.2.3 From 5a2fc03ef40d9b2a8384abffe3f1cb9d943b9acc Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Dec 2012 14:55:20 +0100 Subject: Fix building of the painting examples that use shared code Task-number: QTCREATORBUG-8437 Change-Id: I66031184a009f3b26ad4af36b1975204e8fa80dc Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 2dc6ad8adf7f98d55aca5def8ee3f9c12934fb7b) --- examples/widgets/painting/shared/shared.pri | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'examples') diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri index 2d6b3c78f9..6aef1bdd5b 100644 --- a/examples/widgets/painting/shared/shared.pri +++ b/examples/widgets/painting/shared/shared.pri @@ -1,20 +1,19 @@ -INCLUDEPATH += $$SHARED_FOLDER +INCLUDEPATH += $$PWD -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -contains(CONFIG, debug_and_release_target) { - CONFIG(debug, debug|release) { - QMAKE_LIBDIR += $$SHARED_FOLDER/debug - } else { - QMAKE_LIBDIR += $$SHARED_FOLDER/release - } -} else { - QMAKE_LIBDIR += $$SHARED_FOLDER +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { + DEFINES += QT_OPENGL_SUPPORT + QT += opengl widgets } -hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a -hpuxi-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a -!hpuxi-acc*:!hpux-acc*:LIBS += -ldemo_shared +SOURCES += \ + $$PWD/arthurstyle.cpp\ + $$PWD/arthurwidgets.cpp \ + $$PWD/hoverpoints.cpp + +HEADERS += \ + $$PWD/arthurstyle.h \ + $$PWD/arthurwidgets.h \ + $$PWD/hoverpoints.h + +RESOURCES += $$PWD/shared.qrc -- cgit v1.2.3 From 084306783828839b957ef5073a477122f7aed679 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Tue, 18 Dec 2012 13:00:29 +0100 Subject: Qt Gui Examples: Fixed QDoc files Change-Id: I160d8d186a1078f20f2b779bfbdae90459c27641 Reviewed-by: Jerome Pasion --- examples/gui/doc/analogclockwindow.qdoc | 138 ------------------------ examples/gui/doc/openglwindow.qdoc | 156 --------------------------- examples/gui/doc/rasterwindow.qdoc | 161 ---------------------------- examples/gui/doc/src/analogclockwindow.qdoc | 138 ++++++++++++++++++++++++ examples/gui/doc/src/openglwindow.qdoc | 156 +++++++++++++++++++++++++++ examples/gui/doc/src/rasterwindow.qdoc | 161 ++++++++++++++++++++++++++++ 6 files changed, 455 insertions(+), 455 deletions(-) delete mode 100644 examples/gui/doc/analogclockwindow.qdoc delete mode 100644 examples/gui/doc/openglwindow.qdoc delete mode 100644 examples/gui/doc/rasterwindow.qdoc create mode 100644 examples/gui/doc/src/analogclockwindow.qdoc create mode 100644 examples/gui/doc/src/openglwindow.qdoc create mode 100644 examples/gui/doc/src/rasterwindow.qdoc (limited to 'examples') diff --git a/examples/gui/doc/analogclockwindow.qdoc b/examples/gui/doc/analogclockwindow.qdoc deleted file mode 100644 index ff361a27b1..0000000000 --- a/examples/gui/doc/analogclockwindow.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** 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 analogclock - \title Analog Clock Window Example - - \brief The Analog Clock Window example shows how to draw the contents of - a custom window. - - \image analogclock-window-example.png Screenshot of the Analog - Clock Window example - - This example demonstrates how the transformation and scaling - features of QPainter can be used to make drawing easier. - - \section1 AnalogClockWindow Class Definition - - The \c AnalogClockWindow class provides a clock with hour and - minute hands that is automatically updated every few seconds. We - make use of the RasterWindow from the \l {Raster Window Example} - and reimplement the \c render function to draw the clock face: - - \snippet analogclock/main.cpp 5 - - \section1 AnalogClock Class Implementation - - \snippet analogclock/main.cpp 6 - - We set a title on the window and resize to a reasonable size. Then - we start a timer which we will use to redraw the clock every - second. - - \snippet analogclock/main.cpp 7 - - The timerEvent function is called every second as a result of - our startTimer call. Making use of the convenience in the base - class, we schedule the window to be repainted. - - Checking the timer's id is not strictly needed as we only have - one active timer in this instance, but it is good practice to do - so. - - \snippet analogclock/main.cpp 14 - \snippet analogclock/main.cpp 8 - - Before we set up the painter and draw the clock, we first define - two lists of \l {QPoint}s and two \l{QColor}s that will be used - for the hour and minute hands. The minute hand's color has an - alpha component of 191, meaning that it's 75% opaque. - - \snippet analogclock/main.cpp 9 - - We call QPainter::setRenderHint() with QPainter::Antialiasing to - turn on antialiasing. This makes drawing of diagonal lines much - smoother. - - \snippet analogclock/main.cpp 10 - - The translation moves the origin to the center of the window, and - the scale operation ensures that the following drawing operations - are scaled to fit within the window. We use a scale factor that - let's us use x and y coordinates between -100 and 100, and that - ensures that these lie within the length of the window's shortest - side. - - To make our code simpler, we will draw a fixed size clock face that will - be positioned and scaled so that it lies in the center of the window. - - We also determine the length of the window's shortest side so that we - can fit the clock face inside the window. - - The painter takes care of all the transformations made during the - rendering, and ensures that everything is drawn correctly. Letting - the painter handle transformations is often easier than performing - manual calculations. - - \image analogclockwindow-viewport.png - - We draw the hour hand first, using a formula that rotates the coordinate - system counterclockwise by a number of degrees determined by the current - hour and minute. This means that the hand will be shown rotated clockwise - by the required amount. - - \snippet analogclock/main.cpp 11 - - We set the pen to be Qt::NoPen because we don't want any outline, - and we use a solid brush with the color appropriate for - displaying hours. Brushes are used when filling in polygons and - other geometric shapes. - - \snippet analogclock/main.cpp 2 - - We save and restore the transformation matrix before and after the - rotation because we want to place the minute hand without having to - take into account any previous rotations. - - \snippet analogclock/main.cpp 12 - - We draw markers around the edge of the clock for each hour. We - draw each marker then rotate the coordinate system so that the - painter is ready for the next one. - - \snippet analogclock/main.cpp 13 - \snippet analogclock/main.cpp 3 - - The minute hand is rotated in a similar way to the hour hand. - - \snippet analogclock/main.cpp 4 - - Again, we draw markers around the edge of the clock, but this - time to indicate minutes. We skip multiples of 5 to avoid drawing - minute markers on top of hour markers. -*/ diff --git a/examples/gui/doc/openglwindow.qdoc b/examples/gui/doc/openglwindow.qdoc deleted file mode 100644 index d26fd477af..0000000000 --- a/examples/gui/doc/openglwindow.qdoc +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** -** -** 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 openglwindow - \title OpenGL Window Example - - \brief This example shows how to create a minimal QWindow based application - for the purpose of using OpenGL. - - \image openglwindow-example.png Screenshot of the OpenGLWindow example - - \section1 OpenGLWindow super class - - Our OpenGLWindow class acts as an API which is then subclassed to do the - actual rendering. It has functions to make a request for render() to be - called, either immediately with renderNow() or as soon as the event loop - has finished processing the current batch of events with renderLater(). - The OpenGLWindow subclass can either reimplement render() for OpenGL based - rendering, or render(QPainter *) for rendering with a QPainter. Use - OpenGLWindow::setAnimating(true) for render() to be called at the vertical - refresh rate, assuming vertical sync is enabled in the underlying OpenGL - drivers. - - In the class that does the OpenGL rendering you will typically want to - inherit from QOpenGLFunctions, as our OpenGLWindow does, in order to get - platform independent access to OpenGL ES 2.0 functions. By inheriting from - QOpenGLFunctions the OpenGL functions it contains will get precedence, and - you will not have to worry about resolving those functions if you want your - application to work with OpenGL as well as OpenGL ES 2.0. - - \snippet openglwindow/openglwindow.h 1 - - The window's surface type must be set to QSurface::OpenGLSurface to - indicate that the window is to be used for OpenGL rendering and not for - rendering raster content with QPainter using a QBackingStore. - - \snippet openglwindow/openglwindow.cpp 1 - - Any OpenGL initialization needed can be done by overriding the initialize() - function, which is called once before the first call to render(), with a - valid current QOpenGLContext. As can be seen in the following code snippet, - the default render(QPainter *) and initialize() implementations are empty, - whereas the default render() implementation initializes a - QOpenGLPaintDevice and then calls into render(QPainter *). - - \snippet openglwindow/openglwindow.cpp 2 - - The renderLater() function simply puts an update request event on - the event loop, which leads to renderNow() being called once the event - gets processed. - - We also call renderNow() when we get an expose event. The exposeEvent() is - the notification to the window that its exposure, meaning visibility, on - the screen has changed. When the expose event is received you can query - QWindow::isExposed() to find out whether or not the window is currently - exposed. Do not render to or call QOpenGLContext::swapBuffers() on a window - before it has received its first expose event, as before then its final - size might be unknown, and in addition what is rendered might not even end - up on the screen. - - \snippet openglwindow/openglwindow.cpp 3 - - In renderNow() we return if we are not currently exposed, in which case - rendering is delayed until we actually get an expose event. If we have not - yet done so, we create the QOpenGLContext with the same QSurfaceFormat as - was set on the OpenGLWindow, and call initialize() for the sake of the sub - class, and initializeOpenGLFunctions() in order for the QOpenGLFunctions - super class to be associated with the correct QOpenGLContext. In any case - we make the context current by calling QOpenGLContext::makeCurrent(), call - render() to do the actual rendering, and finally we schedule for the - rendered contents to be made visible by calling - QOpenGLContext::swapBuffers() with the OpenGLWindow as parameter. - - Once the rendering of a frame using an OpenGL context is initiated by - calling QOpenGLContext::makeCurrent(), giving the surface on which to - render as a parameter, OpenGL commands can be issued. The commands can be - issued either directly by including , which also includes the - system's OpenGL headers, or as by using QOpenGLFunctions, which can - either be inherited from for convenience, or accessed using - QOpenGLContext::functions(). QOpenGLFunctions gives access to all the - OpenGL ES 2.0 level OpenGL calls that are not already standard in both - OpenGL ES 2.0 and desktop OpenGL. For more information about the OpenGL and - OpenGL ES APIs, refer to the official \l{http://www.opengl.org/registry/}{OpenGL Registry} and - \l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}. - - If animation has been enabled with OpenGLWindow::setAnimating(true), we - call renderLater() to put another update request on the event loop. - - \snippet openglwindow/openglwindow.cpp 4 - - Enabling animation also triggers an update request as shown in the - following code snippet. - - \snippet openglwindow/openglwindow.cpp 5 - - \section1 Example OpenGL rendering sub class - - Here we sub class OpenGLWindow to show how to do OpenGL to render a - rotating triangle. By indirectly sub classing QOpenGLFunctions we gain - access to all OpenGL ES 2.0 level functionality. - - \snippet openglwindow/main.cpp 1 - - In our main function we initialize QGuiApplication and instantiate our - TriangleOpenGLWindow. We give it a QSurfaceFormat specifying that we want - four samples of multisample antialiasing, as well as a default geometry. - Since we want to have animation we call the above mentioned setAnimating() - function with an argument of true. - - \snippet openglwindow/main.cpp 2 - - The following code snippet shows the OpenGL shader program used in this - example. The vertex and fragment shaders are relatively simple, doing - vertex transformation and interpolated vertex coloring. - - \snippet openglwindow/main.cpp 3 - - Here is the code that loads the shaders and initializes the shader program - By using QOpenGLShaderProgram instead of raw OpenGL we get the convenience - that strips out the highp, mediump, and lowp qualifiers on desktop OpenGL, - where they are not part of the standard. We store the attribute and uniform - locations in member variables to avoid having to do the location lookup - each frame. - - \snippet openglwindow/main.cpp 4 - - Finally, here is our render() function, where we use OpenGL to set up the - viewport, clear the background, and render a rotating triangle. - - \snippet openglwindow/main.cpp 5 -*/ diff --git a/examples/gui/doc/rasterwindow.qdoc b/examples/gui/doc/rasterwindow.qdoc deleted file mode 100644 index f246533c4f..0000000000 --- a/examples/gui/doc/rasterwindow.qdoc +++ /dev/null @@ -1,161 +0,0 @@ -**************************************************************************** -** -** 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 rasterwindow - \title Raster Window Example - - \brief This example shows how to create a minimal QWindow based - application using QPainter for rendering. - - - \section1 Application Entry Point - - \snippet rasterwindow/main.cpp 1 - - The entry point for a QWindow based application is the \l - QGuiApplication class. It manages the GUI application's control - flow and main settings. We pass the command line arguments which - can be used to pick up certain system wide options. - - From there, we go on to create our window instance and then call - the \l QWindow::show() function to tell the windowing system that - this window should now be made visible on screen. - - Once this is done, we enter the application's event loop so the - application can run. - - - \section1 RasterWindow Declaration - - \snippet rasterwindow/rasterwindow.h 1 - - We first start by including the the QtGui headers. This means we - can use all classes in the Qt GUI module. Classes can also be - included individually if that is preferred. - - The RasterWindow class subclasses QWindow directly and provides a - constructor which allows the window to be a sub-window of another - QWindow. Parent-less QWindows show up in the windowing system as - top-level windows. - - The class declares a QBackingStore which is what we use to manage - the window's back buffer for QPainter based graphics. - - \e {The raster window is also reused in a few other examples and adds - a few helper functions, like renderLater().} - - - \section1 RasterWindow Implementation - - \snippet rasterwindow/rasterwindow.cpp 1 - - The constructor first of all calls \l QWindow::create(). This will - create the window in the windowing system. Without calling create, - the window will not get events and will not be visible in the - windowing system. The call to create does not show the window. We - then set the geometry to be something reasonable. - - Then we create the backingstore and pass it the window instance it - is supposed to manage. - - \snippet rasterwindow/rasterwindow.cpp 2 - - Shortly after calling \l QWindow::show() on a created window, the - virtual function \l QWindow::exposeEvent() will be called to - notify us that the window's exposure in the windowing system has - changed. The event contains the exposed sub-region, but since we - will anyway draw the entire window every time, we do not make use - of that. - - The function \l QWindow::isExposed() will tell us if the window is - showing or not. We need this as the exposeEvent is called also - when the window becomes obscured in the windowing system. If the - window is showing, we call renderNow() to draw the window - immediately. We want to draw right away so we can present the - system with some visual content. - - - \snippet rasterwindow/rasterwindow.cpp 5 - - The resize event is guaranteed to be called prior to the window - being shown on screen and will also be called whenever the window - is resized while on screen. We use this to resize the back buffer - and call renderNow() if we are visible to immediately update the - visual representation of the window on screen. - - \snippet rasterwindow/rasterwindow.cpp 3 - - The renderNow function sets up what is needed for a \l QWindow to - render its content using QPainter. As obscured windows have will - not be visible, we abort if the window is not exposed in the - windowing system. This can for instance happen when another window - fully obscures this window. - - We start the drawing by calling \l QBackingStore::beginPaint() on - the region we want to draw. Then we get the \l QPaintDevice of the - back buffer and create a QPainter to render to that paint device. - - To void leaving traces from the previous rendering and start with a - clean buffer, we fill the entire buffer with the color white. Then - we call the virtual render() function which does the actual - drawing of this window. - - After drawing is complete, we call endPaint() to signal that we - are done rendering and present the contents in the back buffer - using \l QBackingStore::flush(). - - - \snippet rasterwindow/rasterwindow.cpp 4 - - The render function contains the drawing code for the window. In - this minial example, we only draw the string "QWindow" in the - center. - - - \section1 Rendering Asynchronously - - - \snippet rasterwindow/rasterwindow.cpp 6 - - We went through a few places where the window needed to repainted - immediately. There are some cases where this is not desierable, - but rather let the application return to the event loop and - later. We acheive this by posting an even to ourself which will - then be delivered when the application returns to the \l - QGuiApplication event loop. To avoid posting new requests when one - is already pending, we store this state in the \c m_update_pending - variable. - - \snippet rasterwindow/rasterwindow.cpp 7 - - We reimplement the virtual \l QObject::event() function to handle - the update event we posted to ourselves. When the event comes in - we reset the pending update flag and call renderNow() to render - the window right away. - - */ diff --git a/examples/gui/doc/src/analogclockwindow.qdoc b/examples/gui/doc/src/analogclockwindow.qdoc new file mode 100644 index 0000000000..ff361a27b1 --- /dev/null +++ b/examples/gui/doc/src/analogclockwindow.qdoc @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** 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 analogclock + \title Analog Clock Window Example + + \brief The Analog Clock Window example shows how to draw the contents of + a custom window. + + \image analogclock-window-example.png Screenshot of the Analog + Clock Window example + + This example demonstrates how the transformation and scaling + features of QPainter can be used to make drawing easier. + + \section1 AnalogClockWindow Class Definition + + The \c AnalogClockWindow class provides a clock with hour and + minute hands that is automatically updated every few seconds. We + make use of the RasterWindow from the \l {Raster Window Example} + and reimplement the \c render function to draw the clock face: + + \snippet analogclock/main.cpp 5 + + \section1 AnalogClock Class Implementation + + \snippet analogclock/main.cpp 6 + + We set a title on the window and resize to a reasonable size. Then + we start a timer which we will use to redraw the clock every + second. + + \snippet analogclock/main.cpp 7 + + The timerEvent function is called every second as a result of + our startTimer call. Making use of the convenience in the base + class, we schedule the window to be repainted. + + Checking the timer's id is not strictly needed as we only have + one active timer in this instance, but it is good practice to do + so. + + \snippet analogclock/main.cpp 14 + \snippet analogclock/main.cpp 8 + + Before we set up the painter and draw the clock, we first define + two lists of \l {QPoint}s and two \l{QColor}s that will be used + for the hour and minute hands. The minute hand's color has an + alpha component of 191, meaning that it's 75% opaque. + + \snippet analogclock/main.cpp 9 + + We call QPainter::setRenderHint() with QPainter::Antialiasing to + turn on antialiasing. This makes drawing of diagonal lines much + smoother. + + \snippet analogclock/main.cpp 10 + + The translation moves the origin to the center of the window, and + the scale operation ensures that the following drawing operations + are scaled to fit within the window. We use a scale factor that + let's us use x and y coordinates between -100 and 100, and that + ensures that these lie within the length of the window's shortest + side. + + To make our code simpler, we will draw a fixed size clock face that will + be positioned and scaled so that it lies in the center of the window. + + We also determine the length of the window's shortest side so that we + can fit the clock face inside the window. + + The painter takes care of all the transformations made during the + rendering, and ensures that everything is drawn correctly. Letting + the painter handle transformations is often easier than performing + manual calculations. + + \image analogclockwindow-viewport.png + + We draw the hour hand first, using a formula that rotates the coordinate + system counterclockwise by a number of degrees determined by the current + hour and minute. This means that the hand will be shown rotated clockwise + by the required amount. + + \snippet analogclock/main.cpp 11 + + We set the pen to be Qt::NoPen because we don't want any outline, + and we use a solid brush with the color appropriate for + displaying hours. Brushes are used when filling in polygons and + other geometric shapes. + + \snippet analogclock/main.cpp 2 + + We save and restore the transformation matrix before and after the + rotation because we want to place the minute hand without having to + take into account any previous rotations. + + \snippet analogclock/main.cpp 12 + + We draw markers around the edge of the clock for each hour. We + draw each marker then rotate the coordinate system so that the + painter is ready for the next one. + + \snippet analogclock/main.cpp 13 + \snippet analogclock/main.cpp 3 + + The minute hand is rotated in a similar way to the hour hand. + + \snippet analogclock/main.cpp 4 + + Again, we draw markers around the edge of the clock, but this + time to indicate minutes. We skip multiples of 5 to avoid drawing + minute markers on top of hour markers. +*/ diff --git a/examples/gui/doc/src/openglwindow.qdoc b/examples/gui/doc/src/openglwindow.qdoc new file mode 100644 index 0000000000..d26fd477af --- /dev/null +++ b/examples/gui/doc/src/openglwindow.qdoc @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** 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 openglwindow + \title OpenGL Window Example + + \brief This example shows how to create a minimal QWindow based application + for the purpose of using OpenGL. + + \image openglwindow-example.png Screenshot of the OpenGLWindow example + + \section1 OpenGLWindow super class + + Our OpenGLWindow class acts as an API which is then subclassed to do the + actual rendering. It has functions to make a request for render() to be + called, either immediately with renderNow() or as soon as the event loop + has finished processing the current batch of events with renderLater(). + The OpenGLWindow subclass can either reimplement render() for OpenGL based + rendering, or render(QPainter *) for rendering with a QPainter. Use + OpenGLWindow::setAnimating(true) for render() to be called at the vertical + refresh rate, assuming vertical sync is enabled in the underlying OpenGL + drivers. + + In the class that does the OpenGL rendering you will typically want to + inherit from QOpenGLFunctions, as our OpenGLWindow does, in order to get + platform independent access to OpenGL ES 2.0 functions. By inheriting from + QOpenGLFunctions the OpenGL functions it contains will get precedence, and + you will not have to worry about resolving those functions if you want your + application to work with OpenGL as well as OpenGL ES 2.0. + + \snippet openglwindow/openglwindow.h 1 + + The window's surface type must be set to QSurface::OpenGLSurface to + indicate that the window is to be used for OpenGL rendering and not for + rendering raster content with QPainter using a QBackingStore. + + \snippet openglwindow/openglwindow.cpp 1 + + Any OpenGL initialization needed can be done by overriding the initialize() + function, which is called once before the first call to render(), with a + valid current QOpenGLContext. As can be seen in the following code snippet, + the default render(QPainter *) and initialize() implementations are empty, + whereas the default render() implementation initializes a + QOpenGLPaintDevice and then calls into render(QPainter *). + + \snippet openglwindow/openglwindow.cpp 2 + + The renderLater() function simply puts an update request event on + the event loop, which leads to renderNow() being called once the event + gets processed. + + We also call renderNow() when we get an expose event. The exposeEvent() is + the notification to the window that its exposure, meaning visibility, on + the screen has changed. When the expose event is received you can query + QWindow::isExposed() to find out whether or not the window is currently + exposed. Do not render to or call QOpenGLContext::swapBuffers() on a window + before it has received its first expose event, as before then its final + size might be unknown, and in addition what is rendered might not even end + up on the screen. + + \snippet openglwindow/openglwindow.cpp 3 + + In renderNow() we return if we are not currently exposed, in which case + rendering is delayed until we actually get an expose event. If we have not + yet done so, we create the QOpenGLContext with the same QSurfaceFormat as + was set on the OpenGLWindow, and call initialize() for the sake of the sub + class, and initializeOpenGLFunctions() in order for the QOpenGLFunctions + super class to be associated with the correct QOpenGLContext. In any case + we make the context current by calling QOpenGLContext::makeCurrent(), call + render() to do the actual rendering, and finally we schedule for the + rendered contents to be made visible by calling + QOpenGLContext::swapBuffers() with the OpenGLWindow as parameter. + + Once the rendering of a frame using an OpenGL context is initiated by + calling QOpenGLContext::makeCurrent(), giving the surface on which to + render as a parameter, OpenGL commands can be issued. The commands can be + issued either directly by including , which also includes the + system's OpenGL headers, or as by using QOpenGLFunctions, which can + either be inherited from for convenience, or accessed using + QOpenGLContext::functions(). QOpenGLFunctions gives access to all the + OpenGL ES 2.0 level OpenGL calls that are not already standard in both + OpenGL ES 2.0 and desktop OpenGL. For more information about the OpenGL and + OpenGL ES APIs, refer to the official \l{http://www.opengl.org/registry/}{OpenGL Registry} and + \l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}. + + If animation has been enabled with OpenGLWindow::setAnimating(true), we + call renderLater() to put another update request on the event loop. + + \snippet openglwindow/openglwindow.cpp 4 + + Enabling animation also triggers an update request as shown in the + following code snippet. + + \snippet openglwindow/openglwindow.cpp 5 + + \section1 Example OpenGL rendering sub class + + Here we sub class OpenGLWindow to show how to do OpenGL to render a + rotating triangle. By indirectly sub classing QOpenGLFunctions we gain + access to all OpenGL ES 2.0 level functionality. + + \snippet openglwindow/main.cpp 1 + + In our main function we initialize QGuiApplication and instantiate our + TriangleOpenGLWindow. We give it a QSurfaceFormat specifying that we want + four samples of multisample antialiasing, as well as a default geometry. + Since we want to have animation we call the above mentioned setAnimating() + function with an argument of true. + + \snippet openglwindow/main.cpp 2 + + The following code snippet shows the OpenGL shader program used in this + example. The vertex and fragment shaders are relatively simple, doing + vertex transformation and interpolated vertex coloring. + + \snippet openglwindow/main.cpp 3 + + Here is the code that loads the shaders and initializes the shader program + By using QOpenGLShaderProgram instead of raw OpenGL we get the convenience + that strips out the highp, mediump, and lowp qualifiers on desktop OpenGL, + where they are not part of the standard. We store the attribute and uniform + locations in member variables to avoid having to do the location lookup + each frame. + + \snippet openglwindow/main.cpp 4 + + Finally, here is our render() function, where we use OpenGL to set up the + viewport, clear the background, and render a rotating triangle. + + \snippet openglwindow/main.cpp 5 +*/ diff --git a/examples/gui/doc/src/rasterwindow.qdoc b/examples/gui/doc/src/rasterwindow.qdoc new file mode 100644 index 0000000000..f246533c4f --- /dev/null +++ b/examples/gui/doc/src/rasterwindow.qdoc @@ -0,0 +1,161 @@ +**************************************************************************** +** +** 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 rasterwindow + \title Raster Window Example + + \brief This example shows how to create a minimal QWindow based + application using QPainter for rendering. + + + \section1 Application Entry Point + + \snippet rasterwindow/main.cpp 1 + + The entry point for a QWindow based application is the \l + QGuiApplication class. It manages the GUI application's control + flow and main settings. We pass the command line arguments which + can be used to pick up certain system wide options. + + From there, we go on to create our window instance and then call + the \l QWindow::show() function to tell the windowing system that + this window should now be made visible on screen. + + Once this is done, we enter the application's event loop so the + application can run. + + + \section1 RasterWindow Declaration + + \snippet rasterwindow/rasterwindow.h 1 + + We first start by including the the QtGui headers. This means we + can use all classes in the Qt GUI module. Classes can also be + included individually if that is preferred. + + The RasterWindow class subclasses QWindow directly and provides a + constructor which allows the window to be a sub-window of another + QWindow. Parent-less QWindows show up in the windowing system as + top-level windows. + + The class declares a QBackingStore which is what we use to manage + the window's back buffer for QPainter based graphics. + + \e {The raster window is also reused in a few other examples and adds + a few helper functions, like renderLater().} + + + \section1 RasterWindow Implementation + + \snippet rasterwindow/rasterwindow.cpp 1 + + The constructor first of all calls \l QWindow::create(). This will + create the window in the windowing system. Without calling create, + the window will not get events and will not be visible in the + windowing system. The call to create does not show the window. We + then set the geometry to be something reasonable. + + Then we create the backingstore and pass it the window instance it + is supposed to manage. + + \snippet rasterwindow/rasterwindow.cpp 2 + + Shortly after calling \l QWindow::show() on a created window, the + virtual function \l QWindow::exposeEvent() will be called to + notify us that the window's exposure in the windowing system has + changed. The event contains the exposed sub-region, but since we + will anyway draw the entire window every time, we do not make use + of that. + + The function \l QWindow::isExposed() will tell us if the window is + showing or not. We need this as the exposeEvent is called also + when the window becomes obscured in the windowing system. If the + window is showing, we call renderNow() to draw the window + immediately. We want to draw right away so we can present the + system with some visual content. + + + \snippet rasterwindow/rasterwindow.cpp 5 + + The resize event is guaranteed to be called prior to the window + being shown on screen and will also be called whenever the window + is resized while on screen. We use this to resize the back buffer + and call renderNow() if we are visible to immediately update the + visual representation of the window on screen. + + \snippet rasterwindow/rasterwindow.cpp 3 + + The renderNow function sets up what is needed for a \l QWindow to + render its content using QPainter. As obscured windows have will + not be visible, we abort if the window is not exposed in the + windowing system. This can for instance happen when another window + fully obscures this window. + + We start the drawing by calling \l QBackingStore::beginPaint() on + the region we want to draw. Then we get the \l QPaintDevice of the + back buffer and create a QPainter to render to that paint device. + + To void leaving traces from the previous rendering and start with a + clean buffer, we fill the entire buffer with the color white. Then + we call the virtual render() function which does the actual + drawing of this window. + + After drawing is complete, we call endPaint() to signal that we + are done rendering and present the contents in the back buffer + using \l QBackingStore::flush(). + + + \snippet rasterwindow/rasterwindow.cpp 4 + + The render function contains the drawing code for the window. In + this minial example, we only draw the string "QWindow" in the + center. + + + \section1 Rendering Asynchronously + + + \snippet rasterwindow/rasterwindow.cpp 6 + + We went through a few places where the window needed to repainted + immediately. There are some cases where this is not desierable, + but rather let the application return to the event loop and + later. We acheive this by posting an even to ourself which will + then be delivered when the application returns to the \l + QGuiApplication event loop. To avoid posting new requests when one + is already pending, we store this state in the \c m_update_pending + variable. + + \snippet rasterwindow/rasterwindow.cpp 7 + + We reimplement the virtual \l QObject::event() function to handle + the update event we posted to ourselves. When the event comes in + we reset the pending update flag and call renderNow() to render + the window right away. + + */ -- cgit v1.2.3 From 1cf191ec6d18ba433c50cbd41c85d5e80c8fb69c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 17 Dec 2012 17:37:40 +0100 Subject: fix examples/gui/analogclock for MSVC This example is hit by the infamous QTBUG-13496 issue. Task-number: QTBUG-28665 Change-Id: I9bcffe72d34b1eaa9f5beafc69a16913a597d17f Reviewed-by: Oswald Buddenhagen Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/gui/analogclock/analogclock.pro | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/gui/analogclock/analogclock.pro b/examples/gui/analogclock/analogclock.pro index 2183c6888a..eef17274f5 100644 --- a/examples/gui/analogclock/analogclock.pro +++ b/examples/gui/analogclock/analogclock.pro @@ -1,5 +1,8 @@ include(../rasterwindow/rasterwindow.pri) +# work-around for QTBUG-13496 +CONFIG += no_batch + SOURCES += \ main.cpp -- cgit v1.2.3 From c9aa1f2c2a7f6d7a238fa2554a419a80cc64752d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Dec 2012 14:19:18 +0100 Subject: Fix compilation of Open GL ES 2 examples when using a Qt-namespace. Change-Id: I174569a8c989ab53fb6b9bb700c110db2f93c2d5 Reviewed-by: hjk --- examples/opengl/hellogl_es2/bubble.h | 2 +- examples/opengl/hellogl_es2/mainwindow.h | 3 --- examples/opengl/textures/glwidget.h | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/opengl/hellogl_es2/bubble.h b/examples/opengl/hellogl_es2/bubble.h index cd4c8d91cc..b913d3620d 100644 --- a/examples/opengl/hellogl_es2/bubble.h +++ b/examples/opengl/hellogl_es2/bubble.h @@ -47,7 +47,7 @@ #include #include -class QPainter; +QT_FORWARD_DECLARE_CLASS(QPainter) class Bubble { diff --git a/examples/opengl/hellogl_es2/mainwindow.h b/examples/opengl/hellogl_es2/mainwindow.h index 7e16a6b6a7..4aac220692 100644 --- a/examples/opengl/hellogl_es2/mainwindow.h +++ b/examples/opengl/hellogl_es2/mainwindow.h @@ -43,9 +43,6 @@ #include -class QSlider; -class GLWidget; - class MainWindow : public QMainWindow { Q_OBJECT diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h index 11a9818e19..757a7df627 100644 --- a/examples/opengl/textures/glwidget.h +++ b/examples/opengl/textures/glwidget.h @@ -44,7 +44,7 @@ #include #include -class QGLShaderProgram; +QT_FORWARD_DECLARE_CLASS(QGLShaderProgram); class GLWidget : public QGLWidget { -- cgit v1.2.3 From 0b085984874fd0415c419e60af25e7854d0b17de Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Thu, 20 Dec 2012 22:29:05 +0000 Subject: Fix typo in docs. Change-Id: I608fbf5751bf1fa819d9fe10e159fa2a9c5e238d Reviewed-by: hjk --- examples/network/doc/src/fortuneserver.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc index 7422120975..ca04d80ade 100644 --- a/examples/network/doc/src/fortuneserver.qdoc +++ b/examples/network/doc/src/fortuneserver.qdoc @@ -56,7 +56,7 @@ \snippet fortuneserver/server.cpp 2 - Our server generates a list of random fortunes that is can send to + Our server generates a list of random fortunes that it can send to connecting clients. \snippet fortuneserver/server.cpp 3 -- cgit v1.2.3 From 586adeabe4d58a7c8a71bbb1be79c3533ab858ff Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Dec 2012 12:09:56 +0100 Subject: add and use qtHaveModule() function this is much more elegant than the so far propagated !isEmpty(QT.foo.name). also replace feature-specific tests (no-gui and no-widgets) and the obsolete contains(QT_CONFIG, foo) syntax. Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b Reviewed-by: Sergio Ahumada Reviewed-by: Tasuku Suzuki Reviewed-by: Oswald Buddenhagen --- examples/dbus/dbus.pro | 2 +- examples/examples.pro | 12 ++++++------ examples/network/network.pro | 2 +- examples/opengl/cube/cube.pro | 2 +- examples/qtconcurrent/qtconcurrent.pro | 2 +- examples/threads/threads.pro | 2 +- examples/touch/fingerpaint/fingerpaint.pro | 2 +- examples/widgets/animation/sub-attaq/sub-attaq.pro | 2 +- examples/widgets/graphicsview/chip/chip.pro | 4 ++-- examples/widgets/graphicsview/graphicsview.pro | 2 +- examples/widgets/graphicsview/padnavigator/padnavigator.pro | 2 +- examples/widgets/itemviews/pixelator/pixelator.pro | 2 +- examples/widgets/itemviews/spreadsheet/spreadsheet.pro | 4 ++-- examples/widgets/mainwindows/dockwidgets/dockwidgets.pro | 2 +- examples/widgets/painting/affine/affine.pro | 2 +- examples/widgets/painting/composition/composition.pro | 2 +- examples/widgets/painting/deform/deform.pro | 2 +- examples/widgets/painting/fontsampler/fontsampler.pro | 2 +- examples/widgets/painting/gradients/gradients.pro | 2 +- examples/widgets/painting/pathstroke/pathstroke.pro | 2 +- examples/widgets/painting/shared/shared.pri | 2 +- examples/widgets/painting/shared/shared.pro | 2 +- examples/widgets/richtext/orderform/orderform.pro | 2 +- examples/widgets/richtext/textedit/textedit.pro | 2 +- examples/widgets/statemachine/statemachine.pro | 2 +- examples/widgets/tutorials/threads/threads.pro | 2 +- examples/widgets/widgets/imageviewer/imageviewer.pro | 2 +- examples/widgets/widgets/scribble/scribble.pro | 2 +- examples/xml/xml.pro | 2 +- 29 files changed, 36 insertions(+), 36 deletions(-) (limited to 'examples') diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro index 200dfb2484..fd43c23fa3 100644 --- a/examples/dbus/dbus.pro +++ b/examples/dbus/dbus.pro @@ -3,7 +3,7 @@ SUBDIRS = listnames \ pingpong \ complexpingpong -!contains(QT_CONFIG, no-widgets) { +qtHaveModule(widgets) { SUBDIRS += chat \ remotecontrolledcar } diff --git a/examples/examples.pro b/examples/examples.pro index e1c3611836..e66226703e 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -8,7 +8,7 @@ SUBDIRS = \ xml \ qpa -!contains(QT_CONFIG, no-widgets) { +qtHaveModule(widgets) { SUBDIRS += widgets \ ipc \ sql \ @@ -17,12 +17,12 @@ SUBDIRS = \ gestures } -wince*|embedded|x11:!contains(QT_CONFIG, no-gui): SUBDIRS += embedded +wince*|embedded|x11:qtHaveModule(gui): SUBDIRS += embedded -contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG, no-widgets):SUBDIRS += qtestlib -contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl -contains(QT_CONFIG, dbus): SUBDIRS += dbus -contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent +contains(QT_BUILD_PARTS, tools):qtHaveModule(gui):qtHaveModule(widgets): SUBDIRS += qtestlib +qtHaveModule(opengl):qtHaveModule(widgets): SUBDIRS += opengl +qtHaveModule(dbus): SUBDIRS += dbus +qtHaveModule(concurrent): SUBDIRS += qtconcurrent aggregate.files = aggregate/examples.pro aggregate.path = $$[QT_INSTALL_EXAMPLES] diff --git a/examples/network/network.pro b/examples/network/network.pro index f473a112f6..342297528b 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -4,7 +4,7 @@ SUBDIRS = \ download \ downloadmanager -!contains(QT_CONFIG, no-widgets) { +qtHaveModule(widgets) { SUBDIRS += \ blockingfortuneclient \ broadcastreceiver \ diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro index aaa933c1e2..710b4442c7 100644 --- a/examples/opengl/cube/cube.pro +++ b/examples/opengl/cube/cube.pro @@ -5,7 +5,7 @@ TEMPLATE = app SOURCES += main.cpp -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { QT += opengl SOURCES += mainwidget.cpp \ diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro index 72220b1ab3..dafbabb5c3 100644 --- a/examples/qtconcurrent/qtconcurrent.pro +++ b/examples/qtconcurrent/qtconcurrent.pro @@ -8,7 +8,7 @@ SUBDIRS = imagescaling \ SUBDIRS += progressdialog } -contains(QT_CONFIG, no-widgets) { +!qtHaveModule(widgets) { SUBDIRS -= \ imagescaling \ progressdialog \ diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro index 027d4c2ebb..e47da84a06 100644 --- a/examples/threads/threads.pro +++ b/examples/threads/threads.pro @@ -4,4 +4,4 @@ CONFIG += no_docs_target SUBDIRS = semaphores \ waitconditions -!contains(QT_CONFIG, no-widgets):SUBDIRS += mandelbrot +qtHaveModule(widgets): SUBDIRS += mandelbrot diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro index 5093c8ad8d..5391897af7 100644 --- a/examples/touch/fingerpaint/fingerpaint.pro +++ b/examples/touch/fingerpaint/fingerpaint.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = mainwindow.h \ scribblearea.h 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/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/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro index 901533a8de..9d6d7a75f6 100644 --- a/examples/widgets/graphicsview/graphicsview.pro +++ b/examples/widgets/graphicsview/graphicsview.pro @@ -15,6 +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 } 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/itemviews/pixelator/pixelator.pro b/examples/widgets/itemviews/pixelator/pixelator.pro index b844e7c3a4..35176a6026 100644 --- a/examples/widgets/itemviews/pixelator/pixelator.pro +++ b/examples/widgets/itemviews/pixelator/pixelator.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = imagemodel.h \ mainwindow.h \ 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/mainwindows/dockwidgets/dockwidgets.pro b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro index 4bccf49399..f445c5a89e 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = mainwindow.h SOURCES = main.cpp \ 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/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/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 8325da0175..08dd07bc08 100644 --- a/examples/widgets/painting/fontsampler/fontsampler.pro +++ b/examples/widgets/painting/fontsampler/fontsampler.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport FORMS = mainwindowbase.ui HEADERS = mainwindow.h 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/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..1b8be82d03 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) { DEFINES += QT_OPENGL_SUPPORT QT += opengl widgets } diff --git a/examples/widgets/painting/shared/shared.pro b/examples/widgets/painting/shared/shared.pro index 42b474a946..2756bf75ca 100644 --- a/examples/widgets/painting/shared/shared.pro +++ b/examples/widgets/painting/shared/shared.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += static -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/richtext/orderform/orderform.pro b/examples/widgets/richtext/orderform/orderform.pro index 1477d6ecab..0eb9da3ae1 100644 --- a/examples/widgets/richtext/orderform/orderform.pro +++ b/examples/widgets/richtext/orderform/orderform.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = detailsdialog.h \ mainwindow.h diff --git a/examples/widgets/richtext/textedit/textedit.pro b/examples/widgets/richtext/textedit/textedit.pro index 36f860c5a8..c32bf68f68 100644 --- a/examples/widgets/richtext/textedit/textedit.pro +++ b/examples/widgets/richtext/textedit/textedit.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport TEMPLATE = app TARGET = textedit 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/tutorials/threads/threads.pro b/examples/widgets/tutorials/threads/threads.pro index 4d51120794..19718d760c 100644 --- a/examples/widgets/tutorials/threads/threads.pro +++ b/examples/widgets/tutorials/threads/threads.pro @@ -5,4 +5,4 @@ SUBDIRS = hellothread \ clock \ movedobject -contains(QT_CONFIG, concurrent): SUBDIRS += helloconcurrent +qtHaveModule(concurrent): SUBDIRS += helloconcurrent diff --git a/examples/widgets/widgets/imageviewer/imageviewer.pro b/examples/widgets/widgets/imageviewer/imageviewer.pro index 3378db7fb6..a0f9cebbda 100644 --- a/examples/widgets/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/widgets/imageviewer/imageviewer.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = imageviewer.h SOURCES = imageviewer.cpp \ diff --git a/examples/widgets/widgets/scribble/scribble.pro b/examples/widgets/widgets/scribble/scribble.pro index 8c35ba777f..aff0fb442c 100644 --- a/examples/widgets/widgets/scribble/scribble.pro +++ b/examples/widgets/widgets/scribble/scribble.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport HEADERS = mainwindow.h \ scribblearea.h diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro index 7c7b6f7456..bc8686a475 100644 --- a/examples/xml/xml.pro +++ b/examples/xml/xml.pro @@ -2,7 +2,7 @@ TEMPLATE = subdirs SUBDIRS = htmlinfo \ xmlstreamlint -!contains(QT_CONFIG, no-widgets) { +qtHaveModule(widgets) { SUBDIRS += dombookmarks \ rsslisting \ saxbookmarks \ -- cgit v1.2.3 From 0136252cb2973824b7f97abad1d4c3a4d9301178 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 19 Dec 2012 11:27:10 +0100 Subject: Polish code of some opengl examples Change-Id: If24ae1845176fc525cf6a239a5079f4802f8df3f Reviewed-by: Friedemann Kleint --- examples/opengl/2dpainting/glwidget.cpp | 3 +- examples/opengl/2dpainting/glwidget.h | 4 -- examples/opengl/2dpainting/helper.cpp | 16 ++++--- examples/opengl/2dpainting/helper.h | 6 +-- examples/opengl/2dpainting/main.cpp | 3 +- examples/opengl/2dpainting/widget.cpp | 3 +- examples/opengl/2dpainting/widget.h | 3 -- examples/opengl/2dpainting/window.cpp | 10 +++-- examples/opengl/2dpainting/window.h | 7 +-- examples/opengl/cube/geometryengine.cpp | 3 +- examples/opengl/cube/geometryengine.h | 8 ++-- examples/opengl/cube/main.cpp | 19 ++++---- examples/opengl/cube/mainwidget.cpp | 65 +++++++++------------------ examples/opengl/cube/mainwidget.h | 24 +++++----- examples/opengl/grabber/glwidget.cpp | 63 ++++++++++++-------------- examples/opengl/grabber/glwidget.h | 2 +- examples/opengl/grabber/main.cpp | 8 ++-- examples/opengl/grabber/mainwindow.cpp | 5 +-- examples/opengl/grabber/mainwindow.h | 4 +- examples/opengl/hellowindow/hellowindow.cpp | 56 ++++++++++------------- examples/opengl/hellowindow/hellowindow.h | 13 ++---- examples/opengl/hellowindow/main.cpp | 20 +++++---- examples/opengl/overpainting/bubble.cpp | 2 - examples/opengl/overpainting/bubble.h | 12 +---- examples/opengl/overpainting/glwidget.cpp | 12 ++--- examples/opengl/overpainting/glwidget.h | 10 +---- examples/opengl/overpainting/main.cpp | 3 +- examples/opengl/overpainting/overpainting.pro | 4 +- examples/opengl/shared/qtlogo.cpp | 49 ++++++++++---------- 29 files changed, 182 insertions(+), 255 deletions(-) (limited to 'examples') diff --git a/examples/opengl/2dpainting/glwidget.cpp b/examples/opengl/2dpainting/glwidget.cpp index 23065a0b42..e1e40ea84c 100644 --- a/examples/opengl/2dpainting/glwidget.cpp +++ b/examples/opengl/2dpainting/glwidget.cpp @@ -38,10 +38,11 @@ ** ****************************************************************************/ -#include #include "glwidget.h" #include "helper.h" +#include + //! [0] GLWidget::GLWidget(Helper *helper, QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent), helper(helper) diff --git a/examples/opengl/2dpainting/glwidget.h b/examples/opengl/2dpainting/glwidget.h index f8e44f8a3e..3540810983 100644 --- a/examples/opengl/2dpainting/glwidget.h +++ b/examples/opengl/2dpainting/glwidget.h @@ -45,10 +45,6 @@ //! [0] class Helper; -QT_BEGIN_NAMESPACE -class QPaintEvent; -class QWidget; -QT_END_NAMESPACE class GLWidget : public QGLWidget { diff --git a/examples/opengl/2dpainting/helper.cpp b/examples/opengl/2dpainting/helper.cpp index b412dc11dc..168df2aff3 100644 --- a/examples/opengl/2dpainting/helper.cpp +++ b/examples/opengl/2dpainting/helper.cpp @@ -38,9 +38,12 @@ ** ****************************************************************************/ -#include #include "helper.h" +#include +#include +#include + //! [0] Helper::Helper() { @@ -70,14 +73,15 @@ void Helper::paint(QPainter *painter, QPaintEvent *event, int elapsed) painter->setPen(circlePen); painter->rotate(elapsed * 0.030); - qreal r = elapsed/1000.0; + qreal r = elapsed / 1000.0; int n = 30; for (int i = 0; i < n; ++i) { painter->rotate(30); - qreal radius = 0 + 120.0*((i+r)/n); - qreal circleRadius = 1 + ((i+r)/n)*20; + qreal factor = (i + r) / n; + qreal radius = 0 + 120.0 * factor; + qreal circleRadius = 1 + factor * 20; painter->drawEllipse(QRectF(radius, -circleRadius, - circleRadius*2, circleRadius*2)); + circleRadius * 2, circleRadius * 2)); } painter->restore(); //! [2] @@ -85,6 +89,6 @@ void Helper::paint(QPainter *painter, QPaintEvent *event, int elapsed) //! [3] painter->setPen(textPen); painter->setFont(textFont); - painter->drawText(QRect(-50, -50, 100, 100), Qt::AlignCenter, "Qt"); + painter->drawText(QRect(-50, -50, 100, 100), Qt::AlignCenter, QStringLiteral("Qt")); } //! [3] diff --git a/examples/opengl/2dpainting/helper.h b/examples/opengl/2dpainting/helper.h index 10bb2a5a9c..47f4c96639 100644 --- a/examples/opengl/2dpainting/helper.h +++ b/examples/opengl/2dpainting/helper.h @@ -44,11 +44,7 @@ #include #include #include - -QT_BEGIN_NAMESPACE -class QPainter; -class QPaintEvent; -QT_END_NAMESPACE +#include //! [0] class Helper diff --git a/examples/opengl/2dpainting/main.cpp b/examples/opengl/2dpainting/main.cpp index 3374e57964..903795685f 100644 --- a/examples/opengl/2dpainting/main.cpp +++ b/examples/opengl/2dpainting/main.cpp @@ -38,9 +38,10 @@ ** ****************************************************************************/ -#include #include "window.h" +#include + int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/examples/opengl/2dpainting/widget.cpp b/examples/opengl/2dpainting/widget.cpp index 49ce8b1329..832f37eb36 100644 --- a/examples/opengl/2dpainting/widget.cpp +++ b/examples/opengl/2dpainting/widget.cpp @@ -38,10 +38,11 @@ ** ****************************************************************************/ -#include #include "widget.h" #include "helper.h" +#include +#include //! [0] Widget::Widget(Helper *helper, QWidget *parent) diff --git a/examples/opengl/2dpainting/widget.h b/examples/opengl/2dpainting/widget.h index 7d665b3952..ccf424330c 100644 --- a/examples/opengl/2dpainting/widget.h +++ b/examples/opengl/2dpainting/widget.h @@ -45,9 +45,6 @@ //! [0] class Helper; -QT_BEGIN_NAMESPACE -class QPaintEvent; -QT_END_NAMESPACE class Widget : public QWidget { diff --git a/examples/opengl/2dpainting/window.cpp b/examples/opengl/2dpainting/window.cpp index 700d0caaa8..b6aba2a945 100644 --- a/examples/opengl/2dpainting/window.cpp +++ b/examples/opengl/2dpainting/window.cpp @@ -38,15 +38,19 @@ ** ****************************************************************************/ -#include #include "glwidget.h" #include "widget.h" #include "window.h" +#include +#include +#include + //! [0] Window::Window() - : QWidget() { + setWindowTitle(tr("2D Painting on Native and OpenGL Widgets")); + Widget *native = new Widget(&helper, this); GLWidget *openGL = new GLWidget(&helper, this); QLabel *nativeLabel = new QLabel(tr("Native")); @@ -65,7 +69,5 @@ Window::Window() connect(timer, SIGNAL(timeout()), native, SLOT(animate())); connect(timer, SIGNAL(timeout()), openGL, SLOT(animate())); timer->start(50); - - setWindowTitle(tr("2D Painting on Native and OpenGL Widgets")); } //! [0] diff --git a/examples/opengl/2dpainting/window.h b/examples/opengl/2dpainting/window.h index 263572637e..acded9895f 100644 --- a/examples/opengl/2dpainting/window.h +++ b/examples/opengl/2dpainting/window.h @@ -41,14 +41,9 @@ #ifndef WINDOW_H #define WINDOW_H -#include - #include "helper.h" -QT_BEGIN_NAMESPACE -class QLabel; -class QWidget; -QT_END_NAMESPACE +#include //! [0] class Window : public QWidget diff --git a/examples/opengl/cube/geometryengine.cpp b/examples/opengl/cube/geometryengine.cpp index d8dfeab822..277a6e9cfc 100644 --- a/examples/opengl/cube/geometryengine.cpp +++ b/examples/opengl/cube/geometryengine.cpp @@ -49,14 +49,13 @@ struct VertexData QVector2D texCoord; }; -GeometryEngine::GeometryEngine() : vboIds(new GLuint[2]) +GeometryEngine::GeometryEngine() { } GeometryEngine::~GeometryEngine() { glDeleteBuffers(2, vboIds); - delete[] vboIds; } void GeometryEngine::init() diff --git a/examples/opengl/cube/geometryengine.h b/examples/opengl/cube/geometryengine.h index 2716b05c2b..6a15c3ce03 100644 --- a/examples/opengl/cube/geometryengine.h +++ b/examples/opengl/cube/geometryengine.h @@ -41,8 +41,8 @@ #ifndef GEOMETRYENGINE_H #define GEOMETRYENGINE_H -#include -#include +#include +#include class GeometryEngine : protected QGLFunctions { @@ -51,14 +51,12 @@ public: virtual ~GeometryEngine(); void init(); - void drawCubeGeometry(QGLShaderProgram *program); private: void initCubeGeometry(); - GLuint *vboIds; - + GLuint vboIds[2]; }; #endif // GEOMETRYENGINE_H diff --git a/examples/opengl/cube/main.cpp b/examples/opengl/cube/main.cpp index fbc1d93e4a..fdae1caa16 100644 --- a/examples/opengl/cube/main.cpp +++ b/examples/opengl/cube/main.cpp @@ -47,16 +47,15 @@ int main(int argc, char *argv[]) { - QApplication a(argc, argv); - a.setApplicationName("cube"); - a.setApplicationVersion("0.1"); -#ifndef QT_NO_OPENGL - MainWidget w; - w.resize(640, 480); - w.show(); + QApplication app(argc, argv); + app.setApplicationName("cube"); + app.setApplicationVersion("0.1"); +#ifdef QT_NO_OPENGL + MainWidget widget; + widget.show(); #else - QLabel * notifyLabel = new QLabel("OpenGL Support required"); - notifyLabel->show(); + QLabel note("OpenGL Support required"); + note.show(); #endif - return a.exec(); + return app.exec(); } diff --git a/examples/opengl/cube/mainwidget.cpp b/examples/opengl/cube/mainwidget.cpp index 055dcf49cf..4a42eca159 100644 --- a/examples/opengl/cube/mainwidget.cpp +++ b/examples/opengl/cube/mainwidget.cpp @@ -40,39 +40,26 @@ #include "mainwidget.h" -#include "geometryengine.h" - -#include - -#include #include -#include #include #include MainWidget::MainWidget(QWidget *parent) : QGLWidget(parent), - timer(new QBasicTimer), - program(new QGLShaderProgram), - geometries(new GeometryEngine), angularSpeed(0) { } MainWidget::~MainWidget() { - delete timer; timer = 0; - delete program; program = 0; - delete geometries; geometries = 0; - deleteTexture(texture); } //! [0] void MainWidget::mousePressEvent(QMouseEvent *e) { - // Saving mouse press position + // Save mouse press position mousePressPosition = QVector2D(e->localPos()); } @@ -97,17 +84,15 @@ void MainWidget::mouseReleaseEvent(QMouseEvent *e) //! [0] //! [1] -void MainWidget::timerEvent(QTimerEvent *e) +void MainWidget::timerEvent(QTimerEvent *) { - Q_UNUSED(e); - // Decrease angular speed (friction) angularSpeed *= 0.99; // Stop rotation when speed goes below threshold - if (angularSpeed < 0.01) + if (angularSpeed < 0.01) { angularSpeed = 0.0; - else { + } else { // Update rotation rotation = QQuaternion::fromAxisAndAngle(rotationAxis, angularSpeed) * rotation; @@ -120,13 +105,8 @@ void MainWidget::timerEvent(QTimerEvent *e) void MainWidget::initializeGL() { initializeGLFunctions(); - qglClearColor(Qt::black); - - qDebug() << "Initializing shaders..."; initShaders(); - - qDebug() << "Initializing textures..."; initTextures(); //! [2] @@ -137,33 +117,32 @@ void MainWidget::initializeGL() glEnable(GL_CULL_FACE); //! [2] - qDebug() << "Initializing geometries..."; - geometries->init(); + geometries.init(); - // using QBasicTimer because its faster that QTimer - timer->start(12, this); + // Use QBasicTimer because its faster than QTimer + timer.start(12, this); } //! [3] void MainWidget::initShaders() { - // Overriding system locale until shaders are compiled + // Override system locale until shaders are compiled setlocale(LC_NUMERIC, "C"); - // Compiling vertex shader - if (!program->addShaderFromSourceFile(QGLShader::Vertex, ":/vshader.glsl")) + // Compile vertex shader + if (!program.addShaderFromSourceFile(QGLShader::Vertex, ":/vshader.glsl")) close(); - // Compiling fragment shader - if (!program->addShaderFromSourceFile(QGLShader::Fragment, ":/fshader.glsl")) + // Compile fragment shader + if (!program.addShaderFromSourceFile(QGLShader::Fragment, ":/fshader.glsl")) close(); - // Linking shader pipeline - if (!program->link()) + // Link shader pipeline + if (!program.link()) close(); - // Binding shader pipeline for use - if (!program->bind()) + // Bind shader pipeline for use + if (!program.bind()) close(); // Restore system locale @@ -174,7 +153,7 @@ void MainWidget::initShaders() //! [4] void MainWidget::initTextures() { - // Loading cube.png + // Load cube.png image glEnable(GL_TEXTURE_2D); texture = bindTexture(QImage(":/cube.png")); @@ -198,7 +177,7 @@ void MainWidget::resizeGL(int w, int h) glViewport(0, 0, w, h); // Calculate aspect ratio - qreal aspect = (qreal)w / ((qreal)h?h:1); + qreal aspect = qreal(w) / qreal(h ? h : 1); // Set near plane to 3.0, far plane to 7.0, field of view 45 degrees const qreal zNear = 3.0, zFar = 7.0, fov = 45.0; @@ -223,12 +202,12 @@ void MainWidget::paintGL() matrix.rotate(rotation); // Set modelview-projection matrix - program->setUniformValue("mvp_matrix", projection * matrix); + program.setUniformValue("mvp_matrix", projection * matrix); //! [6] - // Using texture unit 0 which contains cube.png - program->setUniformValue("texture", 0); + // Use texture unit 0 which contains cube.png + program.setUniformValue("texture", 0); // Draw cube geometry - geometries->drawCubeGeometry(program); + geometries.drawCubeGeometry(&program); } diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h index bd30ea93a0..cebfb30999 100644 --- a/examples/opengl/cube/mainwidget.h +++ b/examples/opengl/cube/mainwidget.h @@ -41,30 +41,26 @@ #ifndef MAINWIDGET_H #define MAINWIDGET_H -#include -#include +#include "geometryengine.h" +#include +#include #include #include #include +#include +#include -QT_BEGIN_NAMESPACE -class QBasicTimer; -class QGLShaderProgram; -QT_END_NAMESPACE class GeometryEngine; class MainWidget : public QGLWidget, protected QGLFunctions { Q_OBJECT + public: explicit MainWidget(QWidget *parent = 0); - virtual ~MainWidget(); - -signals: - -public slots: + ~MainWidget(); protected: void mousePressEvent(QMouseEvent *e); @@ -79,9 +75,9 @@ protected: void initTextures(); private: - QBasicTimer *timer; - QGLShaderProgram *program; - GeometryEngine *geometries; + QBasicTimer timer; + QGLShaderProgram program; + GeometryEngine geometries; GLuint texture; diff --git a/examples/opengl/grabber/glwidget.cpp b/examples/opengl/grabber/glwidget.cpp index 6d8ef0049f..00964c1a0f 100644 --- a/examples/opengl/grabber/glwidget.cpp +++ b/examples/opengl/grabber/glwidget.cpp @@ -38,12 +38,12 @@ ** ****************************************************************************/ -#include -#include +#include "glwidget.h" -#include +#include +#include -#include "glwidget.h" +#include GLWidget::GLWidget(QWidget *parent) : QGLWidget(parent) @@ -191,57 +191,52 @@ GLuint GLWidget::makeGear(const GLfloat *reflectance, GLdouble innerRadius, GLdouble r2 = outerRadius + toothSize / 2.0; GLdouble delta = (2.0 * Pi / toothCount) / 4.0; GLdouble z = thickness / 2.0; - int i, j; glShadeModel(GL_FLAT); - for (i = 0; i < 2; ++i) { + for (int i = 0; i < 2; ++i) { GLdouble sign = (i == 0) ? +1.0 : -1.0; glNormal3d(0.0, 0.0, sign); glBegin(GL_QUAD_STRIP); - for (j = 0; j <= toothCount; ++j) { + for (int j = 0; j <= toothCount; ++j) { GLdouble angle = 2.0 * Pi * j / toothCount; - glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z); - glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z); - glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z); - glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), - sign * z); + glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z); + glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z); + glVertex3d(r0 * cos(angle), r0 * sin(angle), sign * z); + glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), sign * z); } glEnd(); glBegin(GL_QUADS); - for (j = 0; j < toothCount; ++j) { + for (int j = 0; j < toothCount; ++j) { GLdouble angle = 2.0 * Pi * j / toothCount; - glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z); - glVertex3d(r2 * cos(angle + delta), r2 * sin(angle + delta), - sign * z); - glVertex3d(r2 * cos(angle + 2 * delta), r2 * sin(angle + 2 * delta), - sign * z); - glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), - sign * z); + glVertex3d(r1 * cos(angle), r1 * sin(angle), sign * z); + glVertex3d(r2 * cos(angle + delta), r2 * sin(angle + delta), sign * z); + glVertex3d(r2 * cos(angle + 2 * delta), r2 * sin(angle + 2 * delta), sign * z); + glVertex3d(r1 * cos(angle + 3 * delta), r1 * sin(angle + 3 * delta), sign * z); } glEnd(); } glBegin(GL_QUAD_STRIP); - for (i = 0; i < toothCount; ++i) { - for (j = 0; j < 2; ++j) { - GLdouble angle = 2.0 * Pi * (i + (j / 2.0)) / toothCount; + for (int i = 0; i < toothCount; ++i) { + for (int j = 0; j < 2; ++j) { + GLdouble angle = 2.0 * Pi * (i + j / 2.0) / toothCount; GLdouble s1 = r1; GLdouble s2 = r2; if (j == 1) qSwap(s1, s2); - glNormal3d(cos(angle), sin(angle), 0.0); - glVertex3d(s1 * cos(angle), s1 * sin(angle), +z); - glVertex3d(s1 * cos(angle), s1 * sin(angle), -z); + glNormal3d(cos(angle), sin(angle), 0.0); + glVertex3d(s1 * cos(angle), s1 * sin(angle), +z); + glVertex3d(s1 * cos(angle), s1 * sin(angle), -z); - glNormal3d(s2 * sin(angle + delta) - s1 * sin(angle), + glNormal3d(s2 * sin(angle + delta) - s1 * sin(angle), s1 * cos(angle) - s2 * cos(angle + delta), 0.0); - glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), +z); - glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), -z); + glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), +z); + glVertex3d(s2 * cos(angle + delta), s2 * sin(angle + delta), -z); } } glVertex3d(r1, 0.0, +z); @@ -251,11 +246,11 @@ GLuint GLWidget::makeGear(const GLfloat *reflectance, GLdouble innerRadius, glShadeModel(GL_SMOOTH); glBegin(GL_QUAD_STRIP); - for (i = 0; i <= toothCount; ++i) { - GLdouble angle = i * 2.0 * Pi / toothCount; - glNormal3d(-cos(angle), -sin(angle), 0.0); - glVertex3d(r0 * cos(angle), r0 * sin(angle), +z); - glVertex3d(r0 * cos(angle), r0 * sin(angle), -z); + for (int i = 0; i <= toothCount; ++i) { + GLdouble angle = i * 2.0 * Pi / toothCount; + glNormal3d(-cos(angle), -sin(angle), 0.0); + glVertex3d(r0 * cos(angle), r0 * sin(angle), +z); + glVertex3d(r0 * cos(angle), r0 * sin(angle), -z); } glEnd(); diff --git a/examples/opengl/grabber/glwidget.h b/examples/opengl/grabber/glwidget.h index 88a97ac8b0..6f48102111 100644 --- a/examples/opengl/grabber/glwidget.h +++ b/examples/opengl/grabber/glwidget.h @@ -94,4 +94,4 @@ private: QPoint lastPos; }; -#endif +#endif // GLWIDGET_H diff --git a/examples/opengl/grabber/main.cpp b/examples/opengl/grabber/main.cpp index f03543e449..be0e7b11cc 100644 --- a/examples/opengl/grabber/main.cpp +++ b/examples/opengl/grabber/main.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ -#include - #include "mainwindow.h" +#include + int main(int argc, char *argv[]) { QApplication app(argc, argv); - MainWindow mainWin; - mainWin.show(); + MainWindow window; + window.show(); return app.exec(); } diff --git a/examples/opengl/grabber/mainwindow.cpp b/examples/opengl/grabber/mainwindow.cpp index a559649c55..e521b39dab 100644 --- a/examples/opengl/grabber/mainwindow.cpp +++ b/examples/opengl/grabber/mainwindow.cpp @@ -38,12 +38,11 @@ ** ****************************************************************************/ -#include -#include - #include "glwidget.h" #include "mainwindow.h" +#include + MainWindow::MainWindow() { centralWidget = new QWidget; diff --git a/examples/opengl/grabber/mainwindow.h b/examples/opengl/grabber/mainwindow.h index 6f981c5381..552f902c07 100644 --- a/examples/opengl/grabber/mainwindow.h +++ b/examples/opengl/grabber/mainwindow.h @@ -44,12 +44,12 @@ #include QT_BEGIN_NAMESPACE -class QAction; class QLabel; class QMenu; class QScrollArea; class QSlider; QT_END_NAMESPACE + class GLWidget; class MainWindow : public QMainWindow @@ -91,4 +91,4 @@ private: QAction *aboutQtAct; }; -#endif +#endif // MAINWINDOW_H diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index b5166abe50..b1140c4f1d 100644 --- a/examples/opengl/hellowindow/hellowindow.cpp +++ b/examples/opengl/hellowindow/hellowindow.cpp @@ -41,9 +41,6 @@ #include "hellowindow.h" #include - -#include - #include Renderer::Renderer(const QSurfaceFormat &format, Renderer *share, QScreen *screen) @@ -77,10 +74,8 @@ HelloWindow::HelloWindow(const QSharedPointer &renderer) updateColor(); } -void HelloWindow::exposeEvent(QExposeEvent *event) +void HelloWindow::exposeEvent(QExposeEvent *) { - Q_UNUSED(event); - render(); if (!m_timer) { @@ -109,10 +104,7 @@ void HelloWindow::updateColor() }; m_color = colors[m_colorIndex]; - - m_colorIndex++; - if (m_colorIndex >= int(sizeof(colors) / sizeof(colors[0]))) - m_colorIndex = 0; + m_colorIndex = 1 - m_colorIndex; } void Renderer::render(QSurface *surface, const QColor &color, const QSize &viewSize) @@ -171,31 +163,29 @@ void Renderer::initialize() glClearColor(0.1f, 0.1f, 0.2f, 1.0f); QOpenGLShader *vshader = new QOpenGLShader(QOpenGLShader::Vertex, this); - const char *vsrc = - "attribute highp vec4 vertex;\n" - "attribute mediump vec3 normal;\n" - "uniform mediump mat4 matrix;\n" - "uniform lowp vec4 sourceColor;\n" - "varying mediump vec4 color;\n" - "void main(void)\n" - "{\n" - " vec3 toLight = normalize(vec3(0.0, 0.3, 1.0));\n" - " float angle = max(dot(normal, toLight), 0.0);\n" - " vec3 col = sourceColor.rgb;\n" - " color = vec4(col * 0.2 + col * 0.8 * angle, 1.0);\n" - " color = clamp(color, 0.0, 1.0);\n" - " gl_Position = matrix * vertex;\n" - "}\n"; - vshader->compileSourceCode(vsrc); + vshader->compileSourceCode( + "attribute highp vec4 vertex;" + "attribute mediump vec3 normal;" + "uniform mediump mat4 matrix;" + "uniform lowp vec4 sourceColor;" + "varying mediump vec4 color;" + "void main(void)" + "{" + " vec3 toLight = normalize(vec3(0.0, 0.3, 1.0));" + " float angle = max(dot(normal, toLight), 0.0);" + " vec3 col = sourceColor.rgb;" + " color = vec4(col * 0.2 + col * 0.8 * angle, 1.0);" + " color = clamp(color, 0.0, 1.0);" + " gl_Position = matrix * vertex;" + "}"); QOpenGLShader *fshader = new QOpenGLShader(QOpenGLShader::Fragment, this); - const char *fsrc = - "varying mediump vec4 color;\n" - "void main(void)\n" - "{\n" - " gl_FragColor = color;\n" - "}\n"; - fshader->compileSourceCode(fsrc); + fshader->compileSourceCode( + "varying mediump vec4 color;" + "void main(void)" + "{" + " gl_FragColor = color;" + "}"); m_program = new QOpenGLShaderProgram(this); m_program->addShader(vshader); diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h index adb85c1a6e..27cae4be7d 100644 --- a/examples/opengl/hellowindow/hellowindow.h +++ b/examples/opengl/hellowindow/hellowindow.h @@ -40,21 +40,15 @@ #include -#include -#include - #include -#include +#include #include - -QT_BEGIN_NAMESPACE -class QOpenGLContext; -class QTimer; -QT_END_NAMESPACE +#include class Renderer : public QObject { Q_OBJECT + public: explicit Renderer(const QSurfaceFormat &format, Renderer *share = 0, QScreen *screen = 0); @@ -89,6 +83,7 @@ private: class HelloWindow : public QWindow { Q_OBJECT + public: explicit HelloWindow(const QSharedPointer &renderer); diff --git a/examples/opengl/hellowindow/main.cpp b/examples/opengl/hellowindow/main.cpp index 343160f755..e63b27d093 100644 --- a/examples/opengl/hellowindow/main.cpp +++ b/examples/opengl/hellowindow/main.cpp @@ -38,21 +38,22 @@ ** ****************************************************************************/ -#include +#include "hellowindow.h" + #include #include + +#include #include #include -#include "hellowindow.h" - -int main(int argc, char **argv) +int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); const bool multipleWindows = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL) - && !QGuiApplication::arguments().contains(QLatin1String("--single")); + && !QGuiApplication::arguments().contains(QStringLiteral("--single")); QScreen *screen = QGuiApplication::primaryScreen(); @@ -71,7 +72,7 @@ int main(int argc, char **argv) HelloWindow *windowA = new HelloWindow(rendererA); windowA->setGeometry(QRect(center, windowSize).translated(-windowSize.width() - delta / 2, 0)); - windowA->setTitle(QLatin1String("Thread A - Context A")); + windowA->setTitle(QStringLiteral("Thread A - Context A")); windowA->setVisible(true); windows.prepend(windowA); @@ -85,13 +86,13 @@ int main(int argc, char **argv) HelloWindow *windowB = new HelloWindow(rendererA); windowB->setGeometry(QRect(center, windowSize).translated(delta / 2, 0)); - windowB->setTitle(QLatin1String("Thread A - Context A")); + windowB->setTitle(QStringLiteral("Thread A - Context A")); windowB->setVisible(true); windows.prepend(windowB); HelloWindow *windowC = new HelloWindow(rendererB); windowC->setGeometry(QRect(center, windowSize).translated(-windowSize.width() / 2, windowSize.height() + delta)); - windowC->setTitle(QLatin1String("Thread B - Context B")); + windowC->setTitle(QStringLiteral("Thread B - Context B")); windowC->setVisible(true); windows.prepend(windowC); @@ -113,7 +114,7 @@ int main(int argc, char **argv) window->setGeometry(QRect(center, windowSize).translated(-windowSize.width() / 2, -windowSize.height() / 2)); QChar id = QChar('B' + i); - window->setTitle(QLatin1String("Thread ") + id + QLatin1String(" - Context ") + id); + window->setTitle(QStringLiteral("Thread ") + id + QStringLiteral(" - Context ") + id); window->setVisible(true); windows.prepend(window); } @@ -128,6 +129,7 @@ int main(int argc, char **argv) for (int i = 0; i < renderThreads.size(); ++i) renderThreads.at(i)->wait(); + qDeleteAll(windows); qDeleteAll(renderThreads); diff --git a/examples/opengl/overpainting/bubble.cpp b/examples/opengl/overpainting/bubble.cpp index 5f0e9710ea..0b3e3b8778 100644 --- a/examples/opengl/overpainting/bubble.cpp +++ b/examples/opengl/overpainting/bubble.cpp @@ -38,8 +38,6 @@ ** ****************************************************************************/ -#include - #include "bubble.h" Bubble::Bubble(const QPointF &position, qreal radius, const QPointF &velocity) diff --git a/examples/opengl/overpainting/bubble.h b/examples/opengl/overpainting/bubble.h index 2a3d27480b..42dedc6e8f 100644 --- a/examples/opengl/overpainting/bubble.h +++ b/examples/opengl/overpainting/bubble.h @@ -41,15 +41,7 @@ #ifndef BUBBLE_H #define BUBBLE_H -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QPainter; -QT_END_NAMESPACE +#include class Bubble { @@ -72,4 +64,4 @@ private: QColor outerColor; }; -#endif +#endif // BUBBLE_H diff --git a/examples/opengl/overpainting/glwidget.cpp b/examples/opengl/overpainting/glwidget.cpp index df546a125b..ea29325b6c 100644 --- a/examples/opengl/overpainting/glwidget.cpp +++ b/examples/opengl/overpainting/glwidget.cpp @@ -38,16 +38,16 @@ ** ****************************************************************************/ -#include -#include -#include - -#include - #include "bubble.h" #include "qtlogo.h" #include "glwidget.h" +#include +#include + +#include +#include + #ifndef GL_MULTISAMPLE #define GL_MULTISAMPLE 0x809D #endif diff --git a/examples/opengl/overpainting/glwidget.h b/examples/opengl/overpainting/glwidget.h index ce2b29d7f3..497d5e1ac4 100644 --- a/examples/opengl/overpainting/glwidget.h +++ b/examples/opengl/overpainting/glwidget.h @@ -41,19 +41,11 @@ #ifndef GLWIDGET_H #define GLWIDGET_H -#include -#include -#include -#include #include #include class Bubble; class QtLogo; -QT_BEGIN_NAMESPACE -class QPaintEvent; -class QWidget; -QT_END_NAMESPACE //! [0] class GLWidget : public QGLWidget @@ -108,4 +100,4 @@ private: //! [4] }; -#endif +#endif // GLWIDGET_H diff --git a/examples/opengl/overpainting/main.cpp b/examples/opengl/overpainting/main.cpp index c4758956ba..2d40a7f76b 100644 --- a/examples/opengl/overpainting/main.cpp +++ b/examples/opengl/overpainting/main.cpp @@ -38,9 +38,10 @@ ** ****************************************************************************/ -#include #include "glwidget.h" +#include + int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro index 141c8cb7ce..aecc14751b 100644 --- a/examples/opengl/overpainting/overpainting.pro +++ b/examples/opengl/overpainting/overpainting.pro @@ -1,10 +1,12 @@ +QT += opengl widgets + VPATH += ../shared INCLUDEPATH += ../shared -QT += opengl widgets HEADERS = bubble.h \ glwidget.h \ qtlogo.h + SOURCES = bubble.cpp \ glwidget.cpp \ main.cpp \ diff --git a/examples/opengl/shared/qtlogo.cpp b/examples/opengl/shared/qtlogo.cpp index fa3d91c840..e49ed7e67c 100644 --- a/examples/opengl/shared/qtlogo.cpp +++ b/examples/opengl/shared/qtlogo.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ +#include "qtlogo.h" + #include #include #include #include -#include "qtlogo.h" - static const qreal tee_height = 0.311126; static const qreal cross_width = 0.25; static const qreal bar_thickness = 0.113137; @@ -117,7 +117,7 @@ void Geometry::finalize() void Geometry::appendSmooth(const QVector3D &a, const QVector3D &n, int from) { - // Smooth normals are acheived by averaging the normals for faces meeting + // Smooth normals are achieved by averaging the normals for faces meeting // at a point. First find the point in geometry already generated // (working backwards, since most often the points shared are between faces // recently added). @@ -125,28 +125,27 @@ void Geometry::appendSmooth(const QVector3D &a, const QVector3D &n, int from) for ( ; v >= from; --v) if (qFuzzyCompare(vertices[v], a)) break; - if (v < from) - { - // The vert was not found so add it as a new one, and initialize + + if (v < from) { + // The vertex was not found so add it as a new one, and initialize // its corresponding normal v = vertices.count(); vertices.append(a); normals.append(n); - } - else - { + } else { // Vert found, accumulate normals into corresponding normal slot. // Must call finalize once finished accumulating normals normals[v] += n; } - // In both cases (found or not) reference the vert via its index + + // In both cases (found or not) reference the vertex via its index faces.append(v); } void Geometry::appendFaceted(const QVector3D &a, const QVector3D &n) { - // Faceted normals are achieved by duplicating the vert for every - // normal, so that faces meeting at a vert get a sharp edge. + // Faceted normals are achieved by duplicating the vertex for every + // normal, so that faces meeting at a vertex get a sharp edge. int v = vertices.count(); vertices.append(a); normals.append(n); @@ -189,32 +188,29 @@ void Patch::draw() const void Patch::addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n) { QVector3D norm = n.isNull() ? QVector3D::normal(a, b, c) : n; - if (sm == Smooth) - { + + if (sm == Smooth) { geom->appendSmooth(a, norm, initv); geom->appendSmooth(b, norm, initv); geom->appendSmooth(c, norm, initv); - } - else - { + } else { geom->appendFaceted(a, norm); geom->appendFaceted(b, norm); geom->appendFaceted(c, norm); } + count += 3; } void Patch::addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &d) { QVector3D norm = QVector3D::normal(a, b, c); - if (sm == Smooth) - { + + if (sm == Smooth) { addTri(a, b, c, norm); addTri(a, c, d, norm); - } - else - { - // If faceted share the two common verts + } else { + // If faceted share the two common vertices addTri(a, b, c, norm); int k = geom->vertices.count(); geom->appendSmooth(a, norm, k); @@ -224,9 +220,9 @@ void Patch::addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, } } -static inline QVector extrude(const QVector &verts, qreal depth) +static inline QVector extrude(const QVector &vertices, qreal depth) { - QVector extr = verts; + QVector extr = vertices; for (int v = 0; v < extr.count(); ++v) extr[v].setZ(extr[v].z() - depth); return extr; @@ -240,6 +236,7 @@ public: for (int i = 0; i < parts.count(); ++i) parts[i]->translate(t); } + void rotate(qreal deg, QVector3D axis) { for (int i = 0; i < parts.count(); ++i) @@ -248,7 +245,7 @@ public: // No special Rectoid destructor - the parts are fetched out of this member // variable, and destroyed by the new owner - QList parts; + QList parts; }; class RectPrism : public Rectoid -- cgit v1.2.3