summaryrefslogtreecommitdiffstats
path: root/examples/widgets/doc
diff options
context:
space:
mode:
authorNico Vertriest <nico.vertriest@qt.io>2017-12-04 16:07:23 +0100
committerNico Vertriest <nico.vertriest@qt.io>2018-03-14 12:44:20 +0000
commit421cfd9492ec04f5432c81b6cad93ebe45601974 (patch)
tree7dc440cdfe58ec44e6d06a31f5e985fd4849cf43 /examples/widgets/doc
parent00304eac7b1ddd22b971da78aa84c86fe2919359 (diff)
Doc: Complete Dynamic Layouts Example
- add doc to code - replace old signal/slot syntax - more up-to-date screenshot Task-number: QTBUG-60635 Change-Id: Iec3d2c3d0d8b9c07ccd4446d74d5eca2d88e7e08 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r--examples/widgets/doc/src/dynamiclayouts.qdoc75
1 files changed, 75 insertions, 0 deletions
diff --git a/examples/widgets/doc/src/dynamiclayouts.qdoc b/examples/widgets/doc/src/dynamiclayouts.qdoc
index be59aa6ab9..0b9d43c98e 100644
--- a/examples/widgets/doc/src/dynamiclayouts.qdoc
+++ b/examples/widgets/doc/src/dynamiclayouts.qdoc
@@ -34,7 +34,82 @@
applications. The widget placement depends on whether \c Horizontal or \c
Vertical is chosen.
+ \borderedimage dynamiclayouts-example.png
For more information, visit the \l{Layout Management} page.
+ \section1 Dialog Constructor
+
+ To begin with, the application creates the UI components by calling the
+ following methods:
+
+ \list
+ \li createRotatableGroupBox()
+ \li createOptionsGroupBox()
+ \li createButtonBox()
+ \endlist
+
+ It then adds the UI components to a GridLayout (\c mainLayout).
+
+ Finally, \c Dialog::rotateWidgets() is called.
+
+ \quotefromfile layouts/dynamiclayouts/dialog.cpp
+ \skipuntil createRotatableGroupBox
+ \printuntil setWindowTitle
+
+ \section1 Creating the Main Widgets
+
+ The \c createRotatableGroupBox() method creates a rotatable group box,
+ then adds a series of widgets:
+
+ \list
+ \li QSpinBox
+ \li QSlider
+ \li QDial
+ \li QProgressBar
+ \endlist
+
+ It goes on to add signals and slots to each widget, and assigns
+ a QGridLayout called \a rotatableLayout.
+
+ \skipto Dialog::createRotatableGroupBox
+ \printuntil /^\}/
+
+ \section1 Adding Options
+
+ \c createOptionsGroupBox() creates the following widgets:
+ \list
+ \li \c optionsGroupBox
+ \li \c buttonsOrientationLabel
+ \li \c buttonsOrientationComboBox. The orientation of the ComboBox is either
+ \c horizontal (default value) or \c vertical. These two values
+ are added during the startup of the application. It is not possible
+ to leave the option empty.
+ \endlist
+
+ \skipto Dialog::createOptionsGroupBox()
+ \printuntil /^\}/
+
+ \section1 Adding Buttons
+
+ createButtonBox() constructs a QDialogButtonBox called \c buttonBox
+ to which are added a \c closeButton, a \c helpButton and a
+ \c rotateWidgetsButton.
+ It then assigns a signal and a slot to each button in \c buttonBox.
+
+ \skipto Dialog::createButtonBox()
+ \printuntil /^\}/
+
+
+ \section1 Rotating the Widgets
+
+ Removes the current widgets and activates the next widget.
+
+ \quotefromfile layouts/dynamiclayouts/dialog.cpp
+ \skipto Dialog::rotateWidgets()
+ \printuntil rotatableLayout->addWidget(rotatableWidgets[i]
+ \printuntil }
+ \printuntil }
+
\include examples-run.qdocinc
*/
+