summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@nokia.com>2012-08-21 16:13:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-23 11:20:37 +0200
commitfc924ae47e73a5b41e274a723d8f7cdefe921c4f (patch)
tree560b0969b970c262c5ebbc9eaa4d23157f103e19 /examples
parent8e0bac89d4b0f01b71c57f79a3b98a6ecb7f20ae (diff)
Doc: Fix snippet and example referencing widget examples
Widget examples were moved into a widgets subfolder, but qdoc references were not updated. Change-Id: Id2a4573e723745b9827c664c852807d6116f8f6d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/doc/addressbook.qdoc68
-rw-r--r--examples/widgets/doc/affine.qdoc2
-rw-r--r--examples/widgets/doc/analogclock.qdoc38
-rw-r--r--examples/widgets/doc/animatedtiles.qdoc2
-rw-r--r--examples/widgets/doc/appchooser.qdoc2
-rw-r--r--examples/widgets/doc/application.qdoc92
-rw-r--r--examples/widgets/doc/basicdrawing.qdoc70
-rw-r--r--examples/widgets/doc/basicgraphicslayouts.qdoc26
-rw-r--r--examples/widgets/doc/basiclayouts.qdoc30
-rw-r--r--examples/widgets/doc/basicsortfiltermodel.qdoc2
-rw-r--r--examples/widgets/doc/blurpicker.qdoc2
-rw-r--r--examples/widgets/doc/borderlayout.qdoc2
-rw-r--r--examples/widgets/doc/boxes.qdoc2
-rw-r--r--examples/widgets/doc/calculator.qdoc88
-rw-r--r--examples/widgets/doc/calendar.qdoc40
-rw-r--r--examples/widgets/doc/calendarwidget.qdoc48
-rw-r--r--examples/widgets/doc/charactermap.qdoc48
-rw-r--r--examples/widgets/doc/chart.qdoc4
-rw-r--r--examples/widgets/doc/chip.qdoc2
-rw-r--r--examples/widgets/doc/classwizard.qdoc34
-rw-r--r--examples/widgets/doc/codeeditor.qdoc24
-rw-r--r--examples/widgets/doc/coloreditorfactory.qdoc12
-rw-r--r--examples/widgets/doc/combowidgetmapper.qdoc20
-rw-r--r--examples/widgets/doc/composition.qdoc2
-rw-r--r--examples/widgets/doc/concentriccircles.qdoc32
-rw-r--r--examples/widgets/doc/configdialog.qdoc2
-rw-r--r--examples/widgets/doc/customsortfiltermodel.qdoc42
-rw-r--r--examples/widgets/doc/deform.qdoc2
-rw-r--r--examples/widgets/doc/diagramscene.qdoc146
-rw-r--r--examples/widgets/doc/digitalclock.qdoc10
-rw-r--r--examples/widgets/doc/dirview.qdoc2
-rw-r--r--examples/widgets/doc/dockwidgets.qdoc22
-rw-r--r--examples/widgets/doc/dragdroprobot.qdoc62
-rw-r--r--examples/widgets/doc/dynamiclayouts.qdoc2
-rw-r--r--examples/widgets/doc/easing.qdoc2
-rw-r--r--examples/widgets/doc/editabletreemodel.qdoc52
-rw-r--r--examples/widgets/doc/elasticnodes.qdoc64
-rw-r--r--examples/widgets/doc/elidedlabel.qdoc34
-rw-r--r--examples/widgets/doc/embeddeddialogs.qdoc2
-rw-r--r--examples/widgets/doc/eventtransitions.qdoc16
-rw-r--r--examples/widgets/doc/extension.qdoc14
-rw-r--r--examples/widgets/doc/factorial.qdoc16
-rw-r--r--examples/widgets/doc/fademessage.qdoc2
-rw-r--r--examples/widgets/doc/fetchmore.qdoc12
-rw-r--r--examples/widgets/doc/findfiles.qdoc30
-rw-r--r--examples/widgets/doc/flowlayout.qdoc28
-rw-r--r--examples/widgets/doc/fontsampler.qdoc2
-rw-r--r--examples/widgets/doc/frozencolumn.qdoc18
-rw-r--r--examples/widgets/doc/gradients.qdoc2
-rw-r--r--examples/widgets/doc/groupbox.qdoc30
-rw-r--r--examples/widgets/doc/icons.qdoc106
-rw-r--r--examples/widgets/doc/imagecomposition.qdoc38
-rw-r--r--examples/widgets/doc/imageviewer.qdoc58
-rw-r--r--examples/widgets/doc/interview.qdoc2
-rw-r--r--examples/widgets/doc/licensewizard.qdoc46
-rw-r--r--examples/widgets/doc/lighting.qdoc2
-rw-r--r--examples/widgets/doc/lineedits.qdoc32
-rw-r--r--examples/widgets/doc/mainwindow.qdoc2
-rw-r--r--examples/widgets/doc/mdi.qdoc2
-rw-r--r--examples/widgets/doc/menus.qdoc26
-rw-r--r--examples/widgets/doc/moveblocks.qdoc34
-rw-r--r--examples/widgets/doc/movie.qdoc2
-rw-r--r--examples/widgets/doc/orderform.qdoc60
-rw-r--r--examples/widgets/doc/padnavigator.qdoc86
-rw-r--r--examples/widgets/doc/painterpaths.qdoc76
-rw-r--r--examples/widgets/doc/pathstroke.qdoc2
-rw-r--r--examples/widgets/doc/pingpong.qdoc16
-rw-r--r--examples/widgets/doc/pixelator.qdoc56
-rw-r--r--examples/widgets/doc/recentfiles.qdoc2
-rw-r--r--examples/widgets/doc/rogue.qdoc24
-rw-r--r--examples/widgets/doc/screenshot.qdoc26
-rw-r--r--examples/widgets/doc/scribble.qdoc94
-rw-r--r--examples/widgets/doc/sdi.qdoc2
-rw-r--r--examples/widgets/doc/shapedclock.qdoc16
-rw-r--r--examples/widgets/doc/simpledommodel.qdoc42
-rw-r--r--examples/widgets/doc/simpletreemodel.qdoc42
-rw-r--r--examples/widgets/doc/simplewidgetmapper.qdoc14
-rw-r--r--examples/widgets/doc/sipdialog.qdoc20
-rw-r--r--examples/widgets/doc/sliders.qdoc54
-rw-r--r--examples/widgets/doc/spinboxdelegate.qdoc22
-rw-r--r--examples/widgets/doc/spinboxes.qdoc42
-rw-r--r--examples/widgets/doc/spreadsheet.qdoc2
-rw-r--r--examples/widgets/doc/standarddialogs.qdoc2
-rw-r--r--examples/widgets/doc/stardelegate.qdoc50
-rw-r--r--examples/widgets/doc/states.qdoc2
-rw-r--r--examples/widgets/doc/stickman.qdoc14
-rw-r--r--examples/widgets/doc/styles.qdoc106
-rw-r--r--examples/widgets/doc/stylesheet.qdoc2
-rw-r--r--examples/widgets/doc/sub-attaq.qdoc2
-rw-r--r--examples/widgets/doc/syntaxhighlighter.qdoc34
-rw-r--r--examples/widgets/doc/tabdialog.qdoc26
-rw-r--r--examples/widgets/doc/tablet.qdoc60
-rw-r--r--examples/widgets/doc/tetrix.qdoc118
-rw-r--r--examples/widgets/doc/textedit.qdoc2
-rw-r--r--examples/widgets/doc/tooltips.qdoc80
-rw-r--r--examples/widgets/doc/trafficlight.qdoc12
-rw-r--r--examples/widgets/doc/transformations.qdoc58
-rw-r--r--examples/widgets/doc/trivialwizard.qdoc10
-rw-r--r--examples/widgets/doc/twowaybutton.qdoc14
-rw-r--r--examples/widgets/doc/wiggly.qdoc22
-rw-r--r--examples/widgets/doc/windowflags.qdoc28
101 files changed, 1498 insertions, 1498 deletions
diff --git a/examples/widgets/doc/addressbook.qdoc b/examples/widgets/doc/addressbook.qdoc
index 9b4ede5775..2c7ae054d4 100644
--- a/examples/widgets/doc/addressbook.qdoc
+++ b/examples/widgets/doc/addressbook.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/addressbook
+ \example widgets/itemviews/addressbook
\title Address Book Example
The address book example shows how to use proxy models to display
@@ -87,7 +87,7 @@
\c insertRows(), \c removeRows(), \c setData() and \c flags()
functions.
- \snippet itemviews/addressbook/tablemodel.h 0
+ \snippet widgets/itemviews/addressbook/tablemodel.h 0
Two constructors are used, a default constructor which uses
\c TableModel's own \c {QList<QPair<QString, QString>>} and one
@@ -101,7 +101,7 @@
The second constructor initializes the list of pairs in the
model, with the parameter value.
- \snippet itemviews/addressbook/tablemodel.cpp 0
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 0
The \c rowCount() and \c columnCount() functions return the
dimensions of the model. Whereas, \c rowCount()'s value will vary
@@ -112,7 +112,7 @@
\note The \c Q_UNUSED() macro prevents the compiler from
generating warnings regarding unused parameters.
- \snippet itemviews/addressbook/tablemodel.cpp 1
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 1
The \c data() function returns either a \b Name or
\b {Address}, based on the contents of the model index
@@ -121,7 +121,7 @@
by the QItemSelectionModel, which will be explained with
\c AddressWidget.
- \snippet itemviews/addressbook/tablemodel.cpp 2
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 2
The \c headerData() function displays the table's header,
\b Name and \b Address. If you require numbered entries
@@ -129,21 +129,21 @@
have hidden in this example (see the \c AddressWidget
implementation).
- \snippet itemviews/addressbook/tablemodel.cpp 3
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 3
The \c insertRows() function is called before new data is added,
otherwise the data will not be displayed. The
\c beginInsertRows() and \c endInsertRows() functions are called
to ensure all connected views are aware of the changes.
- \snippet itemviews/addressbook/tablemodel.cpp 4
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 4
The \c removeRows() function is called to remove data. Again,
\l{QAbstractItemModel::}{beginRemoveRows()} and
\l{QAbstractItemModel::}{endRemoveRows()} are called to ensure
all connected views are aware of the changes.
- \snippet itemviews/addressbook/tablemodel.cpp 5
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 5
The \c setData() function is the function that inserts data into
the table, item by item and not row by row. This means that to
@@ -152,12 +152,12 @@
\l{QAbstractItemModel::}{dataChanged()} signal as it tells all
connected views to update their displays.
- \snippet itemviews/addressbook/tablemodel.cpp 6
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 6
The \c flags() function returns the item flags for the given
index.
- \snippet itemviews/addressbook/tablemodel.cpp 7
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 7
We set the Qt::ItemIsEditable flag because we want to allow the
\c TableModel to be edited. Although for this example we don't
@@ -171,7 +171,7 @@
the contacts to a file and read them back. Further explanation is
given with \c AddressWidget.
- \snippet itemviews/addressbook/tablemodel.cpp 8
+ \snippet widgets/itemviews/addressbook/tablemodel.cpp 8
\section1 AddressWidget Class Definition
@@ -181,7 +181,7 @@
and remove contacts, to save the contacts to a file and to load
them from a file.
- \snippet itemviews/addressbook/addresswidget.h 0
+ \snippet widgets/itemviews/addressbook/addresswidget.h 0
\c AddressWidget extends QTabWidget in order to hold 10 tabs
(\c NewAddressTab and the 9 alphabet group tabs) and also
@@ -198,7 +198,7 @@
used to indicate that the address book is empty, is added
and the rest of the 9 tabs are set up with \c setupTabs().
- \snippet itemviews/addressbook/addresswidget.cpp 0
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 0
The \c setupTabs() function is used to set up the 9 alphabet
group tabs, table views and proxy models in
@@ -217,7 +217,7 @@
is automatically given a QItemSelectionModel that keeps track
of the selected indexes.
- \snippet itemviews/addressbook/addresswidget.cpp 1
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 1
The QItemSelectionModel class provides a
\l{QItemSelectionModel::selectionChanged()}{selectionChanged}
@@ -245,14 +245,14 @@
\c AddDialog object and then calls the second \c addEntry()
function to actually add the contact to \c table.
- \snippet itemviews/addressbook/addresswidget.cpp 2
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 2
Basic validation is done in the second \c addEntry() function to
prevent duplicate entries in the address book. As mentioned with
\c TableModel, this is part of the reason why we require the
getter method \c getList().
- \snippet itemviews/addressbook/addresswidget.cpp 3
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 3
If the model does not already contain an entry with the same name,
we call \c setData() to insert the name and address into the
@@ -271,14 +271,14 @@
\c selectionModel from the \c tableView to obtain the selected
indexes.
- \snippet itemviews/addressbook/addresswidget.cpp 4a
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 4a
Next we extract data from the row the user intends to
edit. This data is displayed in an instance of \c AddDialog
with a different window title. The \c table is only
updated if changes have been made to data in \c aDialog.
- \snippet itemviews/addressbook/addresswidget.cpp 4b
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 4b
\image addressbook-editdialog.png Screenshot of Dialog to Edit a Contact
@@ -288,7 +288,7 @@
\c newAddressTab is re-added to the \c AddressWidget only if
the user removes all the contacts in the address book.
- \snippet itemviews/addressbook/addresswidget.cpp 5
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 5
The \c writeToFile() function is used to save a file containing
all the contacts in the address book. The file is saved in a
@@ -296,7 +296,7 @@
are written to \c file using QDataStream. If the file cannot be
opened, a QMessageBox is displayed with the related error message.
- \snippet itemviews/addressbook/addresswidget.cpp 6
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 6
The \c readFromFile() function loads a file containing all the
contacts in the address book, previously saved using
@@ -304,7 +304,7 @@
\c{.dat} file into a list of pairs and each of these is added
using \c addEntry().
- \snippet itemviews/addressbook/addresswidget.cpp 7
+ \snippet widgets/itemviews/addressbook/addresswidget.cpp 7
\section1 NewAddressTab Class Definition
@@ -319,7 +319,7 @@
The \c NewAddressTab class extends QWidget and contains a QLabel
and QPushButton.
- \snippet itemviews/addressbook/newaddresstab.h 0
+ \snippet widgets/itemviews/addressbook/newaddresstab.h 0
\section1 NewAddressTab Class Implementation
@@ -328,7 +328,7 @@
\c descriptionLabel and connects the \c{addButton}'s signal to
the \c{addEntry()} slot.
- \snippet itemviews/addressbook/newaddresstab.cpp 0
+ \snippet widgets/itemviews/addressbook/newaddresstab.cpp 0
The \c addEntry() function is similar to \c AddressWidget's
\c addEntry() in the sense that both functions instantiate an
@@ -336,7 +336,7 @@
to \c AddressWidget's \c addEntry() slot by emitting the
\c sendDetails() signal.
- \snippet itemviews/addressbook/newaddresstab.cpp 1
+ \snippet widgets/itemviews/addressbook/newaddresstab.cpp 1
\image signals-n-slots-aw-nat.png
@@ -347,7 +347,7 @@
with a QLineEdit and a QTextEdit to input data into the
address book.
- \snippet itemviews/addressbook/adddialog.h 0
+ \snippet widgets/itemviews/addressbook/adddialog.h 0
\image addressbook-adddialog.png
@@ -357,7 +357,7 @@
The \c AddDialog's constructor sets up the user interface,
creating the necessary widgets and placing them into layouts.
- \snippet itemviews/addressbook/adddialog.cpp 0
+ \snippet widgets/itemviews/addressbook/adddialog.cpp 0
To give the dialog the desired behavior, we connect the \uicontrol OK
and \uicontrol Cancel buttons to the dialog's \l{QDialog::}{accept()} and
@@ -376,7 +376,7 @@
\li \inlineimage addressbook-toolsmenu.png
\endtable
- \snippet itemviews/addressbook/mainwindow.h 0
+ \snippet widgets/itemviews/addressbook/mainwindow.h 0
The \c MainWindow class uses an \c AddressWidget as its central
widget and provides the File menu with \uicontrol Open, \uicontrol Close and
@@ -391,7 +391,7 @@
sets it as its central widget and calls the \c createMenus()
function.
- \snippet itemviews/addressbook/mainwindow.cpp 0
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 0
The \c createMenus() function sets up the \uicontrol File and
\uicontrol Tools menus, connecting the actions to their respective slots.
@@ -400,10 +400,10 @@
address book. They are only enabled when one or more contacts
are added.
- \snippet itemviews/addressbook/mainwindow.cpp 1a
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 1a
\dots
\codeline
- \snippet itemviews/addressbook/mainwindow.cpp 1b
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 1b
Apart from connecting all the actions' signals to their
respective slots, we also connect \c AddressWidget's
@@ -415,13 +415,13 @@
contacts. This function is a slot connected to \c openAct in the
\uicontrol File menu.
- \snippet itemviews/addressbook/mainwindow.cpp 2
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 2
The \c saveFile() function allows the user to save a file with
the \l{QFileDialog::getSaveFileName()}{save file dialog}. This function
is a slot connected to \c saveAct in the \uicontrol File menu.
- \snippet itemviews/addressbook/mainwindow.cpp 3
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 3
The \c updateActions() function enables and disables
\uicontrol{Edit Entry...} and \uicontrol{Remove Entry} depending on the contents of
@@ -430,7 +430,7 @@
is connected to the \c AddressWidget's \c selectionChanged()
signal.
- \snippet itemviews/addressbook/mainwindow.cpp 4
+ \snippet widgets/itemviews/addressbook/mainwindow.cpp 4
\section1 main() Function
@@ -438,5 +438,5 @@
The main function for the address book instantiates QApplication
and opens a \c MainWindow before running the event loop.
- \snippet itemviews/addressbook/main.cpp 0
+ \snippet widgets/itemviews/addressbook/main.cpp 0
*/
diff --git a/examples/widgets/doc/affine.qdoc b/examples/widgets/doc/affine.qdoc
index c69794d511..e6ef8c12f5 100644
--- a/examples/widgets/doc/affine.qdoc
+++ b/examples/widgets/doc/affine.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/affine
+ \example widgets/painting/affine
\title Affine Transformations
In this example we show Qt's ability to perform affine transformations
diff --git a/examples/widgets/doc/analogclock.qdoc b/examples/widgets/doc/analogclock.qdoc
index bb4bdb54ae..c32f01d13e 100644
--- a/examples/widgets/doc/analogclock.qdoc
+++ b/examples/widgets/doc/analogclock.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/analogclock
+ \example widgets/widgets/analogclock
\title Analog Clock Example
The Analog Clock example shows how to draw the contents of a custom
@@ -45,11 +45,11 @@
We subclass \l QWidget and reimplement the standard
\l{QWidget::paintEvent()}{paintEvent()} function to draw the clock face:
- \snippet widgets/analogclock/analogclock.h 0
+ \snippet widgets/widgets/analogclock/analogclock.h 0
\section1 AnalogClock Class Implementation
- \snippet widgets/analogclock/analogclock.cpp 1
+ \snippet widgets/widgets/analogclock/analogclock.cpp 1
When the widget is constructed, we set up a one-second timer to
keep track of the current time, and we connect it to the standard
@@ -60,8 +60,8 @@
Finally, we resize the widget so that it is displayed at a
reasonable size.
- \snippet widgets/analogclock/analogclock.cpp 8
- \snippet widgets/analogclock/analogclock.cpp 10
+ \snippet widgets/widgets/analogclock/analogclock.cpp 8
+ \snippet widgets/widgets/analogclock/analogclock.cpp 10
The \c paintEvent() function is called whenever the widget's
contents need to be updated. This happens when the widget is
@@ -80,10 +80,10 @@
can fit the clock face inside the widget. It is also useful to determine
the current time before we start drawing.
- \snippet widgets/analogclock/analogclock.cpp 11
- \snippet widgets/analogclock/analogclock.cpp 12
- \snippet widgets/analogclock/analogclock.cpp 13
- \snippet widgets/analogclock/analogclock.cpp 14
+ \snippet widgets/widgets/analogclock/analogclock.cpp 11
+ \snippet widgets/widgets/analogclock/analogclock.cpp 12
+ \snippet widgets/widgets/analogclock/analogclock.cpp 13
+ \snippet widgets/widgets/analogclock/analogclock.cpp 14
The contents of custom widgets are drawn with a QPainter.
Painters can be used to draw on any QPaintDevice, but they are
@@ -116,37 +116,37 @@
hour and minute. This means that the hand will be shown rotated clockwise
by the required amount.
- \snippet widgets/analogclock/analogclock.cpp 15
- \snippet widgets/analogclock/analogclock.cpp 16
+ \snippet widgets/widgets/analogclock/analogclock.cpp 15
+ \snippet widgets/widgets/analogclock/analogclock.cpp 16
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 widgets/analogclock/analogclock.cpp 17
- \snippet widgets/analogclock/analogclock.cpp 19
+ \snippet widgets/widgets/analogclock/analogclock.cpp 17
+ \snippet widgets/widgets/analogclock/analogclock.cpp 19
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 widgets/analogclock/analogclock.cpp 20
+ \snippet widgets/widgets/analogclock/analogclock.cpp 20
\codeline
- \snippet widgets/analogclock/analogclock.cpp 21
+ \snippet widgets/widgets/analogclock/analogclock.cpp 21
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 widgets/analogclock/analogclock.cpp 22
- \snippet widgets/analogclock/analogclock.cpp 23
+ \snippet widgets/widgets/analogclock/analogclock.cpp 22
+ \snippet widgets/widgets/analogclock/analogclock.cpp 23
The minute hand is rotated in a similar way to the hour hand.
- \snippet widgets/analogclock/analogclock.cpp 25
+ \snippet widgets/widgets/analogclock/analogclock.cpp 25
\codeline
- \snippet widgets/analogclock/analogclock.cpp 26
+ \snippet widgets/widgets/analogclock/analogclock.cpp 26
Again, we draw markers around the edge of the clock, but this
time to indicate minutes. We skip multiples of 5 to avoid drawing
diff --git a/examples/widgets/doc/animatedtiles.qdoc b/examples/widgets/doc/animatedtiles.qdoc
index 4fe25388cf..da800ae7e5 100644
--- a/examples/widgets/doc/animatedtiles.qdoc
+++ b/examples/widgets/doc/animatedtiles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/animatedtiles
+ \example widgets/animation/animatedtiles
\title Animated Tiles Example
The Animated Tiles example animates items in a graphics scene.
diff --git a/examples/widgets/doc/appchooser.qdoc b/examples/widgets/doc/appchooser.qdoc
index 092db7c29e..ba9ca9a111 100644
--- a/examples/widgets/doc/appchooser.qdoc
+++ b/examples/widgets/doc/appchooser.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/appchooser
+ \example widgets/animation/appchooser
\title Application Chooser Example
The Application Chooser example shows how to use the Qt state
diff --git a/examples/widgets/doc/application.qdoc b/examples/widgets/doc/application.qdoc
index 5465f99e99..9ad89e0a9a 100644
--- a/examples/widgets/doc/application.qdoc
+++ b/examples/widgets/doc/application.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/application
+ \example widgets/mainwindows/application
\title Application Example
The Application example shows how to implement a standard GUI
@@ -59,7 +59,7 @@
Here's the class definition:
- \snippet mainwindows/application/mainwindow.h 0
+ \snippet widgets/mainwindows/application/mainwindow.h 0
The public API is restricted to the constructor. In the \c
protected section, we reimplement QWidget::closeEvent() to detect
@@ -72,7 +72,7 @@
\section1 MainWindow Class Implementation
- \snippet mainwindows/application/mainwindow.cpp 0
+ \snippet widgets/mainwindows/application/mainwindow.cpp 0
We start by including \c <QtGui>, a header file that contains the
definition of all classes in the \l QtCore and \l QtGui
@@ -86,8 +86,8 @@
generally a good idea to include only the header files that are
strictly necessary from another header file.
- \snippet mainwindows/application/mainwindow.cpp 1
- \snippet mainwindows/application/mainwindow.cpp 2
+ \snippet widgets/mainwindows/application/mainwindow.cpp 1
+ \snippet widgets/mainwindows/application/mainwindow.cpp 2
In the constructor, we start by creating a QPlainTextEdit widget as a
child of the main window (the \c this object). Then we call
@@ -109,8 +109,8 @@
\c setCurrentFile() function. We'll come back to this later.
\target close event handler
- \snippet mainwindows/application/mainwindow.cpp 3
- \snippet mainwindows/application/mainwindow.cpp 4
+ \snippet widgets/mainwindows/application/mainwindow.cpp 3
+ \snippet widgets/mainwindows/application/mainwindow.cpp 4
When the user attempts to close the window, we call the private
function \c maybeSave() to give the user the possibility to save
@@ -121,8 +121,8 @@
that the application will stay up and running as if nothing
happened.
- \snippet mainwindows/application/mainwindow.cpp 5
- \snippet mainwindows/application/mainwindow.cpp 6
+ \snippet widgets/mainwindows/application/mainwindow.cpp 5
+ \snippet widgets/mainwindows/application/mainwindow.cpp 6
The \c newFile() slot is invoked when the user selects
\uicontrol{File|New} from the menu. We call \c maybeSave() to save any
@@ -131,8 +131,8 @@
update the window title and clear the
\l{QWidget::windowModified}{windowModified} flag.
- \snippet mainwindows/application/mainwindow.cpp 7
- \snippet mainwindows/application/mainwindow.cpp 8
+ \snippet widgets/mainwindows/application/mainwindow.cpp 7
+ \snippet widgets/mainwindows/application/mainwindow.cpp 8
The \c open() slot is invoked when the user clicks
\uicontrol{File|Open}. We pop up a QFileDialog asking the user to
@@ -140,23 +140,23 @@
not an empty string), we call the private function \c loadFile()
to actually load the file.
- \snippet mainwindows/application/mainwindow.cpp 9
- \snippet mainwindows/application/mainwindow.cpp 10
+ \snippet widgets/mainwindows/application/mainwindow.cpp 9
+ \snippet widgets/mainwindows/application/mainwindow.cpp 10
The \c save() slot is invoked when the user clicks
\uicontrol{File|Save}. If the user hasn't provided a name for the file
yet, we call \c saveAs(); otherwise, we call the private function
\c saveFile() to actually save the file.
- \snippet mainwindows/application/mainwindow.cpp 11
- \snippet mainwindows/application/mainwindow.cpp 12
+ \snippet widgets/mainwindows/application/mainwindow.cpp 11
+ \snippet widgets/mainwindows/application/mainwindow.cpp 12
In \c saveAs(), we start by popping up a QFileDialog asking the
user to provide a name. If the user clicks \uicontrol{Cancel}, the
returned file name is empty, and we do nothing.
- \snippet mainwindows/application/mainwindow.cpp 13
- \snippet mainwindows/application/mainwindow.cpp 14
+ \snippet widgets/mainwindows/application/mainwindow.cpp 13
+ \snippet widgets/mainwindows/application/mainwindow.cpp 14
The application's About box is done using one statement, using
the QMessageBox::about() static function and relying on its
@@ -169,18 +169,18 @@
The \l{Internationalization with Qt} overview covers
\l{QObject::tr()}{tr()} in more detail.
- \snippet mainwindows/application/mainwindow.cpp 15
- \snippet mainwindows/application/mainwindow.cpp 16
+ \snippet widgets/mainwindows/application/mainwindow.cpp 15
+ \snippet widgets/mainwindows/application/mainwindow.cpp 16
The \c documentWasModified() slot is invoked each time the text
in the QPlainTextEdit changes because of user edits. We call
QWidget::setWindowModified() to make the title bar show that the
file was modified. How this is done varies on each platform.
- \snippet mainwindows/application/mainwindow.cpp 17
- \snippet mainwindows/application/mainwindow.cpp 18
+ \snippet widgets/mainwindows/application/mainwindow.cpp 17
+ \snippet widgets/mainwindows/application/mainwindow.cpp 18
\dots
- \snippet mainwindows/application/mainwindow.cpp 22
+ \snippet widgets/mainwindows/application/mainwindow.cpp 22
The \c createActions() private function, which is called from the
\c MainWindow constructor, creates \l{QAction}s. The code is very
@@ -209,8 +209,8 @@
to this when we review the \c application.qrc file that's part of
the project.
- \snippet mainwindows/application/mainwindow.cpp 23
- \snippet mainwindows/application/mainwindow.cpp 24
+ \snippet widgets/mainwindows/application/mainwindow.cpp 23
+ \snippet widgets/mainwindows/application/mainwindow.cpp 24
The \uicontrol{Edit|Cut} and \uicontrol{Edit|Copy} actions must be available
only when the QPlainTextEdit contains selected text. We disable them
@@ -218,8 +218,8 @@
the QAction::setEnabled() slot, ensuring that the actions are
disabled when the text editor has no selection.
- \snippet mainwindows/application/mainwindow.cpp 25
- \snippet mainwindows/application/mainwindow.cpp 27
+ \snippet widgets/mainwindows/application/mainwindow.cpp 25
+ \snippet widgets/mainwindows/application/mainwindow.cpp 27
Creating actions isn't sufficient to make them available to the
user; we must also add them to the menu system. This is what \c
@@ -244,21 +244,21 @@
Let's now review the toolbars:
- \snippet mainwindows/application/mainwindow.cpp 30
+ \snippet widgets/mainwindows/application/mainwindow.cpp 30
Creating toolbars is very similar to creating menus. The same
actions that we put in the menus can be reused in the toolbars.
- \snippet mainwindows/application/mainwindow.cpp 32
- \snippet mainwindows/application/mainwindow.cpp 33
+ \snippet widgets/mainwindows/application/mainwindow.cpp 32
+ \snippet widgets/mainwindows/application/mainwindow.cpp 33
QMainWindow::statusBar() returns a pointer to the main window's
QStatusBar widget. Like with \l{QMainWindow::menuBar()}, the
widget is automatically created the first time the function is
called.
- \snippet mainwindows/application/mainwindow.cpp 34
- \snippet mainwindows/application/mainwindow.cpp 36
+ \snippet widgets/mainwindows/application/mainwindow.cpp 34
+ \snippet widgets/mainwindows/application/mainwindow.cpp 36
The \c readSettings() function is called from the constructor to
load the user's preferences and other application settings. The
@@ -281,16 +281,16 @@
to call QWidget::resize() before QWidget::move(). The reason why
is given in the \l{Window Geometry} overview.
- \snippet mainwindows/application/mainwindow.cpp 37
- \snippet mainwindows/application/mainwindow.cpp 39
+ \snippet widgets/mainwindows/application/mainwindow.cpp 37
+ \snippet widgets/mainwindows/application/mainwindow.cpp 39
The \c writeSettings() function is called from \c closeEvent().
Writing settings is similar to reading them, except simpler. The
arguments to the QSettings constructor must be the same as in \c
readSettings().
- \snippet mainwindows/application/mainwindow.cpp 40
- \snippet mainwindows/application/mainwindow.cpp 41
+ \snippet widgets/mainwindows/application/mainwindow.cpp 40
+ \snippet widgets/mainwindows/application/mainwindow.cpp 41
The \c maybeSave() function is called to save pending changes. If
there are pending changes, it pops up a QMessageBox giving the
@@ -307,8 +307,8 @@
return value and stop whatever it was doing if the return value
is \c false.
- \snippet mainwindows/application/mainwindow.cpp 42
- \snippet mainwindows/application/mainwindow.cpp 43
+ \snippet widgets/mainwindows/application/mainwindow.cpp 42
+ \snippet widgets/mainwindows/application/mainwindow.cpp 43
In \c loadFile(), we use QFile and QTextStream to read in the
data. The QFile object provides access to the bytes stored in a
@@ -335,15 +335,15 @@
which we'll cover in a moment, and we display the string "File
loaded" in the status bar for 2 seconds (2000 milliseconds).
- \snippet mainwindows/application/mainwindow.cpp 44
- \snippet mainwindows/application/mainwindow.cpp 45
+ \snippet widgets/mainwindows/application/mainwindow.cpp 44
+ \snippet widgets/mainwindows/application/mainwindow.cpp 45
Saving a file is very similar to loading one. Here, the
QFile::Text flag ensures that on Windows, "\\n" is converted into
"\\r\\n" to conform to the Windows convension.
- \snippet mainwindows/application/mainwindow.cpp 46
- \snippet mainwindows/application/mainwindow.cpp 47
+ \snippet widgets/mainwindows/application/mainwindow.cpp 46
+ \snippet widgets/mainwindows/application/mainwindow.cpp 47
The \c setCurrentFile() function is called to reset the state of
a few variables when a file is loaded or saved, or when the user
@@ -357,15 +357,15 @@
QWidget::setWindowTitle() call shortens the file name to exclude
the path. Here's the function:
- \snippet mainwindows/application/mainwindow.cpp 48
- \snippet mainwindows/application/mainwindow.cpp 49
+ \snippet widgets/mainwindows/application/mainwindow.cpp 48
+ \snippet widgets/mainwindows/application/mainwindow.cpp 49
\section1 The main() Function
The \c main() function for this application is typical of
applications that contain one main window:
- \snippet mainwindows/application/main.cpp 0
+ \snippet widgets/mainwindows/application/main.cpp 0
\section1 The Resource File
@@ -379,7 +379,7 @@
disk. Here's the \c application.qrc file that's used by the
Application example:
- \quotefile mainwindows/application/application.qrc
+ \quotefile widgets/mainwindows/application/application.qrc
The \c .png files listed in the \c application.qrc file are files
that are part of the Application example's source tree. Paths are
@@ -389,7 +389,7 @@
The resource file must be mentioned in the \c application.pro
file so that \c qmake knows about it:
- \snippet mainwindows/application/application.pro 0
+ \snippet widgets/mainwindows/application/application.pro 0
\c qmake will produce make rules to generate a file called \c
qrc_application.cpp that is linked into the application. This
diff --git a/examples/widgets/doc/basicdrawing.qdoc b/examples/widgets/doc/basicdrawing.qdoc
index 899aa361f8..9e7e7ae65e 100644
--- a/examples/widgets/doc/basicdrawing.qdoc
+++ b/examples/widgets/doc/basicdrawing.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/basicdrawing
+ \example widgets/painting/basicdrawing
\title Basic Drawing Example
The Basic Drawing example shows how to display basic graphics
@@ -68,7 +68,7 @@
window displaying a \c RenderArea widget in addition to several
parameter widgets.
- \snippet painting/basicdrawing/window.h 0
+ \snippet widgets/painting/basicdrawing/window.h 0
We declare the various widgets, and three private slots updating
the \c RenderArea widget: The \c shapeChanged() slot updates the
@@ -83,14 +83,14 @@
In the constructor we create and initialize the various widgets
appearing in the main application window.
- \snippet painting/basicdrawing/window.cpp 1
+ \snippet widgets/painting/basicdrawing/window.cpp 1
First we create the \c RenderArea widget that will render the
currently active shape. Then we create the \uicontrol Shape combobox,
and add the associated items (i.e. the different shapes a QPainter
can draw).
- \snippet painting/basicdrawing/window.cpp 2
+ \snippet widgets/painting/basicdrawing/window.cpp 2
QPainter's pen is a QPen object; the QPen class defines how a
painter should draw lines and outlines of shapes. A pen has
@@ -103,7 +103,7 @@
We create a QSpinBox for the \uicontrol {Pen Width} parameter.
- \snippet painting/basicdrawing/window.cpp 3
+ \snippet widgets/painting/basicdrawing/window.cpp 3
The pen style defines the line type. The default style is solid
(Qt::SolidLine). Setting the style to none (Qt::NoPen) tells the
@@ -117,7 +117,7 @@
items (i.e the values of the Qt::PenStyle, Qt::PenCapStyle and
Qt::PenJoinStyle enums respectively).
- \snippet painting/basicdrawing/window.cpp 4
+ \snippet widgets/painting/basicdrawing/window.cpp 4
The QBrush class defines the fill pattern of shapes drawn by a
QPainter. The default brush style is Qt::NoBrush. This style tells
@@ -127,8 +127,8 @@
We create a QComboBox for the \uicontrol {Brush Style} parameter, and add
the associated items (i.e. the values of the Qt::BrushStyle enum).
- \snippet painting/basicdrawing/window.cpp 5
- \snippet painting/basicdrawing/window.cpp 6
+ \snippet widgets/painting/basicdrawing/window.cpp 5
+ \snippet widgets/painting/basicdrawing/window.cpp 6
Antialiasing is a feature that "smoothes" the pixels to create
more even and less jagged lines, and can be applied using
@@ -138,7 +138,7 @@
We simply create a QCheckBox for the \uicontrol Antialiasing option.
- \snippet painting/basicdrawing/window.cpp 7
+ \snippet widgets/painting/basicdrawing/window.cpp 7
The \uicontrol Transformations option implies a manipulation of the
coordinate system that will appear as if the rendered shape is
@@ -148,21 +148,21 @@
QPainter::scale() functions to implement this feature represented
in the main application window by a simple QCheckBox.
- \snippet painting/basicdrawing/window.cpp 8
+ \snippet widgets/painting/basicdrawing/window.cpp 8
Then we connect the parameter widgets with their associated slots
using the static QObject::connect() function, ensuring that the \c
RenderArea widget is updated whenever the user changes the shape,
or any of the other parameters.
- \snippet painting/basicdrawing/window.cpp 9
- \snippet painting/basicdrawing/window.cpp 10
+ \snippet widgets/painting/basicdrawing/window.cpp 9
+ \snippet widgets/painting/basicdrawing/window.cpp 10
Finally, we add the various widgets to a layout, and call the \c
shapeChanged(), \c penChanged(), and \c brushChanged() slots to
initialize the application. We also turn on antialiasing.
- \snippet painting/basicdrawing/window.cpp 11
+ \snippet widgets/painting/basicdrawing/window.cpp 11
The \c shapeChanged() slot is called whenever the user changes the
currently active shape.
@@ -185,7 +185,7 @@
add the following line of code to the beginning of the \c
window.cpp file.
- \snippet painting/basicdrawing/window.cpp 0
+ \snippet widgets/painting/basicdrawing/window.cpp 0
The QComboBox::itemData() function returns the data as a QVariant,
so we need to cast the data to \c RenderArea::Shape. If there is
@@ -195,20 +195,20 @@
In the end we call the \c RenderArea::setShape() slot to update
the \c RenderArea widget.
- \snippet painting/basicdrawing/window.cpp 12
+ \snippet widgets/painting/basicdrawing/window.cpp 12
We call the \c penChanged() slot whenever the user changes any of
the pen parameters. Again we use the QComboBox::itemData()
function to retrieve the parameters, and then we call the \c
RenderArea::setPen() slot to update the \c RenderArea widget.
- \snippet painting/basicdrawing/window.cpp 13
+ \snippet widgets/painting/basicdrawing/window.cpp 13
The brushChanged() slot is called whenever the user changes the
brush parameter which we retrieve using the QComboBox::itemData()
function as before.
- \snippet painting/basicdrawing/window.cpp 14
+ \snippet widgets/painting/basicdrawing/window.cpp 14
If the brush parameter is a gradient fill, special actions are
required.
@@ -232,7 +232,7 @@
In the end we call \c RenderArea::setBrush() slot to update the \c
RenderArea widget's brush with the QLinearGradient object.
- \snippet painting/basicdrawing/window.cpp 15
+ \snippet widgets/painting/basicdrawing/window.cpp 15
A similar pattern of actions, as the one used for QLinearGradient,
is used in the cases of Qt::RadialGradientPattern and
@@ -247,13 +247,13 @@
first argument specifies the center of the conical, and the second
specifies the start angle of the interpolation.
- \snippet painting/basicdrawing/window.cpp 16
+ \snippet widgets/painting/basicdrawing/window.cpp 16
If the brush style is Qt::TexturePattern we create a QBrush from a
QPixmap. Then we call \c RenderArea::setBrush() slot to update the
\c RenderArea widget with the newly created brush.
- \snippet painting/basicdrawing/window.cpp 17
+ \snippet widgets/painting/basicdrawing/window.cpp 17
Otherwise we simply create a brush with the given style and a
green color, and then call \c RenderArea::setBrush() slot to
@@ -264,7 +264,7 @@
The \c RenderArea class inherits QWidget, and renders multiple
copies of the currently active shape using a QPainter.
- \snippet painting/basicdrawing/renderarea.h 0
+ \snippet widgets/painting/basicdrawing/renderarea.h 0
First we define a public \c Shape enum to hold the different
shapes that can be rendered by the widget (i.e the shapes that can
@@ -287,7 +287,7 @@
In the constructor we initialize some of the widget's variables.
- \snippet painting/basicdrawing/renderarea.cpp 0
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 0
We set its shape to be a \uicontrol Polygon, its antialiased property to
be false and we load an image into the widget's pixmap
@@ -296,7 +296,7 @@
will be used to render the background. QPalette::Base is typically
white.
- \snippet painting/basicdrawing/renderarea.cpp 2
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 2
The \c RenderArea inherits QWidget's \l
{QWidget::sizeHint()}{sizeHint} property holding the recommended
@@ -310,7 +310,7 @@
Our reimplementation of the function returns a QSize with a 400
pixels width and a 200 pixels height.
- \snippet painting/basicdrawing/renderarea.cpp 1
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 1
\c RenderArea also inherits QWidget's
\l{QWidget::minimumSizeHint()}{minimumSizeHint} property holding
@@ -324,11 +324,11 @@
Our reimplementation of the function returns a QSize with a 100
pixels width and a 100 pixels height.
- \snippet painting/basicdrawing/renderarea.cpp 3
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 3
\codeline
- \snippet painting/basicdrawing/renderarea.cpp 4
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 4
\codeline
- \snippet painting/basicdrawing/renderarea.cpp 5
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 5
The public \c setShape(), \c setPen() and \c setBrush() slots are
called whenever we want to modify a \c RenderArea widget's shape,
@@ -340,16 +340,16 @@
repaint; instead it schedules a paint event for processing when Qt
returns to the main event loop.
- \snippet painting/basicdrawing/renderarea.cpp 6
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 6
\codeline
- \snippet painting/basicdrawing/renderarea.cpp 7
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 7
With the \c setAntialiased() and \c setTransformed() slots we
change the state of the properties according to the slot
parameter, and call the QWidget::update() slot to make the changes
visible in the \c RenderArea widget.
- \snippet painting/basicdrawing/renderarea.cpp 8
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 8
Then we reimplement the QWidget::paintEvent() function. The first
thing we do is to create the graphical objects we will need to
@@ -373,7 +373,7 @@
In addition we define a start angle and an arc length that we will
use when drawing the \uicontrol Arc, \uicontrol Chord and \uicontrol Pie shapes.
- \snippet painting/basicdrawing/renderarea.cpp 9
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 9
We create a QPainter for the \c RenderArea widget, and set the
painters pen and brush according to the \c RenderArea's pen and
@@ -382,7 +382,7 @@
indicates that the engine should antialias edges of primitives if
possible.
- \snippet painting/basicdrawing/renderarea.cpp 10
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 10
Finally, we render the multiple copies of the \c RenderArea's
shape. The number of copies is depending on the size of the \c
@@ -397,7 +397,7 @@
will be rendered on top of each other in the top left cormer of
the \c RenderArea widget.
- \snippet painting/basicdrawing/renderarea.cpp 11
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 11
If the \uicontrol Transformations parameter option is checked, we do an
additional translation of the coordinate system before we rotate
@@ -409,7 +409,7 @@
Now, when rendering the shape, it will appear as if it was rotated
in three dimensions.
- \snippet painting/basicdrawing/renderarea.cpp 12
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 12
Next, we identify the \c RenderArea's shape, and render it using
the associated QPainter drawing function:
@@ -437,7 +437,7 @@
lose the knowledge of this point unless we save the current
painter state \e before we start the translating process.
- \snippet painting/basicdrawing/renderarea.cpp 13
+ \snippet widgets/painting/basicdrawing/renderarea.cpp 13
Then, when we are finished rendering a copy of the shape we can
restore the original painter state, with its associated coordinate
diff --git a/examples/widgets/doc/basicgraphicslayouts.qdoc b/examples/widgets/doc/basicgraphicslayouts.qdoc
index 9f52b3eafa..d59484b276 100644
--- a/examples/widgets/doc/basicgraphicslayouts.qdoc
+++ b/examples/widgets/doc/basicgraphicslayouts.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/basicgraphicslayouts
+ \example widgets/graphicsview/basicgraphicslayouts
\title Basic Graphics Layouts Example
The Basic Graphics Layouts example shows how to use the layout classes
@@ -40,7 +40,7 @@
The \c Window class is a subclass of QGraphicsWidget. It has a
constructor with a QGraphicsWidget \a parent as its parameter.
- \snippet graphicsview/basicgraphicslayouts/window.h 0
+ \snippet widgets/graphicsview/basicgraphicslayouts/window.h 0
\section1 Window Class Implementation
@@ -52,7 +52,7 @@
\c item with a \l{QGraphicsLinearLayout::setStretchFactor()}
{stretchFactor}.
- \snippet graphicsview/basicgraphicslayouts/window.cpp 0
+ \snippet widgets/graphicsview/basicgraphicslayouts/window.cpp 0
We repeat the process:
@@ -62,7 +62,7 @@
\li provide a stretch factor.
\endlist
- \snippet graphicsview/basicgraphicslayouts/window.cpp 1
+ \snippet widgets/graphicsview/basicgraphicslayouts/window.cpp 1
We then add \c linear to \c windowLayout, nesting two
QGraphicsLinearLayout objects. Apart from the QGraphicsLinearLayout, we
@@ -73,7 +73,7 @@
the \l{QGraphicsGridLayout::}{addItem()} function as shown in the code
snippet below:
- \snippet graphicsview/basicgraphicslayouts/window.cpp 2
+ \snippet widgets/graphicsview/basicgraphicslayouts/window.cpp 2
The first item we add to \c grid is placed in the top left cell,
spanning four rows. The next two items are placed in the second column,
@@ -94,7 +94,7 @@
add an item to a layout, it will be automatically reparented to the widget
on which the layout is installed.
- \snippet graphicsview/basicgraphicslayouts/window.cpp 3
+ \snippet widgets/graphicsview/basicgraphicslayouts/window.cpp 3
Now that we have set up \c grid and added it to \c windowLayout, we
install \c windowLayout onto the window object using
@@ -112,7 +112,7 @@
{QGraphicsItem::boundingRect()}{boundingRect()} and
{QGraphicsItem::paint()}{paint()}.
- \snippet graphicsview/basicgraphicslayouts/layoutitem.h 0
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.h 0
The \c LayoutItem class also has a private instance of QPixmap, \c m_pix.
@@ -121,17 +121,17 @@
In \c{LayoutItem}'s constructor, \c m_pix is instantiated and the
\c{block.png} image is loaded into it.
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 0
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 0
We use the Q_UNUSED() macro to prevent the compiler from generating
warnings regarding unused parameters.
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 1
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 1
The idea behind the \c paint() function is to paint the
background rect then paint a rect around the pixmap.
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 2
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 2
The reimplementation of \l{QGraphicsItem::}{boundingRect()}
will set the top left corner at (0,0), and the size of it will be
@@ -139,7 +139,7 @@
\l{QGraphicsLayoutItem::}{geometry()}. This is the area that
we paint within.
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 3
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 3
The reimplementation of \l{QGraphicsLayoutItem::setGeometry()}{setGeometry()}
@@ -148,7 +148,7 @@
\l{QGraphicsItem::prepareGeometryChange()}{prepareGeometryChange()}.
Finally, we move the item according to \c geom.topLeft().
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 4
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 4
Since we don't want the size of the item to be smaller than the pixmap, we
@@ -159,6 +159,6 @@
The preferred size is the same as the minimum size hint, while we set
maximum to be a large value
- \snippet graphicsview/basicgraphicslayouts/layoutitem.cpp 5
+ \snippet widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp 5
*/
diff --git a/examples/widgets/doc/basiclayouts.qdoc b/examples/widgets/doc/basiclayouts.qdoc
index a0f083ba58..4de4dc529d 100644
--- a/examples/widgets/doc/basiclayouts.qdoc
+++ b/examples/widgets/doc/basiclayouts.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example layouts/basiclayouts
+ \example widgets/layouts/basiclayouts
\title Basic Layouts Example
The Basic Layouts example shows how to use the standard layout
@@ -44,7 +44,7 @@
\section1 Dialog Class Definition
- \snippet layouts/basiclayouts/dialog.h 0
+ \snippet widgets/layouts/basiclayouts/dialog.h 0
The \c Dialog class inherits QDialog. It is a custom widget that
displays its child widgets using the geometry managers:
@@ -58,7 +58,7 @@
\section1 Dialog Class Implementation
- \snippet layouts/basiclayouts/dialog.cpp 0
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 0
In the constructor, we first use the \c createMenu() function to
create and populate a menu bar and the \c createHorizontalGroupBox()
@@ -70,7 +70,7 @@
three labels and three input fields: a line edit, a combo box and
a spin box.
- \snippet layouts/basiclayouts/dialog.cpp 1
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 1
We also create a big text editor and a dialog button box. The
QDialogButtonBox class is a widget that presents buttons in a
@@ -84,7 +84,7 @@
it is automatically reparented to the widget the layout is
installed on.
- \snippet layouts/basiclayouts/dialog.cpp 2
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 2
The main layout is a QVBoxLayout object. QVBoxLayout is a
convenience class for a box layout with vertical orientation.
@@ -97,14 +97,14 @@
placed in a column. The corresponding convenience classes are
QHBoxLayout and QVBoxLayout, respectively.
- \snippet layouts/basiclayouts/dialog.cpp 3
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 3
When we call the QLayout::setMenuBar() function, the layout places
the provided menu bar at the top of the parent widget, and outside
the widget's \l {QWidget::contentsRect()}{content margins}. All
child widgets are placed below the bottom edge of the menu bar.
- \snippet layouts/basiclayouts/dialog.cpp 4
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 4
We use the QBoxLayout::addWidget() function to add the widgets to
the end of layout. Each widget will get at least its minimum size
@@ -113,25 +113,25 @@
and any excess space is shared according to these stretch
factors. If not specified, a widget's stretch factor is 0.
- \snippet layouts/basiclayouts/dialog.cpp 5
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 5
We install the main layout on the \c Dialog widget using the
QWidget::setLayout() function, and all of the layout's widgets are
automatically reparented to be children of the \c Dialog widget.
- \snippet layouts/basiclayouts/dialog.cpp 6
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 6
In the private \c createMenu() function we create a menu bar, and
add a pull-down \uicontrol File menu containing an \uicontrol Exit option.
- \snippet layouts/basiclayouts/dialog.cpp 7
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 7
When we create the horizontal group box, we use a QHBoxLayout as
the internal layout. We create the buttons we want to put in the
group box, add them to the layout and install the layout on the
group box.
- \snippet layouts/basiclayouts/dialog.cpp 8
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 8
In the \c createGridGroupBox() function we use a QGridLayout which
lays out widgets in a grid. It takes the space made available to
@@ -139,7 +139,7 @@
into rows and columns, and puts each widget it manages into the
correct cell.
- \snippet layouts/basiclayouts/dialog.cpp 9
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 9
For each row in the grid we create a label and an associated line
edit, and add them to the layout. The QGridLayout::addWidget()
@@ -147,7 +147,7 @@
needs the row and column specifying the grid cell to put the
widget in.
- \snippet layouts/basiclayouts/dialog.cpp 10
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 10
QGridLayout::addWidget() can in addition take arguments
specifying the number of rows and columns the cell will be
@@ -160,7 +160,7 @@
could, for example, align a widget with the right edge by
specifying the alignment to be Qt::AlignRight.
- \snippet layouts/basiclayouts/dialog.cpp 11
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 11
Each column in a grid layout has a stretch factor. The stretch
factor is set using QGridLayout::setColumnStretch() and determines
@@ -178,7 +178,7 @@
stretch factor for rows, as well as a QGridLayout::setRowStretch()
function.
- \snippet layouts/basiclayouts/dialog.cpp 12
+ \snippet widgets/layouts/basiclayouts/dialog.cpp 12
In the \c createFormGroupBox() function, we use a QFormLayout
to neatly arrange objects into two columns - name and field.
diff --git a/examples/widgets/doc/basicsortfiltermodel.qdoc b/examples/widgets/doc/basicsortfiltermodel.qdoc
index 0ecf4a0629..dbf793894a 100644
--- a/examples/widgets/doc/basicsortfiltermodel.qdoc
+++ b/examples/widgets/doc/basicsortfiltermodel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/basicsortfiltermodel
+ \example widgets/itemviews/basicsortfiltermodel
\title Basic Sort/Filter Model Example
The Basic Sort/Filter Model example illustrates how to use
diff --git a/examples/widgets/doc/blurpicker.qdoc b/examples/widgets/doc/blurpicker.qdoc
index bd57acb061..a86433b33c 100644
--- a/examples/widgets/doc/blurpicker.qdoc
+++ b/examples/widgets/doc/blurpicker.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example effects/blurpicker
+ \example widgets/effects/blurpicker
\title Blur Picker Effect Example
\image blurpickereffect-example.png
diff --git a/examples/widgets/doc/borderlayout.qdoc b/examples/widgets/doc/borderlayout.qdoc
index aaff2dda1d..b79f252c21 100644
--- a/examples/widgets/doc/borderlayout.qdoc
+++ b/examples/widgets/doc/borderlayout.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example layouts/borderlayout
+ \example widgets/layouts/borderlayout
\title Border Layout Example
The Border Layout example shows how to create a custom layout that arranges
diff --git a/examples/widgets/doc/boxes.qdoc b/examples/widgets/doc/boxes.qdoc
index aa34a61bc3..5da7fd2490 100644
--- a/examples/widgets/doc/boxes.qdoc
+++ b/examples/widgets/doc/boxes.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/boxes
+ \example widgets/graphicsview/boxes
\title Boxes
This demo shows Qt's ability to combine advanced OpenGL rendering with the
diff --git a/examples/widgets/doc/calculator.qdoc b/examples/widgets/doc/calculator.qdoc
index 8480d90477..342d5fea03 100644
--- a/examples/widgets/doc/calculator.qdoc
+++ b/examples/widgets/doc/calculator.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/calculator
+ \example widgets/widgets/calculator
\title Calculator Example
The example shows how to use signals and slots to implement the
@@ -49,7 +49,7 @@
\section1 Calculator Class Definition
- \snippet widgets/calculator/calculator.h 0
+ \snippet widgets/widgets/calculator/calculator.h 0
The \c Calculator class provides a simple calculator widget. It
inherits from QDialog and has several private slots associated
@@ -65,8 +65,8 @@
multiplicative operators (\uicontrol{\unicode{215}}, \uicontrol{\unicode{247}}). The other buttons
have their own slots.
- \snippet widgets/calculator/calculator.h 1
- \snippet widgets/calculator/calculator.h 2
+ \snippet widgets/widgets/calculator/calculator.h 1
+ \snippet widgets/widgets/calculator/calculator.h 2
The private \c createButton() function is used as part of the
widget construction. \c abortOperation() is called whenever a
@@ -74,12 +74,12 @@
applied to a negative number. \c calculate() applies a binary
operator (\uicontrol{+}, \uicontrol{-}, \uicontrol{\unicode{215}}, or \uicontrol{\unicode{247}}).
- \snippet widgets/calculator/calculator.h 3
- \snippet widgets/calculator/calculator.h 4
- \snippet widgets/calculator/calculator.h 5
- \snippet widgets/calculator/calculator.h 6
- \snippet widgets/calculator/calculator.h 7
- \snippet widgets/calculator/calculator.h 8
+ \snippet widgets/widgets/calculator/calculator.h 3
+ \snippet widgets/widgets/calculator/calculator.h 4
+ \snippet widgets/widgets/calculator/calculator.h 5
+ \snippet widgets/widgets/calculator/calculator.h 6
+ \snippet widgets/widgets/calculator/calculator.h 7
+ \snippet widgets/widgets/calculator/calculator.h 8
These variables, together with the contents of the calculator
display (a QLineEdit), encode the state of the calculator:
@@ -125,24 +125,24 @@
they can be applied immediately since the operand is already
known when the operator button is clicked.
- \snippet widgets/calculator/calculator.h 9
+ \snippet widgets/widgets/calculator/calculator.h 9
\codeline
- \snippet widgets/calculator/calculator.h 10
+ \snippet widgets/widgets/calculator/calculator.h 10
Finally, we declare the variables associated with the display and the
buttons used to display numerals.
\section1 Calculator Class Implementation
- \snippet widgets/calculator/calculator.cpp 0
+ \snippet widgets/widgets/calculator/calculator.cpp 0
In the constructor, we initialize the calculator's state. The \c
pendingAdditiveOperator and \c pendingMultiplicativeOperator
variables don't need to be initialized explicitly, because the
QString constructor initializes them to empty strings.
- \snippet widgets/calculator/calculator.cpp 1
- \snippet widgets/calculator/calculator.cpp 2
+ \snippet widgets/widgets/calculator/calculator.cpp 1
+ \snippet widgets/widgets/calculator/calculator.cpp 2
We create the QLineEdit representing the calculator's display and
set up some of its properties. In particular, we set it to be
@@ -150,13 +150,13 @@
We also enlarge \c{display}'s font by 8 points.
- \snippet widgets/calculator/calculator.cpp 4
+ \snippet widgets/widgets/calculator/calculator.cpp 4
For each button, we call the private \c createButton() function with
the proper text label and a slot to connect to the button.
- \snippet widgets/calculator/calculator.cpp 5
- \snippet widgets/calculator/calculator.cpp 6
+ \snippet widgets/widgets/calculator/calculator.cpp 5
+ \snippet widgets/widgets/calculator/calculator.cpp 6
The layout is handled by a single QGridLayout. The
QLayout::setSizeConstraint() call ensures that the \c Calculator
@@ -172,7 +172,7 @@
column; for these we must also pass a row span and a column
span.
- \snippet widgets/calculator/calculator.cpp 7
+ \snippet widgets/widgets/calculator/calculator.cpp 7
Pressing one of the calculator's digit buttons will emit the
button's \l{QToolButton::clicked()}{clicked()} signal, which will
@@ -198,8 +198,8 @@
At the end, we append the new digit to the value in the display.
- \snippet widgets/calculator/calculator.cpp 8
- \snippet widgets/calculator/calculator.cpp 9
+ \snippet widgets/widgets/calculator/calculator.cpp 8
+ \snippet widgets/widgets/calculator/calculator.cpp 9
The \c unaryOperatorClicked() slot is called whenever one of the
unary operator buttons is clicked. Again a pointer to the clicked
@@ -215,8 +215,8 @@
digit will be considered as a new operand, instead of being
appended to the current value.
- \snippet widgets/calculator/calculator.cpp 10
- \snippet widgets/calculator/calculator.cpp 11
+ \snippet widgets/widgets/calculator/calculator.cpp 10
+ \snippet widgets/widgets/calculator/calculator.cpp 11
The \c additiveOperatorClicked() slot is called when the user
clicks the \uicontrol{+} or \uicontrol{-} button.
@@ -226,16 +226,16 @@
multiplicative operators, since these have higher precedence than
additive operators:
- \snippet widgets/calculator/calculator.cpp 12
- \snippet widgets/calculator/calculator.cpp 13
+ \snippet widgets/widgets/calculator/calculator.cpp 12
+ \snippet widgets/widgets/calculator/calculator.cpp 13
If \uicontrol{\unicode{215}} or \uicontrol{\unicode{247}} has been clicked earlier, without clicking
\uicontrol{=} afterward, the current value in the display is the right
operand of the \uicontrol{\unicode{215}} or \uicontrol{\unicode{247}} operator and we can finally
perform the operation and update the display.
- \snippet widgets/calculator/calculator.cpp 14
- \snippet widgets/calculator/calculator.cpp 15
+ \snippet widgets/widgets/calculator/calculator.cpp 14
+ \snippet widgets/widgets/calculator/calculator.cpp 15
If \uicontrol{+} or \uicontrol{-} has been clicked earlier, \c sumSoFar is
the left operand and the current value in the display is the
@@ -243,8 +243,8 @@
operator, \c sumSoFar is simply set to be the text in the
display.
- \snippet widgets/calculator/calculator.cpp 16
- \snippet widgets/calculator/calculator.cpp 17
+ \snippet widgets/widgets/calculator/calculator.cpp 16
+ \snippet widgets/widgets/calculator/calculator.cpp 17
Finally, we can take care of the operator that was just clicked.
Since we don't have the right-hand operand yet, we store the clicked
@@ -252,49 +252,49 @@
apply the operation later, when we have a right operand, with \c
sumSoFar as the left operand.
- \snippet widgets/calculator/calculator.cpp 18
+ \snippet widgets/widgets/calculator/calculator.cpp 18
The \c multiplicativeOperatorClicked() slot is similar to \c
additiveOperatorClicked(). We don't need to worry about pending
additive operators here, because multiplicative operators have
precedence over additive operators.
- \snippet widgets/calculator/calculator.cpp 20
+ \snippet widgets/widgets/calculator/calculator.cpp 20
Like in \c additiveOperatorClicked(), we start by handing any
pending multiplicative and additive operators. Then we display \c
sumSoFar and reset the variable to zero. Resetting the variable
to zero is necessary to avoid counting the value twice.
- \snippet widgets/calculator/calculator.cpp 22
+ \snippet widgets/widgets/calculator/calculator.cpp 22
The \c pointClicked() slot adds a decimal point to the content in
\c display.
- \snippet widgets/calculator/calculator.cpp 24
+ \snippet widgets/widgets/calculator/calculator.cpp 24
The \c changeSignClicked() slot changes the sign of the value in
\c display. If the current value is positive, we prepend a minus
sign; if the current value is negative, we remove the first
character from the value (the minus sign).
- \snippet widgets/calculator/calculator.cpp 26
+ \snippet widgets/widgets/calculator/calculator.cpp 26
The \c backspaceClicked() removes the rightmost character in the
display. If we get an empty string, we show "0" and set \c
waitingForOperand to \c true.
- \snippet widgets/calculator/calculator.cpp 28
+ \snippet widgets/widgets/calculator/calculator.cpp 28
The \c clear() slot resets the current operand to zero. It is
equivalent to clicking \uicontrol Backspace enough times to erase the
entire operand.
- \snippet widgets/calculator/calculator.cpp 30
+ \snippet widgets/widgets/calculator/calculator.cpp 30
The \c clearAll() slot resets the calculator to its initial state.
- \snippet widgets/calculator/calculator.cpp 32
+ \snippet widgets/widgets/calculator/calculator.cpp 32
The \c clearMemory() slot erases the sum kept in memory, \c
readMemory() displays the sum as an operand, \c setMemory()
@@ -304,18 +304,18 @@
equalClicked() to update \c sumSoFar and the value in the
display.
- \snippet widgets/calculator/calculator.cpp 34
+ \snippet widgets/widgets/calculator/calculator.cpp 34
The private \c createButton() function is called from the
constructor to create calculator buttons.
- \snippet widgets/calculator/calculator.cpp 36
+ \snippet widgets/widgets/calculator/calculator.cpp 36
The private \c abortOperation() function is called whenever a
calculation fails. It resets the calculator state and displays
"####".
- \snippet widgets/calculator/calculator.cpp 38
+ \snippet widgets/widgets/calculator/calculator.cpp 38
The private \c calculate() function performs a binary operation.
The right operand is given by \c rightOperand. For additive
@@ -327,7 +327,7 @@
Let's now take a look at the \c Button class:
- \snippet widgets/calculator/button.h 0
+ \snippet widgets/widgets/calculator/button.h 0
The \c Button class has a convenience constructor that takes a
text label and a parent widget, and it reimplements QWidget::sizeHint()
@@ -336,7 +336,7 @@
\section1 Button Class Implementation
- \snippet widgets/calculator/button.cpp 0
+ \snippet widgets/widgets/calculator/button.cpp 0
The buttons' appearance is determined by the layout of the
calculator widget through the size and
@@ -348,8 +348,8 @@
expand to fill available space. Without this call, the different
buttons in a same column would have different widths.
- \snippet widgets/calculator/button.cpp 1
- \snippet widgets/calculator/button.cpp 2
+ \snippet widgets/widgets/calculator/button.cpp 1
+ \snippet widgets/widgets/calculator/button.cpp 2
In \l{QWidget::sizeHint()}{sizeHint()}, we try to return a size
that looks good for most buttons. We reuse the size hint of the
diff --git a/examples/widgets/doc/calendar.qdoc b/examples/widgets/doc/calendar.qdoc
index b7fa7c8617..d1a6c06ebe 100644
--- a/examples/widgets/doc/calendar.qdoc
+++ b/examples/widgets/doc/calendar.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example richtext/calendar
+ \example widgets/richtext/calendar
\title Calendar Example
The Calendar example shows how to create rich text content and display it using
@@ -52,7 +52,7 @@
allow the user to change the month and year shown. The font size used for the
text can also be adjusted.
- \snippet richtext/calendar/mainwindow.h 0
+ \snippet widgets/richtext/calendar/mainwindow.h 0
The private \c insertCalendar() function performs most of the work, relying on
the \c fontSize and \c selectedDate variables to write useful information to
@@ -63,7 +63,7 @@
The \c MainWindow constructor sets up the user interface and initializes
variables used to generate a calendar for each month.
- \snippet richtext/calendar/mainwindow.cpp 0
+ \snippet widgets/richtext/calendar/mainwindow.cpp 0
We begin by setting default values for the selected date that will be highlighted
in the calendar and the font size to be used. Since we are using a QMainWindow
@@ -74,7 +74,7 @@
spin box for the year. These widgets are configured to provide a reasonable range
of values for the user to try:
- \snippet richtext/calendar/mainwindow.cpp 1
+ \snippet widgets/richtext/calendar/mainwindow.cpp 1
We use the \c selectedDate object to obtain the current month and year, and we
set these in the combobox and spin box:
@@ -82,7 +82,7 @@
The font size is displayed in a spin box which we restrict to a sensible range
of values:
- \snippet richtext/calendar/mainwindow.cpp 2
+ \snippet widgets/richtext/calendar/mainwindow.cpp 2
We construct an editor and use the \c insertCalendar() function to create
a calendar for it. Each calendar is displayed in the same text editor; in
@@ -93,14 +93,14 @@
effect on the appearance of the calendar unless we make some signal-slot
connections:
- \snippet richtext/calendar/mainwindow.cpp 3
+ \snippet widgets/richtext/calendar/mainwindow.cpp 3
The signals are connected to some simple slots in the \c MainWindow class
which we will describe later.
We create layouts to manage the widgets we constructed:
- \snippet richtext/calendar/mainwindow.cpp 4
+ \snippet widgets/richtext/calendar/mainwindow.cpp 4
Finally, the central widget is set for the window.
@@ -109,7 +109,7 @@
and \c fontSize variables, to produce a suitable plan for the specified
month and year.
- \snippet richtext/calendar/mainwindow.cpp 5
+ \snippet widgets/richtext/calendar/mainwindow.cpp 5
We begin by clearing the editor's rich text document, and obtain a text
cursor from the editor that we will use to add content. We also create a
@@ -120,7 +120,7 @@
page with equal space to the left and right of it. All of these properties are
set in a QTextTableFormat object:
- \snippet richtext/calendar/mainwindow.cpp 6
+ \snippet widgets/richtext/calendar/mainwindow.cpp 6
Each cell in the table will be padded and spaced to make the text easier to
read.
@@ -129,14 +129,14 @@
percentage widths for each of them and set the constraints in the
QTextTableFormat:
- \snippet richtext/calendar/mainwindow.cpp 7
+ \snippet widgets/richtext/calendar/mainwindow.cpp 7
The constraints used for the column widths are only useful if the table has
an appropriate number of columns. With the format for the table defined, we
construct a new table with one row and seven columns at the current cursor
position:
- \snippet richtext/calendar/mainwindow.cpp 8
+ \snippet widgets/richtext/calendar/mainwindow.cpp 8
We only need one row to start with; more can be added as we need them. Using
this approach means that we do not need to perform any date calculations
@@ -146,14 +146,14 @@
the cursor is automatically moved inside the newly inserted object. This means
that we can immediately start modifying the table from within:
- \snippet richtext/calendar/mainwindow.cpp 9
+ \snippet widgets/richtext/calendar/mainwindow.cpp 9
Since the table has an outer frame, we obtain the frame and its format so that
we can customize it. After making the changes we want, we set the frame's format
using the modified format object. We have given the table an outer border one
pixel wide.
- \snippet richtext/calendar/mainwindow.cpp 10
+ \snippet widgets/richtext/calendar/mainwindow.cpp 10
In a similar way, we obtain the cursor's current character format and
create customized formats based on it.
@@ -163,7 +163,7 @@
insert text. The following loop inserts the days of the week into the table
as bold text:
- \snippet richtext/calendar/mainwindow.cpp 11
+ \snippet widgets/richtext/calendar/mainwindow.cpp 11
For each day of the week, we obtain an existing table cell in the first row
(row 0) using the table's \l{QTextTable::cellAt()}{cellAt()} function. Since
@@ -176,7 +176,7 @@
purpose, and we use this cursor to insert text using the \c boldFormat
character format that we created earlier:
- \snippet richtext/calendar/mainwindow.cpp 12
+ \snippet widgets/richtext/calendar/mainwindow.cpp 12
Inserting text into document objects usually follows the same pattern.
Each object can provide a new cursor that corresponds to the first valid
@@ -189,7 +189,7 @@
encountered, it is inserted with a special format (created earlier) that
makes it stand out:
- \snippet richtext/calendar/mainwindow.cpp 13
+ \snippet widgets/richtext/calendar/mainwindow.cpp 13
We add a new row to the table at the end of each week only if the next week
falls within the currently selected month.
@@ -197,24 +197,24 @@
For each calendar that we create, we change the window title to reflect the
currently selected month and year:
- \snippet richtext/calendar/mainwindow.cpp 14
+ \snippet widgets/richtext/calendar/mainwindow.cpp 14
The \c insertCalendar() function relies on up-to-date values for the month,
year, and font size. These are set in the following slots:
- \snippet richtext/calendar/mainwindow.cpp 15
+ \snippet widgets/richtext/calendar/mainwindow.cpp 15
The \c setFontSize() function simply changes the private \c fontSize variable
before updating the calendar.
- \snippet richtext/calendar/mainwindow.cpp 16
+ \snippet widgets/richtext/calendar/mainwindow.cpp 16
The \c setMonth slot is called when the QComboBox used to select the month is
updated. The value supplied is the currently selected row in the combobox.
We add 1 to this value to obtain a valid month number, and create a new QDate
based on the existing one. The calendar is then updated to use this new date.
- \snippet richtext/calendar/mainwindow.cpp 17
+ \snippet widgets/richtext/calendar/mainwindow.cpp 17
The \c setYear() slot is called when the QDateTimeEdit used to select the
year is updated. The value supplied is a QDate object; this makes
diff --git a/examples/widgets/doc/calendarwidget.qdoc b/examples/widgets/doc/calendarwidget.qdoc
index ad15bbaa0c..058b403d16 100644
--- a/examples/widgets/doc/calendarwidget.qdoc
+++ b/examples/widgets/doc/calendarwidget.qdoc
@@ -27,7 +27,7 @@
/*!
\title Calendar Widget Example
- \example widgets/calendarwidget
+ \example widgets/widgets/calendarwidget
The Calendar Widget example shows use of \c QCalendarWidget.
@@ -84,9 +84,9 @@
Here is the definition of the \c Window class:
- \snippet widgets/calendarwidget/window.h 0
+ \snippet widgets/widgets/calendarwidget/window.h 0
\dots
- \snippet widgets/calendarwidget/window.h 1
+ \snippet widgets/widgets/calendarwidget/window.h 1
As is often the case with classes that represent self-contained
windows, most of the API is private. We will review the private
@@ -96,7 +96,7 @@
Let's now review the class implementation, starting with the constructor:
- \snippet widgets/calendarwidget/window.cpp 0
+ \snippet widgets/widgets/calendarwidget/window.cpp 0
We start by creating the four \l{QGroupBox}es and their child
widgets (including the QCalendarWidget) using four private \c
@@ -116,7 +116,7 @@
Let's move on to the \c createPreviewGroupBox() function:
- \snippet widgets/calendarwidget/window.cpp 9
+ \snippet widgets/widgets/calendarwidget/window.cpp 9
The \uicontrol Preview group box contains only one widget: the
QCalendarWidget. We set it up, connect its
@@ -128,7 +128,7 @@
and several widgets are set up the same way; we look at parts of
its implementation here and skip the rest:
- \snippet widgets/calendarwidget/window.cpp 10
+ \snippet widgets/widgets/calendarwidget/window.cpp 10
\dots
We start with the setup of the \uicontrol{Week starts on} combobox.
@@ -142,7 +142,7 @@
C++ will happily convert any enum value to \c int.
\dots
- \snippet widgets/calendarwidget/window.cpp 11
+ \snippet widgets/widgets/calendarwidget/window.cpp 11
\dots
After creating the widgets, we connect the signals and slots. We
@@ -150,14 +150,14 @@
public slots provided by QComboBox.
\dots
- \snippet widgets/calendarwidget/window.cpp 12
+ \snippet widgets/widgets/calendarwidget/window.cpp 12
At the end of the function, we call the slots that update the calendar to ensure
that the QCalendarWidget is synchronized with the other widgets on startup.
Let's now take a look at the \c createDatesGroupBox() private function:
- \snippet widgets/calendarwidget/window.cpp 13
+ \snippet widgets/widgets/calendarwidget/window.cpp 13
In this function, we create the \uicontrol {Minimum Date}, \uicontrol {Maximum Date},
and \uicontrol {Current Date} editor widgets,
@@ -166,9 +166,9 @@
set in \c createPrivewGroupBox(); we can then set the widgets
default values to the calendars values.
- \snippet widgets/calendarwidget/window.cpp 14
+ \snippet widgets/widgets/calendarwidget/window.cpp 14
\dots
- \snippet widgets/calendarwidget/window.cpp 15
+ \snippet widgets/widgets/calendarwidget/window.cpp 15
We connect the \c currentDateEdit's
\l{QDateEdit::}{dateChanged()} signal directly to the calendar's
@@ -180,20 +180,20 @@
Here is the \c createTextFormatsGroup() function:
- \snippet widgets/calendarwidget/window.cpp 16
+ \snippet widgets/widgets/calendarwidget/window.cpp 16
We set up the \uicontrol {Weekday Color} and \uicontrol {Weekend Color} comboboxes
using \c createColorCombo(), which instantiates a QComboBox and
populates it with colors ("Red", "Blue", etc.).
- \snippet widgets/calendarwidget/window.cpp 17
+ \snippet widgets/widgets/calendarwidget/window.cpp 17
The \uicontrol {Header Text Format} combobox lets the user change the
text format (bold, italic, or plain) used for horizontal and
vertical headers. The \uicontrol {First Friday in blue} and \uicontrol {May 1
in red} check box affect the rendering of specific dates.
- \snippet widgets/calendarwidget/window.cpp 18
+ \snippet widgets/widgets/calendarwidget/window.cpp 18
We connect the check boxes and comboboxes to various private
slots. The \uicontrol {First Friday in blue} and \uicontrol {May 1 in red}
@@ -201,7 +201,7 @@
which is also called when the calendar switches month.
\dots
- \snippet widgets/calendarwidget/window.cpp 19
+ \snippet widgets/widgets/calendarwidget/window.cpp 19
At the end of \c createTextFormatsGroupBox(), we call private
slots to synchronize the QCalendarWidget with the other widgets.
@@ -210,7 +210,7 @@
functions. Let's now take a look at the other private functions
and slots.
- \snippet widgets/calendarwidget/window.cpp 20
+ \snippet widgets/widgets/calendarwidget/window.cpp 20
In \c createColorCombo(), we create a combobox and populate it with
standard colors. The second argument to QComboBox::addItem()
@@ -219,7 +219,7 @@
This function was used to set up the \uicontrol {Weekday Color}
and \uicontrol {Weekend Color} comboboxes.
- \snippet widgets/calendarwidget/window.cpp 1
+ \snippet widgets/widgets/calendarwidget/window.cpp 1
When the user changes the \uicontrol {Week starts on} combobox's
value, \c firstDayChanged() is invoked with the index of the
@@ -231,12 +231,12 @@
verticalHeaderChanged() are very similar to \c firstDayChanged(),
so they are omitted.
- \snippet widgets/calendarwidget/window.cpp 2
+ \snippet widgets/widgets/calendarwidget/window.cpp 2
The \c selectedDateChanged() updates the \uicontrol{Current Date}
editor to reflect the current state of the QCalendarWidget.
- \snippet widgets/calendarwidget/window.cpp 3
+ \snippet widgets/widgets/calendarwidget/window.cpp 3
When the user changes the minimum date, we tell the
QCalenderWidget. We also update the \uicontrol {Maximum Date} editor,
@@ -244,12 +244,12 @@
date, QCalendarWidget will automatically adapt its maximum date
to avoid a contradicting state.
- \snippet widgets/calendarwidget/window.cpp 4
+ \snippet widgets/widgets/calendarwidget/window.cpp 4
\c maximumDateChanged() is implemented similarly to \c
minimumDateChanged().
- \snippet widgets/calendarwidget/window.cpp 5
+ \snippet widgets/widgets/calendarwidget/window.cpp 5
Each combobox item has a QColor object as user data corresponding to the
item's text. After fetching the colors from the comboboxes, we
@@ -260,13 +260,13 @@
specify various character formatting information. In this
example, we only show a subset of the possibilities.
- \snippet widgets/calendarwidget/window.cpp 6
+ \snippet widgets/widgets/calendarwidget/window.cpp 6
\c weekendFormatChanged() is the same as \c
weekdayFormatChanged(), except that it affects Saturday and
Sunday instead of Monday to Friday.
- \snippet widgets/calendarwidget/window.cpp 7
+ \snippet widgets/widgets/calendarwidget/window.cpp 7
The \c reformatHeaders() slot is called when the user
changes the text format of
@@ -275,7 +275,7 @@
have been to store \l{QTextCharFormat} values alongside the combobox
items.)
- \snippet widgets/calendarwidget/window.cpp 8
+ \snippet widgets/widgets/calendarwidget/window.cpp 8
In \c reformatCalendarPage(), we set the text format of the first
Friday in the month and May 1 in the current year. The text
diff --git a/examples/widgets/doc/charactermap.qdoc b/examples/widgets/doc/charactermap.qdoc
index fee2a42156..59ee99fa12 100644
--- a/examples/widgets/doc/charactermap.qdoc
+++ b/examples/widgets/doc/charactermap.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\example widgets/charactermap
+\example widgets/widgets/charactermap
\title Character Map Example
The Character Map example shows how to create a custom widget that can
@@ -59,7 +59,7 @@ and interaction features.
The class definition looks like this:
-\snippet widgets/charactermap/characterwidget.h 0
+\snippet widgets/widgets/charactermap/characterwidget.h 0
The widget does not contain any other widgets, so it must provide its own
size hint to allow its contents to be displayed correctly.
@@ -87,7 +87,7 @@ Since the widget is to be used as a simple canvas, the constructor just
calls the base class constructor and defines some default values for
private data members.
-\snippet widgets/charactermap/characterwidget.cpp 0
+\snippet widgets/widgets/charactermap/characterwidget.cpp 0
We initialize \c currentKey with a value of -1 to indicate
that no character is initially selected. We enable mouse tracking to
@@ -96,21 +96,21 @@ allow us to follow the movement of the cursor across the widget.
The class provides two functions to allow the font and style to be set up.
Each of these modify the widget's display font and call update():
-\snippet widgets/charactermap/characterwidget.cpp 1
+\snippet widgets/widgets/charactermap/characterwidget.cpp 1
\codeline
-\snippet widgets/charactermap/characterwidget.cpp 2
+\snippet widgets/widgets/charactermap/characterwidget.cpp 2
We use a fixed size font for the display. Similarly, a fixed size hint is
provided by the sizeHint() function:
-\snippet widgets/charactermap/characterwidget.cpp 3
+\snippet widgets/widgets/charactermap/characterwidget.cpp 3
Three standard event functions are implemented so that the widget
can respond to clicks, provide tooltips, and render the available
characters. The paintEvent() shows how the contents of the widget are
arranged and displayed:
-\snippet widgets/charactermap/characterwidget.cpp 6
+\snippet widgets/widgets/charactermap/characterwidget.cpp 6
A QPainter is created for the widget and, in all cases, we ensure that the
widget's background is painted. The painter's font is set to the
@@ -119,19 +119,19 @@ user-specified display font.
The area of the widget that needs to be redrawn is used to determine which
characters need to be displayed:
-\snippet widgets/charactermap/characterwidget.cpp 7
+\snippet widgets/widgets/charactermap/characterwidget.cpp 7
Using integer division, we obtain the row and column numbers of each
characters that should be displayed, and we draw a square on the widget
for each character displayed.
-\snippet widgets/charactermap/characterwidget.cpp 8
-\snippet widgets/charactermap/characterwidget.cpp 9
+\snippet widgets/widgets/charactermap/characterwidget.cpp 8
+\snippet widgets/widgets/charactermap/characterwidget.cpp 9
The symbols for each character in the array are drawn within each square,
with the symbol for the most recently selected character displayed in red:
-\snippet widgets/charactermap/characterwidget.cpp 10
+\snippet widgets/widgets/charactermap/characterwidget.cpp 10
We do not need to take into account the difference between the area
displayed in the viewport and the area we are drawing on because
@@ -139,7 +139,7 @@ everything outside the visible area will be clipped.
The mousePressEvent() defines how the widget responds to mouse clicks.
-\snippet widgets/charactermap/characterwidget.cpp 5
+\snippet widgets/widgets/charactermap/characterwidget.cpp 5
We are only interested when the user clicks with the left mouse button
over the widget. When this happens, we calculate which character was
@@ -158,7 +158,7 @@ The mouseMoveEvent() maps the mouse cursor's position in global
coordinates to widget coordinates, and determines the character that
was clicked by performing the calculation
-\snippet widgets/charactermap/characterwidget.cpp 4
+\snippet widgets/widgets/charactermap/characterwidget.cpp 4
The tooltip is given a position defined in global coordinates.
@@ -171,7 +171,7 @@ interface.
The class definition looks like this:
-\snippet widgets/charactermap/mainwindow.h 0
+\snippet widgets/widgets/charactermap/mainwindow.h 0
The main window contains various widgets that are used to control how
the characters will be displayed, and defines the findFonts() function
@@ -188,7 +188,7 @@ some standard widgets (two comboboxes, a line edit, and a push button).
We also construct a CharacterWidget custom widget, and add a QScrollArea
so that we can view its contents:
-\snippet widgets/charactermap/mainwindow.cpp 0
+\snippet widgets/widgets/charactermap/mainwindow.cpp 0
QScrollArea provides a viewport onto the \c CharacterWidget when we set
its widget and handles much of the work needed to provide a scrolling
@@ -198,11 +198,11 @@ The font combo box is automatically popuplated with a list of available
fonts. We list the available styles for the current font in the style
combobox using the following function:
-\snippet widgets/charactermap/mainwindow.cpp 1
+\snippet widgets/widgets/charactermap/mainwindow.cpp 1
The line edit and push button are used to supply text to the clipboard:
-\snippet widgets/charactermap/mainwindow.cpp 2
+\snippet widgets/widgets/charactermap/mainwindow.cpp 2
We also obtain a clipboard object so that we can send text entered by the
user to other applications.
@@ -211,7 +211,7 @@ Most of the signals emitted in the example come from standard widgets.
We connect these signals to slots in this class, and to the slots provided
by other widgets.
-\snippet widgets/charactermap/mainwindow.cpp 4
+\snippet widgets/widgets/charactermap/mainwindow.cpp 4
The font combobox's
\l{QFontComboBox::currentFontChanged()}{currentFontChanged()} signal is
@@ -225,7 +225,7 @@ directly to the character widget.
The final two connections allow characters to be selected in the character
widget, and text to be inserted into the clipboard:
-\snippet widgets/charactermap/mainwindow.cpp 5
+\snippet widgets/widgets/charactermap/mainwindow.cpp 5
The character widget emits the characterSelected() custom signal when
the user clicks on a character, and this is handled by the insertCharacter()
@@ -235,20 +235,20 @@ the clicked() signal, and we handle this with the updateClipboard() function.
The remaining code in the constructor sets up the layout of the central widget,
and provides a window title:
-\snippet widgets/charactermap/mainwindow.cpp 6
+\snippet widgets/widgets/charactermap/mainwindow.cpp 6
The font combobox is automatically populated with a list of available font
families. The styles that can be used with each font are found by the
findStyles() function. This function is called whenever the user selects a
different font in the font combobox.
-\snippet widgets/charactermap/mainwindow.cpp 7
+\snippet widgets/widgets/charactermap/mainwindow.cpp 7
We begin by recording the currently selected style, and we clear the
style combobox so that we can insert the styles associated with the
current font family.
-\snippet widgets/charactermap/mainwindow.cpp 8
+\snippet widgets/widgets/charactermap/mainwindow.cpp 8
We use the font database to collect the styles that are available for the
current font, and insert them into the style combobox. The current item is
@@ -259,7 +259,7 @@ widget and the main window's push button. The insertCharacter() function is
used to insert characters from the character widget when the user clicks a
character:
-\snippet widgets/charactermap/mainwindow.cpp 9
+\snippet widgets/widgets/charactermap/mainwindow.cpp 9
The character is inserted into the line edit at the current cursor position.
@@ -267,7 +267,7 @@ The main window's "To clipboard" push button is connected to the
updateClipboard() function so that, when it is clicked, the clipboard is
updated to contain the contents of the line edit:
-\snippet widgets/charactermap/mainwindow.cpp 10
+\snippet widgets/widgets/charactermap/mainwindow.cpp 10
We copy all the text from the line edit to the clipboard, but we do not clear
the line edit.
diff --git a/examples/widgets/doc/chart.qdoc b/examples/widgets/doc/chart.qdoc
index 44263d1027..edd3a8d78c 100644
--- a/examples/widgets/doc/chart.qdoc
+++ b/examples/widgets/doc/chart.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/chart
+ \example widgets/itemviews/chart
\title Chart Example
The Chart example shows how to create a custom view for the model/view framework.
@@ -51,7 +51,7 @@
indexAt(). However, the view needs to maintain strict control over its look and
feel, so we also provide implementations for a number of other functions:
- \snippet itemviews/chart/pieview.h 0
+ \snippet widgets/widgets/itemviews/chart/pieview.h 0
diff --git a/examples/widgets/doc/chip.qdoc b/examples/widgets/doc/chip.qdoc
index 966c16900a..b7bd0f0795 100644
--- a/examples/widgets/doc/chip.qdoc
+++ b/examples/widgets/doc/chip.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/chip
+ \example widgets/graphicsview/chip
\title 40000 Chips
This demo shows how to visualize a huge scene with 40000 chip items
diff --git a/examples/widgets/doc/classwizard.qdoc b/examples/widgets/doc/classwizard.qdoc
index 0c357b7286..b3b9dab669 100644
--- a/examples/widgets/doc/classwizard.qdoc
+++ b/examples/widgets/doc/classwizard.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/classwizard
+ \example widgets/dialogs/classwizard
\title Class Wizard Example
The License Wizard example shows how to implement linear
@@ -82,14 +82,14 @@
Here's the \c ClassWizard definition:
- \snippet dialogs/classwizard/classwizard.h 0
+ \snippet widgets/dialogs/classwizard/classwizard.h 0
The class reimplements QDialog's \l{QDialog::}{accept()} slot.
This slot is called when the user clicks \uicontrol{Finish}.
Here's the constructor:
- \snippet dialogs/classwizard/classwizard.cpp 1
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 1
We instantiate the five pages and insert them into the wizard
using QWizard::addPage(). The order in which they are inserted
@@ -102,11 +102,11 @@
dialog's background in \l{QWizard::}{MacStyle}. (See \l{Elements
of a Wizard Page} for more information.)
- \snippet dialogs/classwizard/classwizard.cpp 3
- \snippet dialogs/classwizard/classwizard.cpp 4
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 3
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 4
\dots
- \snippet dialogs/classwizard/classwizard.cpp 5
- \snippet dialogs/classwizard/classwizard.cpp 6
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 5
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 6
If the user clicks \uicontrol Finish, we extract the information from
the various pages using QWizard::field() and generate the files.
@@ -121,9 +121,9 @@
classwizard.cpp, together with \c ClassWizard. We will start with
the easiest page:
- \snippet dialogs/classwizard/classwizard.h 1
+ \snippet widgets/dialogs/classwizard/classwizard.h 1
\codeline
- \snippet dialogs/classwizard/classwizard.cpp 7
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 7
A page inherits from QWizardPage. We set a
\l{QWizardPage::}{title} and a
@@ -139,13 +139,13 @@
The second page is defined and implemented as follows:
- \snippet dialogs/classwizard/classwizard.h 2
+ \snippet widgets/dialogs/classwizard/classwizard.h 2
\codeline
- \snippet dialogs/classwizard/classwizard.cpp 9
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 9
\dots
- \snippet dialogs/classwizard/classwizard.cpp 12
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 12
\dots
- \snippet dialogs/classwizard/classwizard.cpp 13
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 13
First, we set the page's \l{QWizardPage::}{title},
\l{QWizardPage::}{subTitle}, and \l{QWizard::LogoPixmap}{logo
@@ -165,13 +165,13 @@
The third page is defined and implemented as follows:
- \snippet dialogs/classwizard/classwizard.h 3
+ \snippet widgets/dialogs/classwizard/classwizard.h 3
\codeline
- \snippet dialogs/classwizard/classwizard.cpp 14
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 14
\dots
- \snippet dialogs/classwizard/classwizard.cpp 15
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 15
\codeline
- \snippet dialogs/classwizard/classwizard.cpp 16
+ \snippet widgets/dialogs/classwizard/classwizard.cpp 16
The code in the constructor is very similar to what we did for \c
ClassInfoPage, so we skipped most of it.
diff --git a/examples/widgets/doc/codeeditor.qdoc b/examples/widgets/doc/codeeditor.qdoc
index 695ac5c4ce..281239acea 100644
--- a/examples/widgets/doc/codeeditor.qdoc
+++ b/examples/widgets/doc/codeeditor.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/codeeditor
+ \example widgets/widgets/codeeditor
\title Code Editor Example
The Code Editor example shows how to create a simple editor that
@@ -80,13 +80,13 @@
extend the editor with breakpoints or other code editor features.
The widget would then help in the handling of mouse events.
- \snippet widgets/codeeditor/codeeditor.h extraarea
+ \snippet widgets/widgets/codeeditor/codeeditor.h extraarea
\section1 CodeEditor Class Definition
Here is the code editor's class definition:
- \snippet widgets/codeeditor/codeeditor.h codeeditordefinition
+ \snippet widgets/widgets/codeeditor/codeeditor.h codeeditordefinition
In the editor we resize and draw the line numbers on the \c
LineNumberArea. We need to do this when the number of lines in the
@@ -102,37 +102,37 @@
We will now go through the code editors implementation, starting
off with the constructor.
- \snippet widgets/codeeditor/codeeditor.cpp constructor
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp constructor
In the constructor we connect our slots to signals in
QPlainTextEdit. It is necessary to calculate the line number area
width and highlight the first line when the editor is created.
- \snippet widgets/codeeditor/codeeditor.cpp extraAreaWidth
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaWidth
The \c lineNumberAreaWidth() function calculates the width of the
\c LineNumberArea widget. We take the number of digits in the last
line of the editor and multiply that with the maximum width of a
digit.
- \snippet widgets/codeeditor/codeeditor.cpp slotUpdateExtraAreaWidth
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp slotUpdateExtraAreaWidth
When we update the width of the line number area, we simply call
QAbstractScrollArea::setViewportMargins().
- \snippet widgets/codeeditor/codeeditor.cpp slotUpdateRequest
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp slotUpdateRequest
This slot is invoked when the editors viewport has been scrolled.
The QRect given as argument is the part of the editing area that
is do be updated (redrawn). \c dy holds the number of pixels the
view has been scrolled vertically.
- \snippet widgets/codeeditor/codeeditor.cpp resizeEvent
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp resizeEvent
When the size of the editor changes, we also need to resize the
line number area.
- \snippet widgets/codeeditor/codeeditor.cpp cursorPositionChanged
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp cursorPositionChanged
When the cursor position changes, we highlight the current line,
i.e., the line containing the cursor.
@@ -151,13 +151,13 @@
block, the cursor should be moved with QTextCursor::movePosition()
from a position set with \l{QTextCursor::}{setPosition()}.
- \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_0
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_0
The \c lineNumberAreaPaintEvent() is called from \c LineNumberArea
whenever it receives a paint event. We start off by painting the
widget's background.
- \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_1
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_1
We will now loop through all visible lines and paint the line
numbers in the extra area for each line. Notice that in a plain
@@ -169,7 +169,7 @@
and adjust these values by the height of the current text block in
each iteration in the loop.
- \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_2
+ \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_2
Notice that we check if the block is visible in addition to check
if it is in the areas viewport - a block can, for example, be
diff --git a/examples/widgets/doc/coloreditorfactory.qdoc b/examples/widgets/doc/coloreditorfactory.qdoc
index a2c02f8c1d..6cd97eec41 100644
--- a/examples/widgets/doc/coloreditorfactory.qdoc
+++ b/examples/widgets/doc/coloreditorfactory.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/coloreditorfactory
+ \example widgets/itemviews/coloreditorfactory
\title Color Editor Factory Example
This example shows how to create an editor that can be used by
@@ -66,7 +66,7 @@
We take a closer look at the constructor:
- \snippet itemviews/coloreditorfactory/window.cpp 0
+ \snippet widgets/itemviews/coloreditorfactory/window.cpp 0
The QStandardItemEditorCreator is a convenience class that
inherits QItemEditorCreatorBase. Its constructor takes a template
@@ -88,7 +88,7 @@
The ColorListEditor inherits QComboBox and lets the user
select a QColor from its popup list.
- \snippet itemviews/coloreditorfactory/colorlisteditor.h 0
+ \snippet widgets/itemviews/coloreditorfactory/colorlisteditor.h 0
QItemDelegate manages the interaction between the editor and
the model, i.e., it retrieves data to edit from the model and
@@ -105,19 +105,19 @@
populateList(), which we will look at later. We move on to the
\c color() function:
- \snippet itemviews/coloreditorfactory/colorlisteditor.cpp 0
+ \snippet widgets/itemviews/coloreditorfactory/colorlisteditor.cpp 0
We return the data that is selected in the combobox. The data
is stored in the Qt::DecorationRole as the color is then also
displayed in the popup list (as shown in the image above).
- \snippet itemviews/coloreditorfactory/colorlisteditor.cpp 1
+ \snippet widgets/itemviews/coloreditorfactory/colorlisteditor.cpp 1
The \c findData() function searches the items in the combobox
and returns the index of the item that has \c color in the
Qt::Decoration role.
- \snippet itemviews/coloreditorfactory/colorlisteditor.cpp 2
+ \snippet widgets/itemviews/coloreditorfactory/colorlisteditor.cpp 2
Qt knows some predefined colors by name. We simply loop
through these to fill our editor with items.
diff --git a/examples/widgets/doc/combowidgetmapper.qdoc b/examples/widgets/doc/combowidgetmapper.qdoc
index 949014930d..f278a775ac 100644
--- a/examples/widgets/doc/combowidgetmapper.qdoc
+++ b/examples/widgets/doc/combowidgetmapper.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/combowidgetmapper
+ \example widgets/itemviews/combowidgetmapper
\title Combo Widget Mapper Example
The Combo Widget Mapper example shows how to use a custom delegate to
@@ -51,7 +51,7 @@
The class provides a constructor, a slot to keep the buttons up to date,
and a private function to set up the model:
- \snippet itemviews/combowidgetmapper/window.h Window definition
+ \snippet widgets/itemviews/combowidgetmapper/window.h Window definition
In addition to the QDataWidgetMapper object and the controls used to make
up the user interface, we use a QStandardItemModel to hold our data and
@@ -63,7 +63,7 @@
The constructor of the \c Window class can be explained in three parts.
In the first part, we set up the widgets used for the user interface:
- \snippet itemviews/combowidgetmapper/window.cpp Set up widgets
+ \snippet widgets/itemviews/combowidgetmapper/window.cpp Set up widgets
Note that we set up the mapping the combo box in the same way as for other
widgets, but that we apply its own model to it so that it will display
@@ -73,7 +73,7 @@
Next, we set up the widget mapper, relating each input widget to a column
in the model specified by the call to \l{QDataWidgetMapper::}{setModel()}:
- \snippet itemviews/combowidgetmapper/window.cpp Set up the mapper
+ \snippet widgets/itemviews/combowidgetmapper/window.cpp Set up the mapper
For the combo box, we pass an extra argument to tell the widget mapper
which property to relate to values from the model. As a result, the user
@@ -92,14 +92,14 @@
The rest of the constructor is very similar to that of the
\l{Simple Widget Mapper Example}:
- \snippet itemviews/combowidgetmapper/window.cpp Set up connections and layouts
+ \snippet widgets/itemviews/combowidgetmapper/window.cpp Set up connections and layouts
The model is initialized in the window's \c{setupModel()} function. Here,
we create a standard model with 5 rows and 3 columns. In each row, we
insert a name, address, and a value that indicates the type of address.
The address types are stored in a string list model.
- \snippet itemviews/combowidgetmapper/window.cpp Set up the model
+ \snippet widgets/itemviews/combowidgetmapper/window.cpp Set up the model
As we insert each row into the model, like a record in a database, we
store values that correspond to items in \c typeModel for each person's
@@ -113,7 +113,7 @@
We show the implementation of the \c{updateButtons()} slot for
completeness:
- \snippet itemviews/combowidgetmapper/window.cpp Slot for updating the buttons
+ \snippet widgets/itemviews/combowidgetmapper/window.cpp Slot for updating the buttons
\omit
\section1 Delegate Class Definition and Implementation
@@ -121,7 +121,7 @@
The delegate we use to mediate interaction between the widget mapper and
the input widgets is a small QItemDelegate subclass:
- \snippet itemviews/combowidgetmapper/delegate.h Delegate class definition
+ \snippet widgets/itemviews/combowidgetmapper/delegate.h Delegate class definition
This provides implementations of the two standard functions used to pass
data between editor widgets and the model (see the \l{Delegate Classes}
@@ -134,7 +134,7 @@
referred to by the model index supplied and processes it according to
the presence of a \c currentIndex property in the editor widget:
- \snippet itemviews/combowidgetmapper/delegate.cpp setEditorData implementation
+ \snippet widgets/itemviews/combowidgetmapper/delegate.cpp setEditorData implementation
If, like QComboBox, the editor widget has this property, it is set using
the value from the model. Since we are passing around QVariant values,
@@ -149,7 +149,7 @@
process, taking the value stored in the widget's \c currentIndex property
and storing it back in the model:
- \snippet itemviews/combowidgetmapper/delegate.cpp setModelData implementation
+ \snippet widgets/itemviews/combowidgetmapper/delegate.cpp setModelData implementation
\endomit
\section1 Summary and Further Reading
diff --git a/examples/widgets/doc/composition.qdoc b/examples/widgets/doc/composition.qdoc
index 6aca01d255..2db9e19d22 100644
--- a/examples/widgets/doc/composition.qdoc
+++ b/examples/widgets/doc/composition.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/composition
+ \example widgets/painting/composition
\title Composition Modes
This demo shows some of the more advanced composition modes supported by Qt.
diff --git a/examples/widgets/doc/concentriccircles.qdoc b/examples/widgets/doc/concentriccircles.qdoc
index 67bc125dbe..aa93b7ece9 100644
--- a/examples/widgets/doc/concentriccircles.qdoc
+++ b/examples/widgets/doc/concentriccircles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/concentriccircles
+ \example widgets/painting/concentriccircles
\title Concentric Circles Example
The Concentric Circles example shows the improved rendering
@@ -74,7 +74,7 @@
The CircleWidget class inherits QWidget, and is a custom widget
which renders several animated concentric circles.
- \snippet painting/concentriccircles/circlewidget.h 0
+ \snippet widgets/painting/concentriccircles/circlewidget.h 0
We declare the \c floatBased and \c antialiased variables to hold
whether an instance of the class should be rendered with integer
@@ -97,7 +97,7 @@
In the constructor we make the widget's rendering integer based
and aliased by default:
- \snippet painting/concentriccircles/circlewidget.cpp 0
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 0
We initialize the widget's \c frameNo variable, and set the
widget's background color using the QWidget::setBackgroundColor()
@@ -111,9 +111,9 @@
useful. The widget can also make use of extra space, so it should
get as much space as possible.
- \snippet painting/concentriccircles/circlewidget.cpp 1
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 1
\codeline
- \snippet painting/concentriccircles/circlewidget.cpp 2
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 2
The public \c setFloatBased() and \c setAntialiased() functions
update the widget's rendering preferences, i.e. whether the widget
@@ -124,9 +124,9 @@
QWidget::update() function, forcing a repaint of the widget with
the new rendering preferences.
- \snippet painting/concentriccircles/circlewidget.cpp 3
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 3
\codeline
- \snippet painting/concentriccircles/circlewidget.cpp 4
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 4
The default implementations of the QWidget::minimumSizeHint() and
QWidget::sizeHint() functions return invalid sizes if there is no
@@ -136,14 +136,14 @@
We reimplement the functions to give the widget minimum and
preferred sizes which are reasonable within our application.
- \snippet painting/concentriccircles/circlewidget.cpp 5
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 5
The nextAnimationFrame() slot simply increments the \c frameNo
variable's value, and calls the QWidget::update() function which
schedules a paint event for processing when Qt returns to the main
event loop.
- \snippet painting/concentriccircles/circlewidget.cpp 6
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 6
A paint event is a request to repaint all or part of the
widget. The \c paintEvent() function is an event handler that can
@@ -158,7 +158,7 @@
widget's cocentric circles. The translation ensures that the
center of the circles will be equivalent to the widget's center.
- \snippet painting/concentriccircles/circlewidget.cpp 7
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 7
When painting a circle, we use the number of "animation frames" to
determine the alpha channel of the circle's color. The alpha
@@ -166,7 +166,7 @@
fully transparent color, while 255 represents a fully opaque
color.
- \snippet painting/concentriccircles/circlewidget.cpp 8
+ \snippet widgets/painting/concentriccircles/circlewidget.cpp 8
If the calculated alpha channel is fully transparent, we don't
draw anything since that would be equivalent to drawing a white
@@ -190,7 +190,7 @@
window rendering four \c {CircleWidget}s using different
combinations of precision and aliasing.
- \snippet painting/concentriccircles/window.h 0
+ \snippet widgets/painting/concentriccircles/window.h 0
We declare the various components of the main window, i.e., the text
labels and a double array that will hold reference to the four \c
@@ -199,12 +199,12 @@
\section1 Window Class Implementation
- \snippet painting/concentriccircles/window.cpp 0
+ \snippet widgets/painting/concentriccircles/window.cpp 0
In the constructor, we first create the various labels and put
them in a QGridLayout.
- \snippet painting/concentriccircles/window.cpp 1
+ \snippet widgets/painting/concentriccircles/window.cpp 1
Then we create a QTimer. The QTimer class is a high-level
programming interface for timers, and provides repetitive and
@@ -215,7 +215,7 @@
them to the layout), we connect the QTimer::timeout() signal to
each of the widgets' \c nextAnimationFrame() slots.
- \snippet painting/concentriccircles/window.cpp 2
+ \snippet widgets/painting/concentriccircles/window.cpp 2
Before we set the layout and window title for our main window, we
make the timer start with a timeout interval of 100 milliseconds,
@@ -224,7 +224,7 @@
four \c {CircleWidget}s, every 100 millisecond which is the reason
the circles appear as animated.
- \snippet painting/concentriccircles/window.cpp 3
+ \snippet widgets/painting/concentriccircles/window.cpp 3
The private \c createLabel() function is implemented to simlify
the constructor.
diff --git a/examples/widgets/doc/configdialog.qdoc b/examples/widgets/doc/configdialog.qdoc
index 9acea72a3b..d05b35b8c4 100644
--- a/examples/widgets/doc/configdialog.qdoc
+++ b/examples/widgets/doc/configdialog.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/configdialog
+ \example widgets/dialogs/configdialog
\title Config Dialog Example
The Config Dialog examples shows how a configuration dialog can be created by
diff --git a/examples/widgets/doc/customsortfiltermodel.qdoc b/examples/widgets/doc/customsortfiltermodel.qdoc
index 4dce820f9c..e153fc9428 100644
--- a/examples/widgets/doc/customsortfiltermodel.qdoc
+++ b/examples/widgets/doc/customsortfiltermodel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/customsortfiltermodel
+ \example widgets/itemviews/customsortfiltermodel
\title Custom Sort/Filter Model Example
The Custom Sort/Filter Model example illustrates how to subclass
@@ -80,7 +80,7 @@
that our filter can recognize a valid range of dates, and to
control the sorting behavior.
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.h 0
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h 0
We want to be able to filter our data by specifying a given period
of time. For that reason, we implement the custom \c
@@ -100,7 +100,7 @@
The \c MySortFilterProxyModel constructor is trivial, passing the
parent parameter on to the base class constructor:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 0
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 0
The most interesting parts of the \c MySortFilterProxyModel
implementation are the reimplementations of
@@ -110,7 +110,7 @@
functions. Let's first take a look at our customized \c lessThan()
function.
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 4
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 4
We want to sort the senders by their email addresses. The \l
{QSortFilterProxyModel::}{lessThan()} function is used as the <
@@ -119,7 +119,7 @@
to be able to sort the senders by their email addresses we must
first identify the address within the given string:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 6
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 6
We use QRegExp to define a pattern for the addresses we are looking
for. The QRegExp::indexIn() function attempts to find a match in
@@ -132,7 +132,7 @@
subexpressions have indexes starting from 1 (excluding
non-capturing parentheses).
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
The \l
{QSortFilterProxyModel::filterAcceptsRow()}{filterAcceptsRow()}
@@ -141,7 +141,7 @@
is accepted if either the subject or the sender contains the given
regular expression, and the date is valid.
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 7
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 7
We use our custom \c dateInRange() function to determine if a date
is valid.
@@ -150,9 +150,9 @@
time, we also implement functions for getting and setting the
minimum and maximum dates:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 1
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 1
\codeline
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 2
+ \snippet widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 2
The get functions, \c filterMinimumDate() and \c
filterMaximumDate(), are trivial and implemented as inline
@@ -166,7 +166,7 @@
The \c CustomFilter class inherits QWidget, and provides this
example's main application window:
- \snippet itemviews/customsortfiltermodel/window.h 0
+ \snippet widgets/itemviews/customsortfiltermodel/window.h 0
We implement two private slots, \c textFilterChanged() and \c
dateFilterChanged(), to respond to the user changing the filter
@@ -182,7 +182,7 @@
source model already exists and start by creating an instance of
our custom proxy model:
- \snippet itemviews/customsortfiltermodel/window.cpp 0
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 0
We set the \l
{QSortFilterProxyModel::dynamicSortFilter}{dynamicSortFilter}
@@ -194,13 +194,13 @@
The main application window shows views of both the source model
and the proxy model. The source view is quite simple:
- \snippet itemviews/customsortfiltermodel/window.cpp 1
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 1
The QTreeView class provides a default model/view implementation
of a tree view; our view implements a tree representation of items
in the application's source model.
- \snippet itemviews/customsortfiltermodel/window.cpp 2
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 2
The QTreeView class provides a default model/view implementation
of a tree view; our view implements a tree representation of items
@@ -211,14 +211,14 @@
controlling the various aspects of transforming the source model's
data structure:
- \snippet itemviews/customsortfiltermodel/window.cpp 3
- \snippet itemviews/customsortfiltermodel/window.cpp 4
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 3
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 4
Note that whenever the user changes one of the filtering options,
we must explicitly reapply the filter. This is done by connecting
the various editors to functions that update the proxy model.
- \snippet itemviews/customsortfiltermodel/window.cpp 5
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 5
The sorting will be handled by the view. All we have to do is to
enable sorting for our proxy view by setting the
@@ -226,7 +226,7 @@
default). Then we add all the filtering widgets and the proxy view
to a layout that we install on a corresponding group box.
- \snippet itemviews/customsortfiltermodel/window.cpp 6
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 6
Finally, after putting our two group boxes into another layout
that we install on our main application widget, we customize the
@@ -236,7 +236,7 @@
function, calling the \c Window::setSourceModel() function to make
the application use it:
- \snippet itemviews/customsortfiltermodel/window.cpp 7
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 7
The QSortFilterProxyModel::setSourceModel() function makes the
proxy model process the data in the given model, in this case out
@@ -245,7 +245,7 @@
model for the view to present. Note that the latter function will
also create and set a new selection model.
- \snippet itemviews/customsortfiltermodel/window.cpp 8
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 8
The \c textFilterChanged() function is called whenever the user
changes the filter pattern or the case sensitivity.
@@ -261,7 +261,7 @@
{QSortFilterProxyModel::}{setFilterRegExp()} function also updates
the model.
- \snippet itemviews/customsortfiltermodel/window.cpp 9
+ \snippet widgets/itemviews/customsortfiltermodel/window.cpp 9
The \c dateFilterChanged() function is called whenever the user
modifies the range of valid dates. We retrieve the new dates from
@@ -276,7 +276,7 @@
model by creating the model in the \c main () function. First we
create the application, then we create the source model:
- \snippet itemviews/customsortfiltermodel/main.cpp 0
+ \snippet widgets/itemviews/customsortfiltermodel/main.cpp 0
The \c createMailModel() function is a convenience function
provided to simplify the constructor. All it does is to create and
diff --git a/examples/widgets/doc/deform.qdoc b/examples/widgets/doc/deform.qdoc
index 8195f90ffa..2f224a4da3 100644
--- a/examples/widgets/doc/deform.qdoc
+++ b/examples/widgets/doc/deform.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/deform
+ \example widgets/painting/deform
\title Vector Deformation
This example shows how to use advanced vector techniques to draw text
diff --git a/examples/widgets/doc/diagramscene.qdoc b/examples/widgets/doc/diagramscene.qdoc
index b61a936d52..81901afc05 100644
--- a/examples/widgets/doc/diagramscene.qdoc
+++ b/examples/widgets/doc/diagramscene.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/diagramscene
+ \example widgets/graphicsview/diagramscene
\title Diagram Scene Example
This example shows use of Qt's graphics framework.
@@ -84,7 +84,7 @@
\section1 MainWindow Class Definition
- \snippet graphicsview/diagramscene/mainwindow.h 0
+ \snippet widgets/graphicsview/diagramscene/mainwindow.h 0
The \c MainWindow class creates and lays out the widgets in a
QMainWindow. The class forwards input from the widgets to the
@@ -101,7 +101,7 @@
We start with a look at the constructor:
- \snippet graphicsview/diagramscene/mainwindow.cpp 0
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 0
In the constructor we call methods to create the widgets and
layouts of the example before we create the diagram scene.
@@ -120,7 +120,7 @@
high level of detail as it does not deal with graphics framework
specific functionality. Here is its implementation:
- \snippet graphicsview/diagramscene/mainwindow.cpp 21
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 21
This part of the function sets up the tabbed widget item that
contains the flowchart shapes. An exclusive QButtonGroup always
@@ -134,14 +134,14 @@
The buttons of the background tabbed widget item is set up in the
same way, so we skip to the creation of the tool box:
- \snippet graphicsview/diagramscene/mainwindow.cpp 22
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 22
We set the preferred size of the toolbox as its maximum. This
way, more space is given to the graphics view.
Here is the \c createActions() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 23
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 23
We show an example of the creation of an action. The
functionality the actions trigger is discussed in the slots we
@@ -151,7 +151,7 @@
The is the \c createMenus() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 24
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 24
We create the three menus' of the example.
@@ -163,9 +163,9 @@
fillColorToolButton is created. This button lets the user select a
color for the diagram items.
- \snippet graphicsview/diagramscene/mainwindow.cpp 25
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 25
\dots
- \snippet graphicsview/diagramscene/mainwindow.cpp 26
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 26
We set the menu of the tool button with
\l{QToolButton::}{setMenu()}. We need the \c fillAction QAction
@@ -178,11 +178,11 @@
createColorToolButtonIcon() we create the icon for the button.
\dots
- \snippet graphicsview/diagramscene/mainwindow.cpp 27
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 27
Here is the \c createBackgroundCellWidget() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 28
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 28
This function creates \l{QWidget}s containing a tool button
and a label. The widgets created with this function are used for
@@ -190,7 +190,7 @@
Here is the \c createCellWidget() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 29
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 29
This function returns a QWidget containing a QToolButton with
an image of one of the \c DiagramItems, i.e., flowchart shapes.
@@ -203,7 +203,7 @@
Here is the \c createColorMenu() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 30
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 30
This function creates a color menu that is used as the
drop-down menu for the tool buttons in the \c colorToolBar. We
@@ -212,7 +212,7 @@
Here is the \c createColorToolButtonIcon() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 31
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 31
This function is used to create the QIcon of the \c
fillColorToolButton, \c fontColorToolButton, and \c
@@ -222,7 +222,7 @@
Here is the \c createColorIcon() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 32
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 32
This function creates an icon with a filled rectangle in the
color of \a color. It is used for creating icons for the color
@@ -231,7 +231,7 @@
Here is the \c backgroundButtonGroupClicked() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 1
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 1
In this function we set the QBrush that is used to draw the
background of the diagramscene. The background can be a grid of
@@ -245,7 +245,7 @@
Here is the implementation of \c buttonGroupClicked():
- \snippet graphicsview/diagramscene/mainwindow.cpp 2
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 2
This slot is called when a button in \c buttonGroup is checked.
When a button is checked the user can click on the graphics view
@@ -263,7 +263,7 @@
Here is the implementation of \c deleteItem():
- \snippet graphicsview/diagramscene/mainwindow.cpp 3
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 3
This slot deletes the selected item, if any, from the scene. It
deletes the arrows first in order to avoid to delete them twice. If
@@ -273,7 +273,7 @@
This is the implementation of pointerGroupClicked():
- \snippet graphicsview/diagramscene/mainwindow.cpp 4
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 4
The \c pointerTypeGroup decides whether the scene is in ItemMove
or InsertLine mode. This button group is exclusive, i.e., only
@@ -284,7 +284,7 @@
Here is the \c bringToFront() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 5
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 5
Several items may collide, i.e., overlap, with each other in
the scene. This slot is called when the user requests that an
@@ -299,7 +299,7 @@
Here is the \c sendToBack() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 6
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 6
This slot works in the same way as \c bringToFront() described
above, but sets a z-value that is lower than items the item that
@@ -307,7 +307,7 @@
This is the implementation of \c itemInserted():
- \snippet graphicsview/diagramscene/mainwindow.cpp 7
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 7
This slot is called from the \c DiagramScene when an item has been
added to the scene. We set the mode of the scene back to the mode
@@ -317,14 +317,14 @@
Here is the implementation of \c textInserted():
- \snippet graphicsview/diagramscene/mainwindow.cpp 8
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 8
We simply set the mode of the scene back to the mode it had before
the text was inserted.
Here is the \c currentFontChanged() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 9
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 9
When the user requests a font change, by using one of the
widgets in the \c fontToolBar, we create a new QFont object and
@@ -333,7 +333,7 @@
Here is the \c fontSizeChanged() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 10
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 10
When the user requests a font change, by using one of the
widgets in the \c fontToolBar, we create a new QFont object and
@@ -342,7 +342,7 @@
Here is the implementation of \c sceneScaleChanged():
- \snippet graphicsview/diagramscene/mainwindow.cpp 11
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 11
The user can increase or decrease the scale, with the \c
sceneScaleCombo, the scene is drawn in.
@@ -351,7 +351,7 @@
Here is the \c textColorChanged() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 12
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 12
This slot is called when an item in the drop-down menu of the \c
fontColorToolButton is pressed. We need to change the icon on
@@ -362,7 +362,7 @@
Here is the \c itemColorChanged() implementation:
- \snippet graphicsview/diagramscene/mainwindow.cpp 13
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 13
This slot handles requests for changing the color of \c
DiagramItems in the same manner as \c textColorChanged() does for
@@ -370,7 +370,7 @@
Here is the implementation of \c lineColorChanged():
- \snippet graphicsview/diagramscene/mainwindow.cpp 14
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 14
This slot handles requests for changing the color of \c Arrows in
the same manner that \c textColorChanged() does it for \c
@@ -378,7 +378,7 @@
Here is the \c textButtonTriggered() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 15
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 15
\c textAction points to the QAction of the currently selected menu item
in the \c fontColorToolButton's color drop-down menu. We have set
@@ -388,7 +388,7 @@
Here is the \c fillButtonTriggered() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 16
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 16
\c fillAction points to the selected menu item in the drop-down
menu of \c fillColorToolButton(). We can therefore use the data of
@@ -396,7 +396,7 @@
Here is the \c lineButtonTriggered() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 17
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 17
\c lineAction point to the selected item in the drop-down menu of
\c lineColorToolButton. We use its data when we set the arrow
@@ -404,7 +404,7 @@
Here is the \c handleFontChange() function:
- \snippet graphicsview/diagramscene/mainwindow.cpp 18
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 18
\c handleFontChange() is called when any of the widgets that show
font properties changes. We create a new QFont object and set its
@@ -414,7 +414,7 @@
Here is the \c itemSelected() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 19
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 19
This slot is called when an item in the \c DiagramScene is
selected. In the case of this example it is only text items that
@@ -426,7 +426,7 @@
This is the \c about() slot:
- \snippet graphicsview/diagramscene/mainwindow.cpp 20
+ \snippet widgets/graphicsview/diagramscene/mainwindow.cpp 20
This slot displays an about box for the example when the user
selects the about menu item from the help menu.
@@ -439,7 +439,7 @@
class.
- \snippet graphicsview/diagramscene/diagramscene.h 0
+ \snippet widgets/graphicsview/diagramscene/diagramscene.h 0
In the \c DiagramScene a mouse click can give three different
actions: the item under the mouse can be moved, an item may be
@@ -465,7 +465,7 @@
We start with the constructor:
- \snippet graphicsview/diagramscene/diagramscene.cpp 0
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 0
The scene uses \c myItemMenu to set the context menu when it
creates \c DiagramItems. We set the default mode to \c
@@ -474,7 +474,7 @@
Here is the \c setLineColor() function:
- \snippet graphicsview/diagramscene/diagramscene.cpp 1
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 1
The \c isItemChange function returns true if an \c Arrow item is
selected in the scene in which case we want to change its color.
@@ -483,14 +483,14 @@
Here is the \c setTextColor() function:
- \snippet graphicsview/diagramscene/diagramscene.cpp 2
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 2
This function sets the color of \c DiagramTextItems equal to the
way \c setLineColor() sets the color of \c Arrows.
Here is the \c setItemColor() function:
- \snippet graphicsview/diagramscene/diagramscene.cpp 3
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 3
This function sets the color the scene will use when creating
\c DiagramItems. It also changes the color of a selected \c
@@ -498,14 +498,14 @@
This is the implementation of \c setFont():
- \snippet graphicsview/diagramscene/diagramscene.cpp 4
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 4
Set the font to use for new and selected, if a text item is
selected, \c DiagramTextItems.
This is the implementation of \c editorLostFocus() slot:
- \snippet graphicsview/diagramscene/diagramscene.cpp 5
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 5
\c DiagramTextItems emit a signal when they loose focus, which is
connected to this slot. We remove the item if it has no text.
@@ -516,13 +516,13 @@
different depending on which mode the \c DiagramScene is in. We
examine its implementation for each mode:
- \snippet graphicsview/diagramscene/diagramscene.cpp 6
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 6
We simply create a new \c DiagramItem and add it to the scene at
the position the mouse was pressed. Note that the origin of its
local coordinate system will be under the mouse pointer position.
- \snippet graphicsview/diagramscene/diagramscene.cpp 7
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 7
The user adds \c Arrows to the scene by stretching a line between
the items the arrow should connect. The start of the line is fixed
@@ -533,7 +533,7 @@
We will see how this is implemented later; here we simply add the
line.
- \snippet graphicsview/diagramscene/diagramscene.cpp 8
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 8
The \c DiagramTextItem is editable when the
Qt::TextEditorInteraction flag is set, else it is movable by the
@@ -541,7 +541,7 @@
items in the scene, so we set the value to a number higher
than other items in the scene.
- \snippet graphicsview/diagramscene/diagramscene.cpp 9
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 9
We are in MoveItem mode if we get to the default switch; we
can then call the QGraphicsScene implementation, which
@@ -553,7 +553,7 @@
This is the \c mouseMoveEvent() function:
- \snippet graphicsview/diagramscene/diagramscene.cpp 10
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 10
We must draw the line if we are in InsertMode and the mouse button
is pressed down (the line is not 0). As discussed in \c
@@ -566,14 +566,14 @@
In the \c mouseReleaseEvent() function we need to check if an arrow
should be added to the scene:
- \snippet graphicsview/diagramscene/diagramscene.cpp 11
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 11
First we need to get the items (if any) under the line's start
and end points. The line itself is the first item at these points,
so we remove it from the lists. As a precaution, we check if the
lists are empty, but this should never happen.
- \snippet graphicsview/diagramscene/diagramscene.cpp 12
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 12
Now we check if there are two different \c DiagramItems under
the lines start and end points. If there are we can create an \c
@@ -582,11 +582,11 @@
and end points to the items. We set the z-value of the arrow to
-1000.0 because we always want it to be drawn under the items.
- \snippet graphicsview/diagramscene/diagramscene.cpp 13
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 13
Here is the \c isItemChange() function:
- \snippet graphicsview/diagramscene/diagramscene.cpp 14
+ \snippet widgets/graphicsview/diagramscene/diagramscene.cpp 14
The scene has single selection, i.e., only one item can be
selected at any given time. The foreach will then loop one time
@@ -597,7 +597,7 @@
\section1 DiagramItem Class Definition
- \snippet graphicsview/diagramscene/diagramitem.h 0
+ \snippet widgets/graphicsview/diagramscene/diagramitem.h 0
The \c DiagramItem represents a flowchart shape in the \c
DiagramScene. It inherits QGraphicsPolygonItem and has a polygon
@@ -622,7 +622,7 @@
We start with a look at the constructor:
- \snippet graphicsview/diagramscene/diagramitem.cpp 0
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 0
In the constructor we create the items polygon according to
\a diagramType. \l{QGraphicsItem}s are not movable or selectable
@@ -630,7 +630,7 @@
Here is the \c removeArrow() function:
- \snippet graphicsview/diagramscene/diagramitem.cpp 1
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 1
\c removeArrow() is used to remove \c Arrow items when they
or \c DiagramItems they are connected to are removed from the
@@ -638,7 +638,7 @@
Here is the \c removeArrows() function:
- \snippet graphicsview/diagramscene/diagramitem.cpp 2
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 2
This function is called when the item is removed from the scene
and removes all arrows that are connected to this item. The arrow
@@ -647,13 +647,13 @@
Here is the \c addArrow() function:
- \snippet graphicsview/diagramscene/diagramitem.cpp 3
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 3
This function simply adds the \a arrow to the items \c arrows list.
Here is the \c image() function:
- \snippet graphicsview/diagramscene/diagramitem.cpp 4
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 4
This function draws the polygon of the item onto a QPixmap. In
this example we use this to create icons for the tool buttons in
@@ -661,7 +661,7 @@
Here is the \c contextMenuEvent() function:
- \snippet graphicsview/diagramscene/diagramitem.cpp 5
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 5
We show the context menu. As right mouse clicks, which shows the
menu, don't select items by default we set the item selected with
@@ -671,7 +671,7 @@
This is the implementation of \c itemChange():
- \snippet graphicsview/diagramscene/diagramitem.cpp 6
+ \snippet widgets/graphicsview/diagramscene/diagramitem.cpp 6
If the item has moved, we need to update the positions of the
arrows connected to it. The implementation of QGraphicsItem does
@@ -686,7 +686,7 @@
DiagramTextItem the editing starts with a double click leaving
single click available to interact with and move it.
- \snippet graphicsview/diagramscene/diagramtextitem.h 0
+ \snippet widgets/graphicsview/diagramscene/diagramtextitem.h 0
We use \c itemChange() and \c focusOutEvent() to notify the
\c DiagramScene when the text item loses focus and gets selected.
@@ -698,14 +698,14 @@
We start with the constructor:
- \snippet graphicsview/diagramscene/diagramtextitem.cpp 0
+ \snippet widgets/graphicsview/diagramscene/diagramtextitem.cpp 0
We simply set the item movable and selectable, as these flags are
off by default.
Here is the \c itemChange() function:
- \snippet graphicsview/diagramscene/diagramtextitem.cpp 1
+ \snippet widgets/graphicsview/diagramscene/diagramtextitem.cpp 1
When the item is selected we emit the selectedChanged signal. The
\c MainWindow uses this signal to update the widgets that display
@@ -713,7 +713,7 @@
Here is the \c focusOutEvent() function:
- \snippet graphicsview/diagramscene/diagramtextitem.cpp 2
+ \snippet widgets/graphicsview/diagramscene/diagramtextitem.cpp 2
\c DiagramScene uses the signal emitted when the text item looses
focus to remove the item if it is empty, i.e., it contains no
@@ -721,7 +721,7 @@
This is the implementation of \c mouseDoubleClickEvent():
- \snippet graphicsview/diagramscene/diagramtextitem.cpp 5
+ \snippet widgets/graphicsview/diagramscene/diagramtextitem.cpp 5
When we receive a double click event, we make the item editable by calling
QGraphicsTextItem::setTextInteractionFlags(). We then forward the
@@ -736,7 +736,7 @@
selections. The class inherits QGraphicsLine item, and draws the
arrowhead and moves with the items it connects.
- \snippet graphicsview/diagramscene/arrow.h 0
+ \snippet widgets/graphicsview/diagramscene/arrow.h 0
The item's color can be set with \c setColor().
@@ -757,14 +757,14 @@
The constructor of the \c Arrow class looks like this:
- \snippet graphicsview/diagramscene/arrow.cpp 0
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 0
We set the start and end diagram items of the arrow. The arrow
head will be drawn where the line intersects the end item.
Here is the \c boundingRect() function:
- \snippet graphicsview/diagramscene/arrow.cpp 1
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 1
We need to reimplement this function because the arrow is
larger than the bounding rectangle of the QGraphicsLineItem. The
@@ -773,7 +773,7 @@
Here is the \c shape() function:
- \snippet graphicsview/diagramscene/arrow.cpp 2
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 2
The shape function returns a QPainterPath that is the exact
shape of the item. The QGraphicsLineItem::shape() returns a path
@@ -783,14 +783,14 @@
Here is the \c updatePosition() slot:
- \snippet graphicsview/diagramscene/arrow.cpp 3
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 3
This slot updates the arrow by setting the start and end
points of its line to the center of the items it connects.
Here is the \c paint() function:
- \snippet graphicsview/diagramscene/arrow.cpp 4
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 4
If the start and end items collide we do not draw the arrow; the
algorithm we use to find the point the arrow should be drawn at
@@ -798,7 +798,7 @@
We first set the pen and brush we will use for drawing the arrow.
- \snippet graphicsview/diagramscene/arrow.cpp 5
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 5
We then need to find the position at which to draw the
arrowhead. The head should be drawn where the line and the end
@@ -811,7 +811,7 @@
We must therefore add the position of the end item to make the
coordinates relative to the scene.
- \snippet graphicsview/diagramscene/arrow.cpp 6
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 6
We calculate the angle between the x-axis and the line of the
arrow. We need to turn the arrow head to this angle so that it
@@ -824,7 +824,7 @@
clear the \c arrowHead polygon from the previous calculated arrow
head and set these new points.
- \snippet graphicsview/diagramscene/arrow.cpp 7
+ \snippet widgets/graphicsview/diagramscene/arrow.cpp 7
If the line is selected, we draw two dotted lines that are
parallel with the line of the arrow. We do not use the default
diff --git a/examples/widgets/doc/digitalclock.qdoc b/examples/widgets/doc/digitalclock.qdoc
index 92e8003205..0597f80670 100644
--- a/examples/widgets/doc/digitalclock.qdoc
+++ b/examples/widgets/doc/digitalclock.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/digitalclock
+ \example widgets/widgets/digitalclock
\title Digital Clock Example
The Digital Clock example shows how to use QLCDNumber to display a
@@ -44,11 +44,11 @@
and implement a private slot called \c showTime() to update the clock
display:
- \snippet widgets/digitalclock/digitalclock.h 0
+ \snippet widgets/widgets/digitalclock/digitalclock.h 0
\section1 DigitalClock Class Implementation
- \snippet widgets/digitalclock/digitalclock.cpp 0
+ \snippet widgets/widgets/digitalclock/digitalclock.cpp 0
In the constructor, we first change the look of the LCD numbers. The
QLCDNumber::Filled style produces raised segments filled with the
@@ -59,8 +59,8 @@
call the \c showTime() slot; without this call, there would be a one-second
delay at startup before the time is shown.
- \snippet widgets/digitalclock/digitalclock.cpp 1
- \snippet widgets/digitalclock/digitalclock.cpp 2
+ \snippet widgets/widgets/digitalclock/digitalclock.cpp 1
+ \snippet widgets/widgets/digitalclock/digitalclock.cpp 2
The \c showTime() slot is called whenever the clock display needs
to be updated.
diff --git a/examples/widgets/doc/dirview.qdoc b/examples/widgets/doc/dirview.qdoc
index a4b799678a..ddd9b8a0ad 100644
--- a/examples/widgets/doc/dirview.qdoc
+++ b/examples/widgets/doc/dirview.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/dirview
+ \example widgets/itemviews/dirview
\title Dir View Example
The Dir View example shows a tree view onto the local filing system. It uses the
diff --git a/examples/widgets/doc/dockwidgets.qdoc b/examples/widgets/doc/dockwidgets.qdoc
index 12f18a538f..b4874caad0 100644
--- a/examples/widgets/doc/dockwidgets.qdoc
+++ b/examples/widgets/doc/dockwidgets.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/dockwidgets
+ \example widgets/mainwindows/dockwidgets
\title Dock Widgets Example
The Dock Widgets example shows how to add dock windows to an
@@ -46,13 +46,13 @@
Here's the class definition:
- \snippet mainwindows/dockwidgets/mainwindow.h 0
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.h 0
We will now review each function in turn.
\section1 MainWindow Class Implementation
- \snippet mainwindows/dockwidgets/mainwindow.cpp 0
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 0
We start by including \c <QtGui>, a header file that contains the
definition of all classes in the \l QtCore and \l QtGui
@@ -60,7 +60,7 @@
every class individually and is especially convenient if we add new
widgets. We also include \c mainwindow.h.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 1
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 1
In the constructor, we start by creating a QTextEdit widget. Then we call
QMainWindow::setCentralWidget(). This function passes ownership of
@@ -77,7 +77,7 @@
createToolBars(), and \c createStatusBar() functions since they
follow the same pattern as all the other Qt examples.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 9
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 9
We create the customers dock window first, and in addition to a
window title, we also pass it a \c this pointer so that it becomes a
@@ -109,7 +109,7 @@
We briefly discuss the rest of the implementation, but have now
covered everything relating to dock windows.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 2
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 2
In this function we clear the QTextEdit so that it is empty. Next we
create a QTextCursor on the QTextEdit. We move the cursor to the
@@ -120,7 +120,7 @@
insert the skeleton of the letter including two markers \c NAME and
\c ADDRESS. We will also use the \c{Yours sincerely,} text as a marker.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 6
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 6
If the user clicks a customer we split the customer details into
pieces. We then look for the \c NAME marker using the \c find()
@@ -133,7 +133,7 @@
operation by the QTextEdit, so a single undo will revert all the
insertions.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 7
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 7
This function works in a similar way to \c insertCustomer(). First
we look for the marker, in this case, \c {Yours sincerely,}, and then
@@ -141,19 +141,19 @@
we use a \c beginEditBlock() ... \c endEditBlock() pair so that the
insertion can be undone as a single operation.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 3
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 3
Qt's QTextDocument class makes printing documents easy. We simply
take the QTextEdit's QTextDocument, set up the printer and print the
document.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 4
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 4
QTextEdit can output its contents in HTML format, so we prompt the
user for the name of an HTML file and if they provide one we simply
write the QTextEdit's contents in HTML format to the file.
- \snippet mainwindows/dockwidgets/mainwindow.cpp 5
+ \snippet widgets/mainwindows/dockwidgets/mainwindow.cpp 5
If the focus is in the QTextEdit, pressing \uicontrol Ctrl+Z undoes as
expected. But for the user's convenience we provide an
diff --git a/examples/widgets/doc/dragdroprobot.qdoc b/examples/widgets/doc/dragdroprobot.qdoc
index 60bd4eb4d8..30ca8e6b0d 100644
--- a/examples/widgets/doc/dragdroprobot.qdoc
+++ b/examples/widgets/doc/dragdroprobot.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/dragdroprobot
+ \example widgets/graphicsview/dragdroprobot
\title Drag and Drop Robot Example
The Drag and Drop Robot example shows how to implement Drag and Drop in a
@@ -63,7 +63,7 @@
Let's start with the \c RobotPart class declaration.
- \snippet graphicsview/dragdroprobot/robot.h 0
+ \snippet widgets/graphicsview/dragdroprobot/robot.h 0
This base class inherits QGraphicsObject. QGraphicsObject provides signals
and slots through inheriting QObject, and it also declares QGraphicsItem's
@@ -80,7 +80,7 @@
variable, which we will use later to indicate visually that the limb can
accept colors that are is dragged onto it.
- \snippet graphicsview/dragdroprobot/robot.cpp 0
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 0
\c RobotPart's constructor initializes the dragOver member and sets the
color to Qt::lightGray. In the constructor body we enable support for
@@ -89,7 +89,7 @@
The rest of this class's implementation is to support Drag and Drop.
- \snippet graphicsview/dragdroprobot/robot.cpp 1
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 1
The \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()} handler is called
when a Drag and Drop element is dragged into the robot part's area.
@@ -102,7 +102,7 @@
visual feedback to the user; otherwise the event is ignored, which in turn
allows the event to propagate to parent elements.
- \snippet graphicsview/dragdroprobot/robot.cpp 2
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 2
The \l{QGraphicsItem::dragLeaveEvent()}{dragLeaveEvent()} handler is called
when a Drag and Drop element is dragged away from the robot part's area.
@@ -110,7 +110,7 @@
\l{QGraphicsItem::update()}{update()} to help provide visual feedback that
the drag has left this item.
- \snippet graphicsview/dragdroprobot/robot.cpp 3
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 3
The \l{QGraphicsItem::dropEvent()}{dropEvent()} handler is called when a
Drag and Drop element is dropped onto an item (i.e., when the mouse button
@@ -124,7 +124,7 @@
as this class has one minor difference, and leave the other classes as an
exercise for the reader.
- \snippet graphicsview/dragdroprobot/robot.h 1
+ \snippet widgets/graphicsview/dragdroprobot/robot.h 1
The \c RobotHead class inherits \c RobotPart and provides the necessary
implementations of \l{QGraphicsItem::boundingRect()}{boundingRect()} and
@@ -135,12 +135,12 @@
The class contains a private pixmap member that we can use to implement
support for accepting image drops.
- \snippet graphicsview/dragdroprobot/robot.cpp 4
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 4
\c RobotHead has a rather plain constructor that simply forwards to
\c RobotPart's constructor.
- \snippet graphicsview/dragdroprobot/robot.cpp 5
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 5
The \l{QGraphicsItem::boundingRect()}{boundingRect()} reimplementation
returns the extents for the head. Because we want the center of rotation to
@@ -149,7 +149,7 @@
rotating the head, the "neck" will stay still while the top of the head
tilts from side to side.
- \snippet graphicsview/dragdroprobot/robot.cpp 6
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 6
In \l{QGraphicsItem::paint()}{paint()} we draw the actual head. The
implementation is split into two sections; if an image has been dropped
@@ -160,7 +160,7 @@
can often be faster to draw the head as an image rather than using a
sequence of vector operations.
- \snippet graphicsview/dragdroprobot/robot.cpp 7
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 7
The robot head can accept image drops. In order to support this, its
reimplementation of \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()}
@@ -168,7 +168,7 @@
event is accepted. Otherwise we fall back to the base \c RobotPart
implementation.
- \snippet graphicsview/dragdroprobot/robot.cpp 8
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 8
To follow up on image support, we must also implement
\l{QGraphicsItem::dropEvent()}{dropEvent()}. We check if the drag object
@@ -180,21 +180,21 @@
\c RobotTorso and \c RobotLimb are similar to \c RobotHead, so let's
skip directly to the \c Robot class.
- \snippet graphicsview/dragdroprobot/robot.h 4
+ \snippet widgets/graphicsview/dragdroprobot/robot.h 4
The \c Robot class also inherits \c RobotPart, and like the other parts it
also implements \l{QGraphicsItem::boundingRect()}{boundingRect()} and
\l{QGraphicsItem::paint()}{paint()}. It provides a rather special
implementation, though:
- \snippet graphicsview/dragdroprobot/robot.cpp 9
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 9
Because the \c Robot class is only used as a base node for the rest of the
robot, it has no visual representation. Its
\l{QGraphicsItem::boundingRect()}{boundingRect()} implementation can
therefore return a null QRectF, and its paint() function does nothing.
- \snippet graphicsview/dragdroprobot/robot.cpp 10
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 10
The constructor starts by setting the flag
\l{QGraphicsItem::ItemHasNoContents}{ItemHasNoContents}, which is a minor
@@ -208,13 +208,13 @@
the head a child of the torso; if you rotate the torso, the head will
follow. The same pattern is applied to the rest of the limbs.
- \snippet graphicsview/dragdroprobot/robot.cpp 11
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 11
Each robot part is carefully positioned. For example, the upper left arm is
moved precisely to the top-left area of the torso, and the upper right arm
is moved to the top-right area.
- \snippet graphicsview/dragdroprobot/robot.cpp 12
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 12
The next section creates all animation objects. This snippet shows the two
animations that operate on the head's scale and rotation. The two
@@ -226,7 +226,7 @@
The rest of the animations are defined in a similar way.
- \snippet graphicsview/dragdroprobot/robot.cpp 13
+ \snippet widgets/graphicsview/dragdroprobot/robot.cpp 13
Finally we set an easing curve and duration on each animation, ensure the
toplevel animation group loops forever, and start the toplevel animation.
@@ -236,7 +236,7 @@
The \c ColorItem class represents a circular item that can be pressed to
drag colors onto robot parts.
- \snippet graphicsview/dragdroprobot/coloritem.h 0
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.h 0
This class is very simple. It does not use animations, and has no need for
properties nor signals and slots, so to save resources, it's most natural
@@ -252,7 +252,7 @@
Let's take a look at its implementation.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 0
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 0
\c ColorItem's constructor assigns an opaque random color to its color
member by making use of qrand(). For improved usability, it assigns a
@@ -266,7 +266,7 @@
mouse event handlers greatly, as we can always assume that only the left
mouse button is pressed and released.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 1
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 1
The item's bounding rect is a fixed 30x30 units centered around the item's
origin (0, 0), and adjusted by 0.5 units in all directions to allow a
@@ -274,19 +274,19 @@
also compensate with a few units down and to the right to make room
for a simple dropshadow.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 2
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 2
The \l{QGraphicsItem::paint()}{paint()} implementation draws an ellipse
with a 1-unit black outline, a plain color fill, and a dark gray
dropshadow.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 3
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 3
The \l{QGraphicsItem::mousePressEvent()}{mousePressEvent()} handler is
called when you press the mouse button inside the item's area. Our
implementation simply sets the cursor to Qt::ClosedHandCursor.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 4
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 4
The \l{QGraphicsItem::mouseReleaseEvent()}{mouseReleaseEvent()} handler is
called when you release the mouse button after having pressed it inside an
@@ -296,7 +296,7 @@
the cursor changes to an open hand. Pressing the item will show a closed
hand cursor. Releasing will restore to an open hand cursor again.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 5
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 5
The \l{QGraphicsItem::mouseMoveEvent()}{mouseMoveEvent()} handler is called
when you move the mouse around after pressing the mouse button inside the
@@ -313,20 +313,20 @@
the right time. We also create a QMimeData instance that can contain our
color or image data, and assign this to the drag object.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 6
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 6
This snippet has a somewhat random outcome: once in a while, a special
image is assigned to the drag object's mime data. The pixmap is also
assiged as the drag object's pixmap. This will ensure that you can see the
image that is being dragged as a pixmap under the mouse cursor.
- \snippet graphicsview/dragdroprobot/coloritem.cpp 7
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 7
Otherwise, and this is the most common outcome, a simple color is assigned
to the drag object's mime data. We render this \c ColorItem into a new
pixmap to give the user visual feedback that the color is being "dragged".
- \snippet graphicsview/dragdroprobot/coloritem.cpp 8
+ \snippet widgets/graphicsview/dragdroprobot/coloritem.cpp 8
Finally we execute the drag. QDrag::exec() will reenter the event loop, and
only exit if the drag has either been dropped, or canceled. In any case we
@@ -337,13 +337,13 @@
Now that the \c Robot and \c ColorItem classes are complete, we can put all
the pieces together inside the main() function.
- \snippet graphicsview/dragdroprobot/main.cpp 0
+ \snippet widgets/graphicsview/dragdroprobot/main.cpp 0
We start off by constructing QApplication, and initializing the random
number generator. This ensures that the color items have different colors
every time the application starts.
- \snippet graphicsview/dragdroprobot/main.cpp 1
+ \snippet widgets/graphicsview/dragdroprobot/main.cpp 1
We construct a fixed size scene, and create 10 \c ColorItem instances
arranged in a circle. Each item is added to the scene.
@@ -351,7 +351,7 @@
In the center of this circle we create one \c Robot instance. The
robot is scaled and moved up a few units. It is then added to the scene.
- \snippet graphicsview/dragdroprobot/main.cpp 2
+ \snippet widgets/graphicsview/dragdroprobot/main.cpp 2
Finally we create a QGraphicsView window, and assign the scene to it.
diff --git a/examples/widgets/doc/dynamiclayouts.qdoc b/examples/widgets/doc/dynamiclayouts.qdoc
index 318f719503..1c5f737aba 100644
--- a/examples/widgets/doc/dynamiclayouts.qdoc
+++ b/examples/widgets/doc/dynamiclayouts.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example layouts/dynamiclayouts
+ \example widgets/layouts/dynamiclayouts
\title Dynamic Layouts Example
The Dynamic Layouts example shows how to move widgets around in
diff --git a/examples/widgets/doc/easing.qdoc b/examples/widgets/doc/easing.qdoc
index 7fb7f59531..6bcda2ddb9 100644
--- a/examples/widgets/doc/easing.qdoc
+++ b/examples/widgets/doc/easing.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/easing
+ \example widgets/animation/easing
\title Easing Curves Example
The Easing Curves example shows how to use easing curves to
diff --git a/examples/widgets/doc/editabletreemodel.qdoc b/examples/widgets/doc/editabletreemodel.qdoc
index 24745b77b8..3782ebf24e 100644
--- a/examples/widgets/doc/editabletreemodel.qdoc
+++ b/examples/widgets/doc/editabletreemodel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/editabletreemodel
+ \example widgets/itemviews/editabletreemodel
\title Editable Tree Model Example
This example shows how to implement a simple item-based tree model that can
@@ -234,7 +234,7 @@
pieces of data, and which can provide information about their parent
and child items:
- \snippet itemviews/editabletreemodel/treeitem.h 0
+ \snippet widgets/itemviews/editabletreemodel/treeitem.h 0
We have designed the API to be similar to that provided by
QAbstractItemModel by giving each item functions to return the number
@@ -251,7 +251,7 @@
Each \c TreeItem is constructed with a list of data and an optional
parent item:
- \snippet itemviews/editabletreemodel/treeitem.cpp 0
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 0
Initially, each item has no children. These are added to the item's
internal \c childItems member using the \c insertChildren() function
@@ -260,29 +260,29 @@
The destructor ensures that each child added to the item is deleted
when the item itself is deleted:
- \snippet itemviews/editabletreemodel/treeitem.cpp 1
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 1
\target TreeItem::parent
Since each item stores a pointer to its parent, the \c parent() function
is trivial:
- \snippet itemviews/editabletreemodel/treeitem.cpp 9
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 9
\target TreeItem::child
Three functions provide information about the children of an item.
\c child() returns a specific child from the internal list of children:
- \snippet itemviews/editabletreemodel/treeitem.cpp 2
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 2
The \c childCount() function returns the total number of children:
- \snippet itemviews/editabletreemodel/treeitem.cpp 3
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 3
The \c childNumber() function is used to determine the index of the child
in its parent's list of children. It accesses the parent's \c childItems
member directly to obtain this information:
- \snippet itemviews/editabletreemodel/treeitem.cpp 4
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 4
The root item has no parent item; for this item, we return zero to be
consistent with the other items.
@@ -290,20 +290,20 @@
The \c columnCount() function simply returns the number of elements in
the internal \c itemData list of QVariant objects:
- \snippet itemviews/editabletreemodel/treeitem.cpp 5
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 5
\target TreeItem::data
Data is retrieved using the \c data() function, which accesses the
appropriate element in the \c itemData list:
- \snippet itemviews/editabletreemodel/treeitem.cpp 6
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 6
\target TreeItem::setData
Data is set using the \c setData() function, which only stores values
in the \c itemData list for valid list indexes, corresponding to column
values in the model:
- \snippet itemviews/editabletreemodel/treeitem.cpp 11
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 11
To make implementation of the model easier, we return true to indicate
whether the data was set successfully, or false if an invalid column
@@ -313,20 +313,20 @@
in the model leads to the insertion of new child items in the corresponding
item, handled by the \c insertChildren() function:
- \snippet itemviews/editabletreemodel/treeitem.cpp 7
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 7
This ensures that new items are created with the required number of columns
and inserted at a valid position in the internal \c childItems list.
Items are removed with the \c removeChildren() function:
- \snippet itemviews/editabletreemodel/treeitem.cpp 10
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 10
As discussed above, the functions for inserting and removing columns are
used differently to those for inserting and removing child items because
they are expected to be called on every item in the tree. We do this by
recursively calling this function on each child of the item:
- \snippet itemviews/editabletreemodel/treeitem.cpp 8
+ \snippet widgets/itemviews/editabletreemodel/treeitem.cpp 8
\section1 TreeModel Class Definition
@@ -334,16 +334,16 @@
class, exposing the necessary interface for a model that can be edited and
resized.
- \snippet itemviews/editabletreemodel/treemodel.h 0
+ \snippet widgets/itemviews/editabletreemodel/treemodel.h 0
The constructor and destructor are specific to this model.
- \snippet itemviews/editabletreemodel/treemodel.h 1
+ \snippet widgets/itemviews/editabletreemodel/treemodel.h 1
Read-only tree models only need to provide the above functions. The
following public functions provide support for editing and resizing:
- \snippet itemviews/editabletreemodel/treemodel.h 2
+ \snippet widgets/itemviews/editabletreemodel/treemodel.h 2
To simplify this example, the data exposed by the model is organized into
a data structure by the model's \l{TreeModel::setupModelData}{setupModelData()}
@@ -355,7 +355,7 @@
The constructor creates a root item and initializes it with the header
data supplied:
- \snippet itemviews/editabletreemodel/treemodel.cpp 0
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 0
We call the internal \l{TreeModel::setupModelData}{setupModelData()}
function to convert the textual data supplied to a data structure we can
@@ -365,7 +365,7 @@
The destructor only has to delete the root item; all child items will
be recursively deleted by the \c TreeItem destructor.
- \snippet itemviews/editabletreemodel/treemodel.cpp 1
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 1
\target TreeModel::getItem
Since the model's interface to the other model/view components is based
@@ -375,7 +375,7 @@
consistency, we have defined a \c getItem() function to perform this
repetitive task:
- \snippet itemviews/editabletreemodel/treemodel.cpp 4
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 4
This function assumes that each model index it is passed corresponds to
a valid item in memory. If the index is invalid, or its internal pointer
@@ -385,13 +385,13 @@
\c getItem() function to obtain the relevant item, then returns the
number of children it contains:
- \snippet itemviews/editabletreemodel/treemodel.cpp 8
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 8
By contrast, the \c columnCount() implementation does not need to look
for a particular item because all items are defined to have the same
number of columns associated with them.
- \snippet itemviews/editabletreemodel/treemodel.cpp 2
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 2
As a result, the number of columns can be obtained directly from the root
item.
@@ -401,7 +401,7 @@
the Qt::ItemIsEditable and Qt::ItemIsSelectable flags as well as
Qt::ItemIsEnabled:
- \snippet itemviews/editabletreemodel/treemodel.cpp 3
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 3
\target TreeModel::index
The model needs to be able to generate model indexes to allow other
@@ -409,7 +409,7 @@
is performed by the \c index() function, which is used to obtain model
indexes corresponding to children of a given parent item:
- \snippet itemviews/editabletreemodel/treemodel.cpp 5
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 5
In this model, we only return model indexes for child items if the parent
index is invalid (corresponding to the root item) or if it has a zero
@@ -419,7 +419,7 @@
a \c TreeItem instance that corresponds to the model index supplied, and
request its child item that corresponds to the specified row.
- \snippet itemviews/editabletreemodel/treemodel.cpp 6
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 6
Since each item contains information for an entire row of data, we create
a model index to uniquely identify it by calling
@@ -436,7 +436,7 @@
then creating a model index to represent the parent. (See
\l{Relating-items-using-model-indexes}{the above diagram}).
- \snippet itemviews/editabletreemodel/treemodel.cpp 7
+ \snippet widgets/itemviews/editabletreemodel/treemodel.cpp 7
Items without parents, including the root item, are handled by returning
a null model index. Otherwise, a model index is created and returned as
diff --git a/examples/widgets/doc/elasticnodes.qdoc b/examples/widgets/doc/elasticnodes.qdoc
index 17f14124f8..df993a95c3 100644
--- a/examples/widgets/doc/elasticnodes.qdoc
+++ b/examples/widgets/doc/elasticnodes.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/elasticnodes
+ \example widgets/graphicsview/elasticnodes
\title Elastic Nodes Example
The Elastic Nodes example shows how to implement edges between nodes in a
@@ -61,7 +61,7 @@
Let's start by looking at the \c Node class declaration.
- \snippet graphicsview/elasticnodes/node.h 0
+ \snippet widgets/graphicsview/elasticnodes/node.h 0
The \c Node class inherits QGraphicsItem, and reimplements the two
mandatory functions \l{QGraphicsItem::boundingRect()}{boundingRect()} and
@@ -87,7 +87,7 @@
We will start reviewing the \c Node implementation by looking at its
constructor:
- \snippet graphicsview/elasticnodes/node.cpp 0
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 0
In the constructor, we set the
\l{QGraphicsItem::ItemIsMovable}{ItemIsMovable} flag to allow the item to
@@ -102,7 +102,7 @@
\c Node's constructor takes a \c GraphWidget pointer and stores this as a
member variable. We will revisit this pointer later on.
- \snippet graphicsview/elasticnodes/node.cpp 1
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 1
The addEdge() function adds the input edge to a list of attached edges. The
edge is then adjusted so that the end points for the edge match the
@@ -110,7 +110,7 @@
The edges() function simply returns the list of attached edges.
- \snippet graphicsview/elasticnodes/node.cpp 2
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 2
There are two ways to move a node. The \c calculateForces() function
implements the elastic effect that pulls and pushes on nodes in the grid.
@@ -121,7 +121,7 @@
Because we need to find all neighboring (but not necessarily connected)
nodes, we also make sure the item is part of a scene in the first place.
- \snippet graphicsview/elasticnodes/node.cpp 3
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 3
The "elastic" effect comes from an algorithm that applies pushing and
pulling forces. The effect is impressive, and surprisingly simple to
@@ -142,41 +142,41 @@
rapid degradation when distance increases. The sum of all forces is stored
in \c xvel (X-velocity) and \c yvel (Y-velocity).
- \snippet graphicsview/elasticnodes/node.cpp 4
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 4
The edges between the nodes represent forces that pull the nodes together.
By visiting each edge that is connected to this node, we can use a similar
approach as above to find the direction and strength of all pulling forces.
These forces are subtracted from \c xvel and \c yvel.
- \snippet graphicsview/elasticnodes/node.cpp 5
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 5
In theory, the sum of pushing and pulling forces should stabilize to
precisely 0. In practice, however, they never do. To circumvent errors in
numerical precision, we simply force the sum of forces to be 0 when they
are less than 0.1.
- \snippet graphicsview/elasticnodes/node.cpp 6
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 6
The final step of \c calculateForces() determines the node's new position.
We add the force to the node's current position. We also make sure the new
position stays inside of our defined boundaries. We don't actually move the
item in this function; that's done in a separate step, from \c advance().
- \snippet graphicsview/elasticnodes/node.cpp 7
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 7
The \c advance() function updates the item's current position. It is called
from \c GraphWidget::timerEvent(). If the node's position changed, the
function returns true; otherwise false is returned.
- \snippet graphicsview/elasticnodes/node.cpp 8
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 8
The \c Node's bounding rectangle is a 20x20 sized rectangle centered around
its origin (0, 0), adjusted by 2 units in all directions to compensate for
the node's outline stroke, and by 3 units down and to the right to make
room for a simple drop shadow.
- \snippet graphicsview/elasticnodes/node.cpp 9
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 9
The shape is a simple ellipse. This ensures that you must click inside the
node's elliptic shape in order to drag it around. You can test this effect
@@ -185,7 +185,7 @@
item's hit area would be identical to its bounding rectangle (i.e.,
rectangular).
- \snippet graphicsview/elasticnodes/node.cpp 10
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 10
This function implements the node's painting. We start by drawing a simple
dark gray elliptic drop shadow at (-7, -7), that is, (3, 3) units down and
@@ -201,7 +201,7 @@
uses \l{QGraphicsItem::DeviceCoordinateCache}{DeviceCoordinateCache}, a
simple yet effective measure that prevents unnecessary redrawing.
- \snippet graphicsview/elasticnodes/node.cpp 11
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 11
We reimplement \l{QGraphicsItem::itemChange()}{itemChange()} to adjust the
position of all connected edges, and to notify the scene that an item has
@@ -213,7 +213,7 @@
notification using a signal; in such case, \c Node would need to inherit
from QGraphicsObject.
- \snippet graphicsview/elasticnodes/node.cpp 12
+ \snippet widgets/graphicsview/elasticnodes/node.cpp 12
Because we have set the \l{QGraphicsItem::ItemIsMovable}{ItemIsMovable}
flag, we don't need to implement the logic that moves the node according to
@@ -232,7 +232,7 @@
Let's take a look at the class declaration:
- \snippet graphicsview/elasticnodes/edge.h 0
+ \snippet widgets/graphicsview/elasticnodes/edge.h 0
\c Edge inherits from QGraphicsItem, as it's a simple class that has no use
for signals, slots, and properties (compare to QGraphicsObject).
@@ -246,7 +246,7 @@
We will now review its implementation.
- \snippet graphicsview/elasticnodes/edge.cpp 0
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 0
The \c Edge constructor initializes its \c arrowSize data member to 10 units;
this determines the size of the arrow which is drawn in
@@ -259,12 +259,12 @@
pointers are updated, this edge is registered with each node, and we call
\c adjust() to update this edge's start end end position.
- \snippet graphicsview/elasticnodes/edge.cpp 1
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 1
The source and destination get-functions simply return the respective
pointers.
- \snippet graphicsview/elasticnodes/edge.cpp 2
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 2
In \c adjust(), we define two points: \c sourcePoint, and \c destPoint,
pointing at the source and destination nodes' origins respectively. Each
@@ -298,7 +298,7 @@
bookkeeping clean. It's safest to call this function once, immediately
before any such variable is modified.
- \snippet graphicsview/elasticnodes/edge.cpp 3
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 3
The edge's bounding rectangle is defined as the smallest rectangle that
includes both the start and the end point of the edge. Because we draw an
@@ -307,7 +307,7 @@
draw the outline of the arrow, and we can assume that half of the outline
can be drawn outside of the arrow's area, and half will be drawn inside.
- \snippet graphicsview/elasticnodes/edge.cpp 4
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 4
We start the reimplementation of \l{QGraphicsItem::paint()}{paint()} by
checking a few preconditions. Firstly, if either the source or destination
@@ -316,13 +316,13 @@
At the same time, we check if the length of the edge is approximately 0,
and if it is, then we also return.
- \snippet graphicsview/elasticnodes/edge.cpp 5
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 5
We draw the line using a pen that has round joins and caps. If you run the
example, zoom in and study the edge in detail, you will see that there are
no sharp/square edges.
- \snippet graphicsview/elasticnodes/edge.cpp 6
+ \snippet widgets/graphicsview/elasticnodes/edge.cpp 6
We proceed to drawing one arrow at each end of the edge. Each arrow is
drawn as a polygon with a black fill. The coordinates for the arrow are
@@ -333,7 +333,7 @@
\c GraphWidget is a subclass of QGraphicsView, which provides the main
window with scrollbars.
- \snippet graphicsview/elasticnodes/graphwidget.h 0
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.h 0
The class provides a basic constructor that initializes the scene, an \c
itemMoved() function to notify changes in the scene's node graph, a few
@@ -341,7 +341,7 @@
\l{QGraphicsView::drawBackground()}{drawBackground()}, and a helper
function for scaling the view by using the mouse wheel or keyboard.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 0
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 0
\c GraphicsWidget's constructor creates the scene, and because most items
move around most of the time, it sets QGraphicsScene::NoIndex. The scene
@@ -366,19 +366,19 @@
Finally we give the window a minimum size that matches the scene's default
size, and set a suitable window title.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 1
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 1
The last part of the constructor creates the grid of nodes and edges, and
gives each node an initial position.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 2
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 2
\c GraphWidget is notified of node movement through this \c itemMoved()
function. Its job is simply to restart the main timer in case it's not
running already. The timer is designed to stop when the graph stabilizes,
and start once it's unstable again.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 3
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 3
This is \c GraphWidget's key event handler. The arrow keys move the center
node around, the '+' and '-' keys zoom in and out by calling \c
@@ -386,7 +386,7 @@
nodes. All other key events (e.g., page up and page down) are handled by
QGraphicsView's default implementation.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 4
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 4
The timer event handler's job is to run the whole force calculation
machinery as a smooth animation. Each time the timer is triggered, the
@@ -396,14 +396,14 @@
By checking the return value of \c advance(), we can decide if the grid
stabilized (i.e., no nodes moved). If so, we can stop the timer.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 5
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 5
In the wheel event handler, we convert the mouse wheel delta to a scale
factor, and pass this factor to \c scaleView(). This approach takes into
account the speed that the wheel is rolled. The faster you roll the mouse
wheel, the faster the view will zoom.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 6
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 6
The view's background is rendered in a reimplementation of
QGraphicsView::drawBackground(). We draw a large rectangle filled with a
@@ -413,7 +413,7 @@
This background rendering is quite expensive; this is why the view enables
QGraphicsView::CacheBackground.
- \snippet graphicsview/elasticnodes/graphwidget.cpp 7
+ \snippet widgets/graphicsview/elasticnodes/graphwidget.cpp 7
The \c scaleView() helper function checks that the scale factor stays
within certain limits (i.e., you cannot zoom too far in nor too far out),
diff --git a/examples/widgets/doc/elidedlabel.qdoc b/examples/widgets/doc/elidedlabel.qdoc
index 2ce469d85f..45d717dd84 100644
--- a/examples/widgets/doc/elidedlabel.qdoc
+++ b/examples/widgets/doc/elidedlabel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/elidedlabel
+ \example widgets/widgets/elidedlabel
\group all-examples
\title Elided Label Example
@@ -51,7 +51,7 @@
the \c ElidedLabel class:
- \snippet widgets/elidedlabel/elidedlabel.h 0
+ \snippet widgets/widgets/elidedlabel/elidedlabel.h 0
The \c isElided property depends the font, text content and geometry of the
widget. Whenever any of these change, the \c elisionChanged() signal might
@@ -65,11 +65,11 @@
policy to be horizontally expanding, since it's meant to fill the width of
its container and grow vertically.
- \snippet widgets/elidedlabel/elidedlabel.cpp 0
+ \snippet widgets/widgets/elidedlabel/elidedlabel.cpp 0
Changing the \c content require a repaint of the widget.
- \snippet widgets/elidedlabel/elidedlabel.cpp 1
+ \snippet widgets/widgets/elidedlabel/elidedlabel.cpp 1
QTextLayout is used in the \c paintEvent() to divide the \c content into
lines, that wrap on word boundaries. Each line, except the last visible
@@ -77,7 +77,7 @@
method of QTextLine will draw the line using the coordinate point as the
top left corner.
- \snippet widgets/elidedlabel/elidedlabel.cpp 2
+ \snippet widgets/widgets/elidedlabel/elidedlabel.cpp 2
Unfortunately, QTextLayout does not elide text, so the last visible line
has to be treated differently. This last line is elided if it is too wide.
@@ -86,12 +86,12 @@
Finally, one more line is created to see if everything fit on this line.
- \snippet widgets/elidedlabel/elidedlabel.cpp 3
+ \snippet widgets/widgets/elidedlabel/elidedlabel.cpp 3
If the text was elided and wasn't before or vice versa, cache it in
\c elided and emit the change.
- \snippet widgets/elidedlabel/elidedlabel.cpp 4
+ \snippet widgets/widgets/elidedlabel/elidedlabel.cpp 4
\section1 TestWidget Class Definition
@@ -99,55 +99,55 @@
\c TestWidget is a QWidget and is the main window of the example. It
contains an \c ElidedLabel which can be resized with two QSlider widgets.
- \snippet widgets/elidedlabel/testwidget.h 0
+ \snippet widgets/widgets/elidedlabel/testwidget.h 0
\section1 TestWidget Class Implementation
The constructor initializes the whole widget. Strings of different length
are stored in \c textSamples. The user is able to switch between these.
- \snippet widgets/elidedlabel/testwidget.cpp 0
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 0
An \c ElidedLabel is created to contain the first of the sample strings.
The frame is made visible to make it easier to see the actual size of the
widget.
- \snippet widgets/elidedlabel/testwidget.cpp 1
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 1
The buttons and the elision label are created. By connecting the
\c elisionChanged() signal to the \c setVisible() slot of the \c label,
it will act as an indicator to when the text is elided or not. This signal
could, for instance, be used to make a "More" button visible, or similar.
- \snippet widgets/elidedlabel/testwidget.cpp 2
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 2
The \c widthSlider and \c heightSlider specify the size of the
\c elidedText. Since the y-axis is inverted, the \c heightSlider has to be
inverted to act appropriately.
- \snippet widgets/elidedlabel/testwidget.cpp 3
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 3
The components are all stored in a QGridLayout, which is made the layout of
the \c TestWidget.
- \snippet widgets/elidedlabel/testwidget.cpp 4
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 4
On the Maemo platform, windows are stuck in landscape mode by default. With
this attribute set, the window manager is aware that this window can be
rotated.
- \snippet widgets/elidedlabel/testwidget.cpp 5
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 5
The \c widthSlider and \c heightSlider have the exact same length as the
dimensions of the \c elidedText. The maximum value for both of them is
thus their lengths, and each tick indicates one pixel.
- \snippet widgets/elidedlabel/testwidget.cpp 6
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 6
The \c switchText() slot simply cycles through all the available sample
texts.
- \snippet widgets/elidedlabel/testwidget.cpp 7
+ \snippet widgets/widgets/elidedlabel/testwidget.cpp 7
These slots set the width and height of the \c elided text, in response to
changes in the sliders.
@@ -157,6 +157,6 @@
The \c main() function creates an instance of \c TestWidget fullscreen and
enters the message loop.
- \snippet widgets/elidedlabel/main.cpp 0
+ \snippet widgets/widgets/elidedlabel/main.cpp 0
*/
diff --git a/examples/widgets/doc/embeddeddialogs.qdoc b/examples/widgets/doc/embeddeddialogs.qdoc
index 24b3abdb37..fbde62443f 100644
--- a/examples/widgets/doc/embeddeddialogs.qdoc
+++ b/examples/widgets/doc/embeddeddialogs.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/embeddeddialogs
+ \example widgets/graphicsview/embeddeddialogs
\title Embedded Dialogs
This example shows how to embed standard dialogs into
diff --git a/examples/widgets/doc/eventtransitions.qdoc b/examples/widgets/doc/eventtransitions.qdoc
index ef3f657c3d..3ae3065592 100644
--- a/examples/widgets/doc/eventtransitions.qdoc
+++ b/examples/widgets/doc/eventtransitions.qdoc
@@ -26,33 +26,33 @@
****************************************************************************/
/*!
- \example statemachine/eventtransitions
+ \example widgets/statemachine/eventtransitions
\title Event Transitions Example
The Event Transitions example shows how to use event transitions, a
feature of \l{The State Machine Framework}.
- \snippet statemachine/eventtransitions/main.cpp 0
+ \snippet widgets/statemachine/eventtransitions/main.cpp 0
The \c Window class's constructors begins by creating a button.
- \snippet statemachine/eventtransitions/main.cpp 1
+ \snippet widgets/statemachine/eventtransitions/main.cpp 1
Two states, \c s1 and \c s2, are created; upon entry they will assign
"Outside" and "Inside" to the button's text, respectively.
- \snippet statemachine/eventtransitions/main.cpp 2
+ \snippet widgets/statemachine/eventtransitions/main.cpp 2
When the button receives an event of type QEvent::Enter and the state
machine is in state \c s1, the machine will transition to state \c s2.
- \snippet statemachine/eventtransitions/main.cpp 3
+ \snippet widgets/statemachine/eventtransitions/main.cpp 3
When the button receives an event of type QEvent::Leave and the state
machine is in state \c s2, the machine will transition back to state \c
s1.
- \snippet statemachine/eventtransitions/main.cpp 4
+ \snippet widgets/statemachine/eventtransitions/main.cpp 4
Next, the state \c s3 is created. \c s3 will be entered when the button
receives an event of type QEvent::MouseButtonPress and the state machine
@@ -60,12 +60,12 @@
QEvent::MouseButtonRelease and the state machine is in state \c s3, the
machine will transition back to state \c s2.
- \snippet statemachine/eventtransitions/main.cpp 5
+ \snippet widgets/statemachine/eventtransitions/main.cpp 5
Finally, the states are added to the machine as top-level states, the
initial state is set to be \c s1 ("Outside"), and the machine is started.
- \snippet statemachine/eventtransitions/main.cpp 6
+ \snippet widgets/statemachine/eventtransitions/main.cpp 6
The main() function constructs a Window object and shows it.
diff --git a/examples/widgets/doc/extension.qdoc b/examples/widgets/doc/extension.qdoc
index 040d5d38d9..1568b44629 100644
--- a/examples/widgets/doc/extension.qdoc
+++ b/examples/widgets/doc/extension.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/extension
+ \example widgets/dialogs/extension
\title Extension Example
The Extension example shows how to add an extension to a QDialog
@@ -55,7 +55,7 @@
window mostly used for short-term tasks and brief communications
with the user.
- \snippet dialogs/extension/finddialog.h 0
+ \snippet widgets/dialogs/extension/finddialog.h 0
The \c FindDialog widget is the main application widget, and
displays the application's search options and controlling
@@ -77,7 +77,7 @@
of the \l {QCheckBox}{QCheckBox}es and all the \l
{QPushButton}{QPushButton}s.
- \snippet dialogs/extension/finddialog.cpp 0
+ \snippet widgets/dialogs/extension/finddialog.cpp 0
We give the options and buttons a shortcut key using the &
character. In the \uicontrol {Find what} option's case, we also need to
@@ -91,13 +91,13 @@
pressed if the user presses the Enter (or Return) key. Note that a
QDialog can only have one default button.
- \snippet dialogs/extension/finddialog.cpp 2
+ \snippet widgets/dialogs/extension/finddialog.cpp 2
Then we create the extension widget, and the \l
{QCheckBox}{QCheckBox}es associated with the advanced search
options.
- \snippet dialogs/extension/finddialog.cpp 3
+ \snippet widgets/dialogs/extension/finddialog.cpp 3
Now that the extension widget is created, we can connect the \uicontrol
More button's \l{QAbstractButton::toggled()}{toggled()} signal to
@@ -117,7 +117,7 @@
We also put the check boxes associated with the advanced
search options into a layout we install on the extension widget.
- \snippet dialogs/extension/finddialog.cpp 4
+ \snippet widgets/dialogs/extension/finddialog.cpp 4
Before we create the main layout, we create several child layouts
for the widgets: First we align the QLabel and its buddy, the
@@ -127,7 +127,7 @@
for the buttons. In the end we lay out the two latter layouts and
the extension widget using a QGridLayout.
- \snippet dialogs/extension/finddialog.cpp 5
+ \snippet widgets/dialogs/extension/finddialog.cpp 5
Finally, we hide the extension widget using the QWidget::hide()
function, making the application only show the simple search
diff --git a/examples/widgets/doc/factorial.qdoc b/examples/widgets/doc/factorial.qdoc
index 82ab5da536..250fdcc2b7 100644
--- a/examples/widgets/doc/factorial.qdoc
+++ b/examples/widgets/doc/factorial.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example statemachine/factorial
+ \example widgets/statemachine/factorial
\title Factorial States Example
The Factorial States example shows how to use \l{The State Machine
@@ -42,42 +42,42 @@
In other words, the state machine calculates the factorial of 6 and prints
the result.
- \snippet statemachine/factorial/main.cpp 0
+ \snippet widgets/statemachine/factorial/main.cpp 0
The Factorial class is used to hold the data of the computation, \c x and
\c fac. It also provides a signal that's emitted whenever the value of \c
x changes.
- \snippet statemachine/factorial/main.cpp 1
+ \snippet widgets/statemachine/factorial/main.cpp 1
The FactorialLoopTransition class implements the guard (\c x > 1) and
calculations (\c fac = \c x * \c fac; \c x = \c x - 1) of the factorial
loop.
- \snippet statemachine/factorial/main.cpp 2
+ \snippet widgets/statemachine/factorial/main.cpp 2
The FactorialDoneTransition class implements the guard (\c x <= 1) that
terminates the factorial computation. It also prints the final result to
standard output.
- \snippet statemachine/factorial/main.cpp 3
+ \snippet widgets/statemachine/factorial/main.cpp 3
The application's main() function first creates the application object, a
Factorial object and a state machine.
- \snippet statemachine/factorial/main.cpp 4
+ \snippet widgets/statemachine/factorial/main.cpp 4
The \c compute state is created, and the initial values of \c x and \c fac
are defined. A FactorialLoopTransition object is created and added to the
state.
- \snippet statemachine/factorial/main.cpp 5
+ \snippet widgets/statemachine/factorial/main.cpp 5
A final state, \c done, is created, and a FactorialDoneTransition object
is created with \c done as its target state. The transition is then added
to the \c compute state.
- \snippet statemachine/factorial/main.cpp 6
+ \snippet widgets/statemachine/factorial/main.cpp 6
The machine's initial state is set to be the \c compute state. We connect
the QStateMachine::finished() signal to the QCoreApplication::quit() slot,
diff --git a/examples/widgets/doc/fademessage.qdoc b/examples/widgets/doc/fademessage.qdoc
index 48f98c03ad..423c1adf70 100644
--- a/examples/widgets/doc/fademessage.qdoc
+++ b/examples/widgets/doc/fademessage.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example effects/fademessage
+ \example widgets/effects/fademessage
\title Fade Message Effect Example
\div { style="text-align: center"}
diff --git a/examples/widgets/doc/fetchmore.qdoc b/examples/widgets/doc/fetchmore.qdoc
index 7ea0b30edf..50810090ee 100644
--- a/examples/widgets/doc/fetchmore.qdoc
+++ b/examples/widgets/doc/fetchmore.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/fetchmore
+ \example widgets/itemviews/fetchmore
\title Fetch More Example
The Fetch More example shows how two add items to an item view
@@ -56,7 +56,7 @@
contents of a directory. It will add items to itself only when
requested to do so by the view.
- \snippet itemviews/fetchmore/filelistmodel.h 0
+ \snippet widgets/itemviews/fetchmore/filelistmodel.h 0
The secret lies in the reimplementation of
\l{QAbstractItemModel::}{fetchMore()} and
@@ -75,13 +75,13 @@
We start by checking out the \c setDirPath().
- \snippet itemviews/fetchmore/filelistmodel.cpp 0
+ \snippet widgets/itemviews/fetchmore/filelistmodel.cpp 0
We use a QDir to get the contents of the directory. We need to
inform QAbstractItemModel that we want to remove all items - if
any - from the model.
- \snippet itemviews/fetchmore/filelistmodel.cpp 1
+ \snippet widgets/itemviews/fetchmore/filelistmodel.cpp 1
The \c canFetchMore() function is called by the view when it needs
more items. We return true if there still are entries that we have
@@ -89,7 +89,7 @@
And now, the \c fetchMore() function itself:
- \snippet itemviews/fetchmore/filelistmodel.cpp 2
+ \snippet widgets/itemviews/fetchmore/filelistmodel.cpp 2
We first calculate the number of items to fetch.
\l{QAbstractItemModel::}{beginInsertRows()} and
@@ -99,7 +99,7 @@
To complete the tour, we also look at \c rowCount() and \c data().
- \snippet itemviews/fetchmore/filelistmodel.cpp 4
+ \snippet widgets/itemviews/fetchmore/filelistmodel.cpp 4
Notice that the row count is only the items we have added so far,
i.e., not the number of entries in the directory.
diff --git a/examples/widgets/doc/findfiles.qdoc b/examples/widgets/doc/findfiles.qdoc
index 594d57472c..c848ac9d59 100644
--- a/examples/widgets/doc/findfiles.qdoc
+++ b/examples/widgets/doc/findfiles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/findfiles
+ \example widgets/dialogs/findfiles
\title Find Files Example
The Find Files example shows how to use QProgressDialog to provide
@@ -54,7 +54,7 @@
widget. It shows the search options, and displays the search
results.
- \snippet dialogs/findfiles/window.h 0
+ \snippet widgets/dialogs/findfiles/window.h 0
We need two private slots: The \c browse() slot is called whenever
the user wants to browse for a directory to search in, and the \c
@@ -71,7 +71,7 @@
In the constructor we first create the application's widgets.
- \snippet dialogs/findfiles/window.cpp 0
+ \snippet widgets/dialogs/findfiles/window.cpp 0
We create the application's buttons using the private \c
createButton() function. Then we create the comboboxes associated
@@ -80,14 +80,14 @@
before we use the private \c createFilesTable() function to create
the table displaying the search results.
- \snippet dialogs/findfiles/window.cpp 1
+ \snippet widgets/dialogs/findfiles/window.cpp 1
Then we add all the widgets to a main layout using QGridLayout. We
have, however, put the \c Find and \c Quit buttons and a
stretchable space in a separate QHBoxLayout first, to make the
buttons appear in the \c Window widget's bottom right corner.
- \snippet dialogs/findfiles/window.cpp 2
+ \snippet widgets/dialogs/findfiles/window.cpp 2
The \c browse() slot presents a file dialog to the user, using the
QFileDialog class. QFileDialog enables a user to traverse the file
@@ -106,7 +106,7 @@
the specified userData. The item is appended to the list of
existing items.
- \snippet dialogs/findfiles/window.cpp 3
+ \snippet widgets/dialogs/findfiles/window.cpp 3
The \c find() slot is called whenever the user requests a new
search by pressing the \uicontrol Find button.
@@ -116,7 +116,7 @@
specified file name, text and directory path from the respective
comboboxes.
- \snippet dialogs/findfiles/window.cpp 4
+ \snippet widgets/dialogs/findfiles/window.cpp 4
We use the directory's path to create a QDir; the QDir class
provides access to directory structures and their contents. We
@@ -134,7 +134,7 @@
\image findfiles_progress_dialog.png Screenshot of the Progress Dialog
- \snippet dialogs/findfiles/window.cpp 5
+ \snippet widgets/dialogs/findfiles/window.cpp 5
In the private \c findFiles() function we search through a list of
files, looking for the ones that contain a specified text. This
@@ -149,7 +149,7 @@
application has not frozen. It can also give the user an
opportunity to abort the operation.
- \snippet dialogs/findfiles/window.cpp 6
+ \snippet widgets/dialogs/findfiles/window.cpp 6
We run through the files, one at a time, and for each file we
update the QProgressDialog value. This property holds the current
@@ -170,7 +170,7 @@
until there are no more events to process. The default flags are
QEventLoop::AllEvents.
- \snippet dialogs/findfiles/window.cpp 7
+ \snippet widgets/dialogs/findfiles/window.cpp 7
After updating the QProgressDialog, we create a QFile using the
QDir::absoluteFilePath() function which returns the absolute path
@@ -189,7 +189,7 @@
Finally, we return the list of the files found.
- \snippet dialogs/findfiles/window.cpp 8
+ \snippet widgets/dialogs/findfiles/window.cpp 8
Both the \c findFiles() and \c showFiles() functions are called from
the \c find() slot. In the \c showFiles() function we run through
@@ -199,14 +199,14 @@
We also update the total number of files found.
- \snippet dialogs/findfiles/window.cpp 9
+ \snippet widgets/dialogs/findfiles/window.cpp 9
The private \c createButton() function is called from the
constructor. We create a QPushButton with the provided text,
connect it to the provided slot, and return a pointer to the
button.
- \snippet dialogs/findfiles/window.cpp 10
+ \snippet widgets/dialogs/findfiles/window.cpp 10
The private \c createComboBox() function is also called from the
contructor. We create a QComboBox with the given text, and make it
@@ -221,7 +221,7 @@
widget's size policies, before we return a pointer to the
combobox.
- \snippet dialogs/findfiles/window.cpp 11
+ \snippet widgets/dialogs/findfiles/window.cpp 11
The private \c createFilesTable() function is called from the
constructor. In this function we create the QTableWidget that
@@ -240,7 +240,7 @@
QWidget::hide() function, and remove the default grid drawn for
the table using the QTableView::setShowGrid() function.
- \snippet dialogs/findfiles/window.cpp 12
+ \snippet widgets/dialogs/findfiles/window.cpp 12
The \c openFileOfItem() slot is invoked when the user double
clicks on a cell in the table. The QDesktopServices::openUrl()
diff --git a/examples/widgets/doc/flowlayout.qdoc b/examples/widgets/doc/flowlayout.qdoc
index b08b2283aa..910eb63c15 100644
--- a/examples/widgets/doc/flowlayout.qdoc
+++ b/examples/widgets/doc/flowlayout.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example layouts/flowlayout
+ \example widgets/layouts/flowlayout
\title Flow Layout Example
The Flow Layout example demonstrates a custom layout that arranges child
@@ -46,7 +46,7 @@
The \c FlowLayout class inherits QLayout. It is a custom layout class
that arranges its child widgets horizontally and vertically.
- \snippet layouts/flowlayout/flowlayout.h 0
+ \snippet widgets/layouts/flowlayout/flowlayout.h 0
We reimplement functions inherited from QLayout. These functions add items to
the layout and handle their orientation and geometry.
@@ -59,31 +59,31 @@
We start off by looking at the constructor:
- \snippet layouts/flowlayout/flowlayout.cpp 1
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 1
In the constructor we call \c setContentsMargins() to set the left, top,
right and bottom margin. By default, QLayout uses values provided by
the current style (see QStyle::PixelMetric).
- \snippet layouts/flowlayout/flowlayout.cpp 2
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 2
In this example we reimplement \c addItem(), which is a pure virtual
function. When using \c addItem() the ownership of the layout items is
transferred to the layout, and it is therefore the layout's
responsibility to delete them.
- \snippet layouts/flowlayout/flowlayout.cpp 3
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 3
\c addItem() is implemented to add items to the layout.
- \snippet layouts/flowlayout/flowlayout.cpp 4
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 4
We implement \c horizontalSpacing() and \c verticalSpacing() to get
hold of the spacing between the widgets inside the layout. If the value
is less than or equal to 0, this value will be used. If not,
\c smartSpacing() will be called to calculate the spacing.
- \snippet layouts/flowlayout/flowlayout.cpp 5
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 5
We then implement \c count() to return the number of items in the
layout. To navigate the list of items we use \c itemAt() and
@@ -91,12 +91,12 @@
removed, the remaining items will be renumbered. All three
functions are pure virtual functions from QLayout.
- \snippet layouts/flowlayout/flowlayout.cpp 6
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 6
\c expandingDirections() returns the \l{Qt::Orientation}s in which the
layout can make use of more space than its \c sizeHint().
- \snippet layouts/flowlayout/flowlayout.cpp 7
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 7
To adjust to widgets of which height is dependent on width, we implement \c
heightForWidth(). The function \c hasHeightForWidth() is used to test for this
@@ -104,7 +104,7 @@
in turn uses the width as an argument for the layout rect, i.e., the bounds in
which the items are laid out. This rect does not include the layout margin().
- \snippet layouts/flowlayout/flowlayout.cpp 8
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 8
\c setGeometry() is normally used to do the actual layout, i.e., calculate
the geometry of the layout's items. In this example, it calls \c doLayout()
@@ -113,19 +113,19 @@
\c sizeHint() returns the preferred size of the layout and \c minimumSize()
returns the minimum size of the layout.
- \snippet layouts/flowlayout/flowlayout.cpp 9
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 9
\c doLayout() handles the layout if \c horizontalSpacing() or \c
verticalSpacing() don't return the default value. It uses
\c getContentsMargins() to calculate the area available to the
layout items.
- \snippet layouts/flowlayout/flowlayout.cpp 10
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 10
It then sets the proper amount of spacing for each widget in the
layout, based on the current style.
- \snippet layouts/flowlayout/flowlayout.cpp 11
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 11
The position of each item in the layout is then calculated by
adding the items width and the line height to the initial x and y
@@ -133,7 +133,7 @@
will fit on the current line or if it must be moved down to the next.
We also find the height of the current line based on the widgets height.
- \snippet layouts/flowlayout/flowlayout.cpp 12
+ \snippet widgets/layouts/flowlayout/flowlayout.cpp 12
\c smartSpacing() is designed to get the default spacing for either
the top-level layouts or the sublayouts. The default spacing for
diff --git a/examples/widgets/doc/fontsampler.qdoc b/examples/widgets/doc/fontsampler.qdoc
index 8d7f0e0460..374258a4bc 100644
--- a/examples/widgets/doc/fontsampler.qdoc
+++ b/examples/widgets/doc/fontsampler.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/fontsampler
+ \example widgets/painting/fontsampler
\title Font Sampler Example
The Font Sampler example shows how to preview and print multi-page documents.
diff --git a/examples/widgets/doc/frozencolumn.qdoc b/examples/widgets/doc/frozencolumn.qdoc
index c65ce1d524..e97b0ad373 100644
--- a/examples/widgets/doc/frozencolumn.qdoc
+++ b/examples/widgets/doc/frozencolumn.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/frozencolumn
+ \example widgets/itemviews/frozencolumn
\title Frozen Column Example
This example demonstrates how to freeze a column within a QTableView.
@@ -56,7 +56,7 @@
column's geometry. In addition, we reimplement two functions:
\l{QAbstractItemView::}{resizeEvent()} and \l{QTableView::}{moveCursor()}.
- \snippet itemviews/frozencolumn/freezetablewidget.h Widget definition
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.h Widget definition
\note QAbstractItemView is \l{QTableView}'s ancestor.
@@ -72,7 +72,7 @@
vertical scrollbars together so that the frozen column scrolls vertically
with the rest of our table.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp constructor
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp constructor
In the \c init() function, we ensure that the overlay table view
@@ -82,7 +82,7 @@
only visible column is its first column; we hide the others using
\l{QTableView::}{setColumnHidden()}
- \snippet itemviews/frozencolumn/freezetablewidget.cpp init part1
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp init part1
In terms of the frozen column's z-order, we stack it on top of the
@@ -94,7 +94,7 @@
with the main tableview. Note that we called \c updateFrozenTableGeometry()
to make the column occupy the correct spot.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp init part2
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp init part2
When you resize the frozen column, the same column on the main table view
must resize accordingly, to provide seamless integration. This is
@@ -102,7 +102,7 @@
value from the \l{QHeaderView::}{sectionResized()} signal, emitted by both
the horizontal and vertical header.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp sections
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp sections
Since the width of the frozen column is modified, we adjust the geometry of
the widget accordingly by invoking \c updateFrozenTableGeometry(). This
@@ -112,14 +112,14 @@
\c updateFrozenTableGeometry() after invoking the base class
implementation.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp resize
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp resize
When navigating around the table with the keyboard, we need to ensure that
the current selection does not disappear behind the frozen column. To
synchronize this, we reimplement QTableView::moveCursor() and adjust the
scrollbar positions if needed, after calling the base class implementation.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp navigate
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp navigate
The frozen column's geometry calculation is based on the geometry of the
table underneath, so it always appears in the right place. Using the
@@ -127,7 +127,7 @@
no matter which style is used. We rely on the geometry of the viewport and
headers to set the boundaries for the frozen column.
- \snippet itemviews/frozencolumn/freezetablewidget.cpp geometry
+ \snippet widgets/itemviews/frozencolumn/freezetablewidget.cpp geometry
*/
diff --git a/examples/widgets/doc/gradients.qdoc b/examples/widgets/doc/gradients.qdoc
index 75f78b56ea..325d09c85a 100644
--- a/examples/widgets/doc/gradients.qdoc
+++ b/examples/widgets/doc/gradients.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/gradients
+ \example widgets/painting/gradients
\title Gradients
In this example we show the various types of gradients that can
diff --git a/examples/widgets/doc/groupbox.qdoc b/examples/widgets/doc/groupbox.qdoc
index d7384d409a..f4f9f0e068 100644
--- a/examples/widgets/doc/groupbox.qdoc
+++ b/examples/widgets/doc/groupbox.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/groupbox
+ \example widgets/widgets/groupbox
\title Group Box Example
The Group Box example shows how to use the different kinds of group
@@ -54,7 +54,7 @@
functions to construct each group box and populate it with different
selections of button widgets:
- \snippet widgets/groupbox/window.h 0
+ \snippet widgets/widgets/groupbox/window.h 0
In the example, the widget will be used as a top-level window, so
the constructor is defined so that we do not have to specify a parent
@@ -65,12 +65,12 @@
The constructor creates a grid layout and fills it with each of the
group boxes that are to be displayed:
- \snippet widgets/groupbox/window.cpp 0
+ \snippet widgets/widgets/groupbox/window.cpp 0
The functions used to create each group box each return a
QGroupBox to be inserted into the grid layout.
- \snippet widgets/groupbox/window.cpp 1
+ \snippet widgets/widgets/groupbox/window.cpp 1
The first group box contains and manages three radio buttons. Since
the group box contains only radio buttons, it is exclusive by
@@ -78,7 +78,7 @@
We check the first radio button to ensure that the button group
contains one checked button.
- \snippet widgets/groupbox/window.cpp 3
+ \snippet widgets/widgets/groupbox/window.cpp 3
We use a vertical layout within the group box to present the
buttons in the form of a vertical list, and return the group
@@ -89,52 +89,52 @@
unchecked, so the group box itself must be checked before any of
the radio buttons inside can be checked.
- \snippet widgets/groupbox/window.cpp 4
+ \snippet widgets/widgets/groupbox/window.cpp 4
The group box contains three exclusive radio buttons, and an
independent checkbox. For consistency, one radio button must be
checked at all times, so we ensure that the first one is initially
checked.
- \snippet widgets/groupbox/window.cpp 5
+ \snippet widgets/widgets/groupbox/window.cpp 5
The buttons are arranged in the same way as those in the first
group box.
- \snippet widgets/groupbox/window.cpp 6
+ \snippet widgets/widgets/groupbox/window.cpp 6
The third group box is constructed with a "flat" style that is
better suited to certain types of dialog.
- \snippet widgets/groupbox/window.cpp 7
+ \snippet widgets/widgets/groupbox/window.cpp 7
This group box contains only checkboxes, so it is non-exclusive by
default. This means that each checkbox can be checked independently
of the others.
- \snippet widgets/groupbox/window.cpp 8
+ \snippet widgets/widgets/groupbox/window.cpp 8
Again, we use a vertical layout within the group box to present
the buttons in the form of a vertical list.
- \snippet widgets/groupbox/window.cpp 9
+ \snippet widgets/widgets/groupbox/window.cpp 9
The final group box contains only push buttons and, like the
second group box, it is checkable.
- \snippet widgets/groupbox/window.cpp 10
+ \snippet widgets/widgets/groupbox/window.cpp 10
We create a normal button, a toggle button, and a flat push button:
- \snippet widgets/groupbox/window.cpp 11
+ \snippet widgets/widgets/groupbox/window.cpp 11
Push buttons can be used to display popup menus. We create one, and
attach a simple menu to it:
- \snippet widgets/groupbox/window.cpp 12
+ \snippet widgets/widgets/groupbox/window.cpp 12
Finally, we lay out the widgets vertically, and return the group box
that we created:
- \snippet widgets/groupbox/window.cpp 13
+ \snippet widgets/widgets/groupbox/window.cpp 13
*/
diff --git a/examples/widgets/doc/icons.qdoc b/examples/widgets/doc/icons.qdoc
index b6625db005..48f5dd194c 100644
--- a/examples/widgets/doc/icons.qdoc
+++ b/examples/widgets/doc/icons.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/icons
+ \example widgets/widgets/icons
\title Icons Example
The Icons example shows how QIcon can generate pixmaps reflecting
@@ -246,7 +246,7 @@
\image icons_preview_area.png Screenshot of IconPreviewArea.
- \snippet widgets/icons/iconpreviewarea.h 0
+ \snippet widgets/widgets/icons/iconpreviewarea.h 0
The \c IconPreviewArea class inherits QWidget. It displays the
generated pixmaps corresponding to an icon's possible states and
@@ -264,7 +264,7 @@
\section2 IconPreviewArea Class Implementation
- \snippet widgets/icons/iconpreviewarea.cpp 0
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 0
In the constructor we create the labels displaying the headers and
the icon's generated pixmaps, and add them to a grid layout.
@@ -300,24 +300,24 @@
Another approach is to add this line directly to the \c .pro
file.
- \snippet widgets/icons/iconpreviewarea.cpp 1
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 1
\codeline
- \snippet widgets/icons/iconpreviewarea.cpp 2
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 2
The public \c setIcon() and \c setSize() functions change the icon
or the icon size, and make sure that the generated pixmaps are
updated.
- \snippet widgets/icons/iconpreviewarea.cpp 3
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 3
\codeline
- \snippet widgets/icons/iconpreviewarea.cpp 4
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 4
We use the \c createHeaderLabel() and \c createPixmapLabel()
functions to create the preview area's labels displaying the
headers and the icon's generated pixmaps. Both functions return
the QLabel that is created.
- \snippet widgets/icons/iconpreviewarea.cpp 5
+ \snippet widgets/widgets/icons/iconpreviewarea.cpp 5
We use the private \c updatePixmapLabel() function to update the
generated pixmaps displayed in the preview area.
@@ -333,7 +333,7 @@
\image icons-example.png Screenshot of the Icons example
- \snippet widgets/icons/mainwindow.h 0
+ \snippet widgets/widgets/icons/mainwindow.h 0
The MainWindow class inherits from QMainWindow. We reimplement the
constructor, and declare several private slots:
@@ -354,7 +354,7 @@
\section2 MainWindow Class Implementation
- \snippet widgets/icons/mainwindow.cpp 0
+ \snippet widgets/widgets/icons/mainwindow.cpp 0
In the constructor we first create the main window's central
widget and its child widgets, and put them in a grid layout. Then
@@ -366,7 +366,7 @@
associated radio button, making the current value of the spin box
the icon's initial size.
- \snippet widgets/icons/mainwindow.cpp 1
+ \snippet widgets/widgets/icons/mainwindow.cpp 1
The \c about() slot displays a message box using the static
QMessageBox::about() function. In this example it displays a
@@ -378,7 +378,7 @@
parent, and if that fails, it tries the active window. As a last
resort it uses the QMessageBox's Information icon.
- \snippet widgets/icons/mainwindow.cpp 2
+ \snippet widgets/widgets/icons/mainwindow.cpp 2
In the \c changeStyle() slot we first check the slot's
parameter. If it is false we immediately return, otherwise we find
@@ -394,8 +394,8 @@
pointers are much easier to diagnose than crashes due to unsafe
casts.
- \snippet widgets/icons/mainwindow.cpp 3
- \snippet widgets/icons/mainwindow.cpp 4
+ \snippet widgets/widgets/icons/mainwindow.cpp 3
+ \snippet widgets/widgets/icons/mainwindow.cpp 4
Once we have the action, we extract the style name using
QAction::data(). Then we create a QStyle object using the static
@@ -414,7 +414,7 @@
group box and in the end call the \c changeSize() slot to update
the icon's size.
- \snippet widgets/icons/mainwindow.cpp 5
+ \snippet widgets/widgets/icons/mainwindow.cpp 5
The \c changeSize() slot sets the size for the preview area's
icon.
@@ -427,7 +427,7 @@
based on the extent, and use that object to set the size of the
preview area's icon.
- \snippet widgets/icons/mainwindow.cpp 12
+ \snippet widgets/widgets/icons/mainwindow.cpp 12
The first thing we do when the \c addImage() slot is called, is to
show a file dialog to the user. The easiest way to create a file
@@ -439,8 +439,8 @@
table widget. The table widget is listing the images the user has
loaded into the application.
- \snippet widgets/icons/mainwindow.cpp 13
- \snippet widgets/icons/mainwindow.cpp 14
+ \snippet widgets/widgets/icons/mainwindow.cpp 13
+ \snippet widgets/widgets/icons/mainwindow.cpp 14
We retrieve the image name using the QFileInfo::baseName()
function that returns the base name of the file without the path,
@@ -453,9 +453,9 @@
We also make sure that the item is not editable by removing the
Qt::ItemIsEditable flag. Table items are editable by default.
- \snippet widgets/icons/mainwindow.cpp 15
- \snippet widgets/icons/mainwindow.cpp 16
- \snippet widgets/icons/mainwindow.cpp 17
+ \snippet widgets/widgets/icons/mainwindow.cpp 15
+ \snippet widgets/widgets/icons/mainwindow.cpp 16
+ \snippet widgets/widgets/icons/mainwindow.cpp 17
Then we create the second and third items in the row making the
default mode Normal and the default state Off. But if the \uicontrol
@@ -465,8 +465,8 @@
"_on", the state is changed to On. The sample files in the
example's \c images subdirectory respect this naming convension.
- \snippet widgets/icons/mainwindow.cpp 18
- \snippet widgets/icons/mainwindow.cpp 19
+ \snippet widgets/widgets/icons/mainwindow.cpp 18
+ \snippet widgets/widgets/icons/mainwindow.cpp 19
In the end we add the items to the associated row, and use the
QTableWidget::openPersistentEditor() function to create
@@ -479,8 +479,8 @@
in the preview area. So, corresponding to this fact, we need to
make sure that the new image's check box is enabled.
- \snippet widgets/icons/mainwindow.cpp 6
- \snippet widgets/icons/mainwindow.cpp 7
+ \snippet widgets/widgets/icons/mainwindow.cpp 6
+ \snippet widgets/widgets/icons/mainwindow.cpp 7
The \c changeIcon() slot is called when the user alters the set
of images listed in the QTableWidget, to update the QIcon object
@@ -490,9 +490,9 @@
QTableWidget, which lists the images the user has loaded into the
application.
- \snippet widgets/icons/mainwindow.cpp 8
- \snippet widgets/icons/mainwindow.cpp 9
- \snippet widgets/icons/mainwindow.cpp 10
+ \snippet widgets/widgets/icons/mainwindow.cpp 8
+ \snippet widgets/widgets/icons/mainwindow.cpp 9
+ \snippet widgets/widgets/icons/mainwindow.cpp 10
We also extract the image file's name using the
QTableWidgetItem::data() function. This function takes a
@@ -507,12 +507,12 @@
with its associated mode and state, to the QIcon's set of
available pixmaps.
- \snippet widgets/icons/mainwindow.cpp 11
+ \snippet widgets/widgets/icons/mainwindow.cpp 11
After running through the entire list of images, we change the
icon of the preview area to the one we just created.
- \snippet widgets/icons/mainwindow.cpp 20
+ \snippet widgets/widgets/icons/mainwindow.cpp 20
In the \c removeAllImages() slot, we simply set the table widget's
row count to zero, automatically removing all the images the user
@@ -527,7 +527,7 @@
QTableWidget that will keep track of the images the user has
loaded into the application.
- \snippet widgets/icons/mainwindow.cpp 21
+ \snippet widgets/widgets/icons/mainwindow.cpp 21
First we create a group box that will contain the table widget.
Then we create a QTableWidget and customize it to suit our
@@ -550,14 +550,14 @@
\c ImageDelegate, provides comboboxes for the mode and state
fields.
- \snippet widgets/icons/mainwindow.cpp 22
- \snippet widgets/icons/mainwindow.cpp 23
+ \snippet widgets/widgets/icons/mainwindow.cpp 22
+ \snippet widgets/widgets/icons/mainwindow.cpp 23
Then we customize the QTableWidget's horizontal header, and hide
the vertical header.
- \snippet widgets/icons/mainwindow.cpp 24
- \snippet widgets/icons/mainwindow.cpp 25
+ \snippet widgets/widgets/icons/mainwindow.cpp 24
+ \snippet widgets/widgets/icons/mainwindow.cpp 25
At the end, we connect the QTableWidget::itemChanged() signal to
the \c changeIcon() slot to ensuret that the preview area is in
@@ -569,7 +569,7 @@
constructor. It creates the widgets controlling the size of the
preview area's icon.
- \snippet widgets/icons/mainwindow.cpp 26
+ \snippet widgets/widgets/icons/mainwindow.cpp 26
First we create a group box that will contain all the widgets;
then we create the radio buttons and the spin box.
@@ -581,7 +581,7 @@
handle icon sizes, e.g., "32 x 32", instead of plain integer
values.
- \snippet widgets/icons/mainwindow.cpp 27
+ \snippet widgets/widgets/icons/mainwindow.cpp 27
Then we connect all of the radio buttons
\l{QRadioButton::toggled()}{toggled()} signals and the spin box's
@@ -591,7 +591,7 @@
In the end we put the widgets in a layout that we install on the
group box.
- \snippet widgets/icons/mainwindow.cpp 28
+ \snippet widgets/widgets/icons/mainwindow.cpp 28
In the \c createActions() function we create and customize all the
actions needed to implement the functionality associated with the
@@ -609,7 +609,7 @@
with the style name. We will retrieve it later using
QAction::data().
- \snippet widgets/icons/mainwindow.cpp 29
+ \snippet widgets/widgets/icons/mainwindow.cpp 29
In the \c createMenu() function, we add the previously created
actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
@@ -619,7 +619,7 @@
application's menu bar, which we retrieve using
QMainWindow::menuBar().
- \snippet widgets/icons/mainwindow.cpp 30
+ \snippet widgets/widgets/icons/mainwindow.cpp 30
QWidgets have a \l{QWidget::contextMenuPolicy}{contextMenuPolicy}
property that controls how the widget should behave when the user
@@ -632,7 +632,7 @@
actions to the table widget. They will then appear in the table
widget's context menu.
- \snippet widgets/icons/mainwindow.cpp 31
+ \snippet widgets/widgets/icons/mainwindow.cpp 31
In the \c checkCurrentStyle() function we go through the group of
style actions, looking for the current GUI style.
@@ -656,7 +656,7 @@
\section2 IconSizeSpinBox Class Definition
- \snippet widgets/icons/iconsizespinbox.h 0
+ \snippet widgets/widgets/icons/iconsizespinbox.h 0
The \c IconSizeSpinBox class is a subclass of QSpinBox. A plain
QSpinBox can only handle integers. But since we want to display
@@ -668,11 +668,11 @@
\section2 IconSizeSpinBox Class Implementation
- \snippet widgets/icons/iconsizespinbox.cpp 0
+ \snippet widgets/widgets/icons/iconsizespinbox.cpp 0
The constructor is trivial.
- \snippet widgets/icons/iconsizespinbox.cpp 2
+ \snippet widgets/widgets/icons/iconsizespinbox.cpp 2
QSpinBox::textFromValue() is used by the spin box whenever it
needs to display a value. The default implementation returns a
@@ -680,7 +680,7 @@
Our reimplementation returns a QString of the form "32 x 32".
- \snippet widgets/icons/iconsizespinbox.cpp 1
+ \snippet widgets/widgets/icons/iconsizespinbox.cpp 1
The QSpinBox::valueFromText() function is used by the spin box
whenever it needs to interpret text typed in by the user. Since
@@ -706,7 +706,7 @@
\section2 ImageDelegate Class Definition
- \snippet widgets/icons/imagedelegate.h 0
+ \snippet widgets/widgets/icons/imagedelegate.h 0
The \c ImageDelegate class is a subclass of QItemDelegate. The
QItemDelegate class provides display and editing facilities for
@@ -719,7 +719,7 @@
for this purpose allows the editing mechanism to be customized and
developed independently from the model and view.
- \snippet widgets/icons/imagedelegate.h 1
+ \snippet widgets/widgets/icons/imagedelegate.h 1
The default implementation of QItemDelegate creates a QLineEdit.
Since we want the editor to be a QComboBox, we need to subclass
@@ -727,7 +727,7 @@
QItemDelegate::setEditorData() and QItemDelegate::setModelData()
functions.
- \snippet widgets/icons/imagedelegate.h 2
+ \snippet widgets/widgets/icons/imagedelegate.h 2
The \c emitCommitData() slot is used to emit the
QImageDelegate::commitData() signal with the appropriate
@@ -735,11 +735,11 @@
\section2 ImageDelegate Class Implementation
- \snippet widgets/icons/imagedelegate.cpp 0
+ \snippet widgets/widgets/icons/imagedelegate.cpp 0
The constructor is trivial.
- \snippet widgets/icons/imagedelegate.cpp 1
+ \snippet widgets/widgets/icons/imagedelegate.cpp 1
The default QItemDelegate::createEditor() implementation returns
the widget used to edit the item specified by the model and item
@@ -759,7 +759,7 @@
chooses an item using the combobox. This ensures that the rest of
the application notices the change and updates itself.
- \snippet widgets/icons/imagedelegate.cpp 2
+ \snippet widgets/widgets/icons/imagedelegate.cpp 2
The QItemDelegate::setEditorData() function is used by
QTableWidget to transfer data from a QTableWidgetItem to the
@@ -772,12 +772,12 @@
items is done implicitly by QTableWidget; we don't need to worry
about it.
- \snippet widgets/icons/imagedelegate.cpp 3
+ \snippet widgets/widgets/icons/imagedelegate.cpp 3
The QItemDelegate::setEditorData() function is used by QTableWidget
to transfer data back from the editor to the \l{QTableWidgetItem}.
- \snippet widgets/icons/imagedelegate.cpp 4
+ \snippet widgets/widgets/icons/imagedelegate.cpp 4
The \c emitCommitData() slot simply emit the
QAbstractItemDelegate::commitData() signal for the editor that
diff --git a/examples/widgets/doc/imagecomposition.qdoc b/examples/widgets/doc/imagecomposition.qdoc
index 2eecfd46aa..e1b7ac2d15 100644
--- a/examples/widgets/doc/imagecomposition.qdoc
+++ b/examples/widgets/doc/imagecomposition.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/imagecomposition
+ \example widgets/painting/imagecomposition
\title Image Composition Example
The Image Composition example lets the user combine images
@@ -41,7 +41,7 @@
\e butterfly.png and \e checker.png that are embedded within
\e imagecomposition.qrc. The file contains the following code:
- \quotefile examples/painting/imagecomposition/imagecomposition.qrc
+ \quotefile widgets/painting/imagecomposition/imagecomposition.qrc
For more information on resource files, see \l{The Qt Resource System}.
@@ -51,21 +51,21 @@
private slots, \c chooseSource(), \c chooseDestination(), and
\c recalculateResult().
- \snippet painting/imagecomposition/imagecomposer.h 0
+ \snippet widgets/painting/imagecomposition/imagecomposer.h 0
In addition, \c ImageComposer consists of five private functions,
\c addOp(), \c chooseImage(), \c loadImage(), \c currentMode(), and
\c imagePos(), as well as private instances of QToolButton, QComboBox,
QLabel, and QImage.
- \snippet painting/imagecomposition/imagecomposer.h 1
+ \snippet widgets/painting/imagecomposition/imagecomposer.h 1
\section1 ImageComposer Class Implementation
We declare a QSize object, \c resultSize, as a static constant with width
and height equal to 200.
- \snippet painting/imagecomposition/imagecomposer.cpp 0
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 0
Within the constructor, we instantiate a QToolButton object,
\c sourceButton and set its \l{QAbstractButton::setIconSize()}{iconSize}
@@ -74,7 +74,7 @@
QPainter::CompositionMode, \a mode, and a QString, \a name, representing
the name of the composition mode.
- \snippet painting/imagecomposition/imagecomposer.cpp 1
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 1
The \c destinationButton is instantiated and its
\l{QAbstractButton::setIconSize()}{iconSize} property is set to
@@ -82,7 +82,7 @@
are created and \c{resultLabel}'s \l{QWidget::setMinimumWidth()}
{minimumWidth} is set.
- \snippet painting/imagecomposition/imagecomposer.cpp 2
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 2
We connect the following signals to their corresponding slots:
\list
@@ -94,40 +94,40 @@
is connected to \c chooseDestination().
\endlist
- \snippet painting/imagecomposition/imagecomposer.cpp 3
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 3
A QGridLayout, \c mainLayout, is used to place all the widgets. Note
that \c{mainLayout}'s \l{QLayout::setSizeConstraint()}{sizeConstraint}
property is set to QLayout::SetFixedSize, which means that
\c{ImageComposer}'s size cannot be resized at all.
- \snippet painting/imagecomposition/imagecomposer.cpp 4
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 4
We create a QImage, \c resultImage, and we invoke \c loadImage() twice
to load both the image files in our \e imagecomposition.qrc file. Then,
we set the \l{QWidget::setWindowTitle()}{windowTitle} property to
"Image Composition".
- \snippet painting/imagecomposition/imagecomposer.cpp 5
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 5
The \c chooseSource() and \c chooseDestination() functions are
convenience functions that invoke \c chooseImage() with specific
parameters.
- \snippet painting/imagecomposition/imagecomposer.cpp 6
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 6
\codeline
- \snippet painting/imagecomposition/imagecomposer.cpp 7
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 7
The \c chooseImage() function loads an image of the user's choice,
depending on the \a title, \a image, and \a button.
- \snippet painting/imagecomposition/imagecomposer.cpp 10
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 10
The \c recalculateResult() function is used to calculate amd display the
result of combining the two images together with the user's choice of
composition mode.
- \snippet painting/imagecomposition/imagecomposer.cpp 8
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 8
The \c addOp() function adds an item to the \c operatorComboBox using
\l{QComboBox}'s \l{QComboBox::addItem()}{addItem} function. This function
@@ -135,31 +135,31 @@
rectangle is filled with Qt::Transparent and both the \c sourceImage and
\c destinationImage are painted, before displaying it on \c resultLabel.
- \snippet painting/imagecomposition/imagecomposer.cpp 9
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 9
The \c loadImage() function paints a transparent background using
\l{QPainter::fillRect()}{fillRect()} and draws \c image in a
centralized position using \l{QPainter::drawImage()}{drawImage()}.
This \c image is then set as the \c{button}'s icon.
- \snippet painting/imagecomposition/imagecomposer.cpp 11
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 11
The \c currentMode() function returns the composition mode currently
selected in \c operatorComboBox.
- \snippet painting/imagecomposition/imagecomposer.cpp 12
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 12
We use the \c imagePos() function to ensure that images loaded onto the
QToolButton objects, \c sourceButton and \c destinationButton, are
centralized.
- \snippet painting/imagecomposition/imagecomposer.cpp 13
+ \snippet widgets/painting/imagecomposition/imagecomposer.cpp 13
\section1 The \c main() Function
The \c main() function instantiates QApplication and \c ImageComposer
and invokes its \l{QWidget::show()}{show()} function.
- \snippet painting/imagecomposition/main.cpp 0
+ \snippet widgets/painting/imagecomposition/main.cpp 0
*/
diff --git a/examples/widgets/doc/imageviewer.qdoc b/examples/widgets/doc/imageviewer.qdoc
index 3556d52f7e..908f1345a1 100644
--- a/examples/widgets/doc/imageviewer.qdoc
+++ b/examples/widgets/doc/imageviewer.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/imageviewer
+ \example widgets/widgets/imageviewer
\title Image Viewer Example
The example shows how to combine QLabel and QScrollArea to
@@ -69,7 +69,7 @@
\section1 ImageViewer Class Definition
- \snippet widgets/imageviewer/imageviewer.h 0
+ \snippet widgets/widgets/imageviewer/imageviewer.h 0
The \c ImageViewer class inherits from QMainWindow. We reimplement
the constructor, and create several private slots to facilitate
@@ -85,7 +85,7 @@
\section1 ImageViewer Class Implementation
- \snippet widgets/imageviewer/imageviewer.cpp 0
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 0
In the constructor we first create the label and the scroll area.
@@ -109,8 +109,8 @@
we create the associated actions and menus, and customize the \c
{ImageViewer}'s appearance.
- \snippet widgets/imageviewer/imageviewer.cpp 1
- \snippet widgets/imageviewer/imageviewer.cpp 2
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 1
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 2
In the \c open() slot, we show a file dialog to the user. The
easiest way to create a QFileDialog is to use the static
@@ -133,8 +133,8 @@
information message with an \uicontrol OK button (the default) is
sufficient, since the message is part of a normal operation.
- \snippet widgets/imageviewer/imageviewer.cpp 3
- \snippet widgets/imageviewer/imageviewer.cpp 4
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 3
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 4
If the format is supported, we display the image in \c imageLabel
by setting the label's \l {QLabel::pixmap}{pixmap}. Then we enable
@@ -156,8 +156,8 @@
In the \c print() slot, we first make sure that an image has been
loaded into the application:
- \snippet widgets/imageviewer/imageviewer.cpp 5
- \snippet widgets/imageviewer/imageviewer.cpp 6
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 5
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 6
If the application is built in debug mode, the \c Q_ASSERT() macro
will expand to
@@ -184,8 +184,8 @@
Another approach is to add this line directly to the \c .pro
file.
- \snippet widgets/imageviewer/imageviewer.cpp 7
- \snippet widgets/imageviewer/imageviewer.cpp 8
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 7
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 8
Then we present a print dialog allowing the user to choose a
printer and to set a few options. We construct a painter with a
@@ -196,8 +196,8 @@
In the end we draw the pixmap at position (0, 0).
- \snippet widgets/imageviewer/imageviewer.cpp 9
- \snippet widgets/imageviewer/imageviewer.cpp 10
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 9
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 10
We implement the zooming slots using the private \c scaleImage()
function. We set the scaling factors to 1.25 and 0.8,
@@ -216,8 +216,8 @@
\li \inlineimage imageviewer-zoom_in_2.png
\endtable
- \snippet widgets/imageviewer/imageviewer.cpp 11
- \snippet widgets/imageviewer/imageviewer.cpp 12
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 11
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 12
When zooming, we use the QLabel's ability to scale its contents.
Such scaling doesn't change the actual size hint of the contents.
@@ -226,8 +226,8 @@
normal size of the currently displayed image is to call \c
adjustSize() and reset the scale factor to 1.0.
- \snippet widgets/imageviewer/imageviewer.cpp 13
- \snippet widgets/imageviewer/imageviewer.cpp 14
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 13
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 14
The \c fitToWindow() slot is called each time the user toggled
the \uicontrol {Fit to Window} option. If the slot is called to turn on
@@ -266,14 +266,14 @@
label's size to its content. And in the end we update the view
menu entries.
- \snippet widgets/imageviewer/imageviewer.cpp 15
- \snippet widgets/imageviewer/imageviewer.cpp 16
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 15
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 16
We implement the \c about() slot to create a message box
describing what the example is designed to show.
- \snippet widgets/imageviewer/imageviewer.cpp 17
- \snippet widgets/imageviewer/imageviewer.cpp 18
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 17
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 18
In the private \c createAction() function, we create the
actions providing the application features.
@@ -284,8 +284,8 @@
been loaded into the application. In addition we make the \c
fitToWindowAct \l {QAction::checkable}{checkable}.
- \snippet widgets/imageviewer/imageviewer.cpp 19
- \snippet widgets/imageviewer/imageviewer.cpp 20
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 19
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 20
In the private \c createMenu() function, we add the previously
created actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
@@ -297,16 +297,16 @@
menu bar which we retrieve with the QMainWindow::menuBar()
function.
- \snippet widgets/imageviewer/imageviewer.cpp 21
- \snippet widgets/imageviewer/imageviewer.cpp 22
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 21
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 22
The private \c updateActions() function enables or disables the
\uicontrol {Zoom In}, \uicontrol {Zoom Out} and \uicontrol {Normal Size} menu
entries depending on whether the \uicontrol {Fit to Window} option is
turned on or off.
- \snippet widgets/imageviewer/imageviewer.cpp 23
- \snippet widgets/imageviewer/imageviewer.cpp 24
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 23
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 24
In \c scaleImage(), we use the \c factor parameter to calculate
the new scaling factor for the displayed image, and resize \c
@@ -321,8 +321,8 @@
image pixmap from becoming too large, consuming too much
resources in the window system.
- \snippet widgets/imageviewer/imageviewer.cpp 25
- \snippet widgets/imageviewer/imageviewer.cpp 26
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 25
+ \snippet widgets/widgets/imageviewer/imageviewer.cpp 26
Whenever we zoom in or out, we need to adjust the scroll bars in
consequence. It would have been tempting to simply call
diff --git a/examples/widgets/doc/interview.qdoc b/examples/widgets/doc/interview.qdoc
index 35721ccfae..032c9963f5 100644
--- a/examples/widgets/doc/interview.qdoc
+++ b/examples/widgets/doc/interview.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/interview
+ \example widgets/itemviews/interview
\title Interview
The Interview example explores the flexibility and scalability of the
diff --git a/examples/widgets/doc/licensewizard.qdoc b/examples/widgets/doc/licensewizard.qdoc
index 125e0fec8f..95e985475f 100644
--- a/examples/widgets/doc/licensewizard.qdoc
+++ b/examples/widgets/doc/licensewizard.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/licensewizard
+ \example widgets/dialogs/licensewizard
\title License Wizard Example
The License Wizard example shows how to implement complex wizards in
@@ -65,7 +65,7 @@
registering their copy of a fictitious software product. Here's
the class definition:
- \snippet dialogs/licensewizard/licensewizard.h 1
+ \snippet widgets/dialogs/licensewizard/licensewizard.h 1
The class's public API is limited to a constructor and an enum.
The enum defines the IDs associated with the various pages:
@@ -83,30 +83,30 @@
that they must be unique and different from -1. IDs allow us to
refer to pages.
- \snippet dialogs/licensewizard/licensewizard.cpp 2
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 2
In the constructor, we create the five pages, insert them into
the wizard using QWizard::setPage(), and set \c Page_Intro to be
the first page.
- \snippet dialogs/licensewizard/licensewizard.cpp 3
- \snippet dialogs/licensewizard/licensewizard.cpp 4
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 3
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 4
We set the style to \l{QWizard::}{ModernStyle} on all platforms
except Mac OS X,
- \snippet dialogs/licensewizard/licensewizard.cpp 5
- \snippet dialogs/licensewizard/licensewizard.cpp 6
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 5
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 6
We configure the QWizard to show a \uicontrol Help button, which is
connected to our \c showHelp() slot. We also set the
\l{QWizard::}{LogoPixmap} for all pages that have a header (i.e.,
\c EvaluatePage, \c RegisterPage, and \c DetailsPage).
- \snippet dialogs/licensewizard/licensewizard.cpp 9
- \snippet dialogs/licensewizard/licensewizard.cpp 11
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 9
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 11
\dots
- \snippet dialogs/licensewizard/licensewizard.cpp 13
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 13
In \c showHelp(), we display help texts that are appropriate for
the current page. If the user clicks \uicontrol Help twice for the same
@@ -120,9 +120,9 @@
Here's the definition and implementation of \c{IntroPage}:
- \snippet dialogs/licensewizard/licensewizard.h 4
+ \snippet widgets/dialogs/licensewizard/licensewizard.h 4
\codeline
- \snippet dialogs/licensewizard/licensewizard.cpp 16
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 16
A page inherits from QWizardPage. We set a
\l{QWizardPage::}{title} and a
@@ -132,8 +132,8 @@
to display a watermark pixmap on the first and last pages, and to
have a header on the other pages.)
- \snippet dialogs/licensewizard/licensewizard.cpp 17
- \snippet dialogs/licensewizard/licensewizard.cpp 19
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 17
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 19
The \c nextId() function returns the ID for \c EvaluatePage if
the \uicontrol{Evaluate the product for 30 days} option is checked;
@@ -143,13 +143,13 @@
The \c EvaluatePage is slightly more involved:
- \snippet dialogs/licensewizard/licensewizard.h 5
+ \snippet widgets/dialogs/licensewizard/licensewizard.h 5
\codeline
- \snippet dialogs/licensewizard/licensewizard.cpp 20
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 20
\dots
- \snippet dialogs/licensewizard/licensewizard.cpp 21
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 21
\dots
- \snippet dialogs/licensewizard/licensewizard.cpp 22
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 22
First, we set the page's \l{QWizardPage::}{title}
and \l{QWizardPage::}{subTitle}.
@@ -164,7 +164,7 @@
Resetting the page amounts to clearing the two text fields.
- \snippet dialogs/licensewizard/licensewizard.cpp 23
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 23
The next page is always the \c ConclusionPage.
@@ -173,14 +173,14 @@
The \c RegisterPage and \c DetailsPage are very similar to \c
EvaluatePage. Let's go directly to the \c ConclusionPage:
- \snippet dialogs/licensewizard/licensewizard.h 6
+ \snippet widgets/dialogs/licensewizard/licensewizard.h 6
This time, we reimplement QWizardPage::initializePage() and
QWidget::setVisible(), in addition to
\l{QWizardPage::}{nextId()}. We also declare a private slot:
\c printButtonClicked().
- \snippet dialogs/licensewizard/licensewizard.cpp 18
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 18
The default implementation of QWizardPage::nextId() returns
the page with the next ID, or -1 if the current page has the
@@ -189,7 +189,7 @@
but to avoid relying on such subtle behavior, we reimplement
\l{QWizardPage::}{nextId()} to return -1.
- \snippet dialogs/licensewizard/licensewizard.cpp 27
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 27
We use QWizard::hasVisitedPage() to determine the type of
license agreement the user has chosen. If the user filled the \c
@@ -199,7 +199,7 @@
upgrade key and skipped the \c DetailsPage, the license text is
an Update License Agreement.
- \snippet dialogs/licensewizard/licensewizard.cpp 28
+ \snippet widgets/dialogs/licensewizard/licensewizard.cpp 28
We want to display a \uicontrol Print button in the wizard when the \c
ConclusionPage is up. One way to accomplish this is to reimplement
diff --git a/examples/widgets/doc/lighting.qdoc b/examples/widgets/doc/lighting.qdoc
index aafa70f38c..ae17d671d0 100644
--- a/examples/widgets/doc/lighting.qdoc
+++ b/examples/widgets/doc/lighting.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example effects/lighting
+ \example widgets/effects/lighting
\title Lighting Effect Example
\image lightingeffect-example.png
diff --git a/examples/widgets/doc/lineedits.qdoc b/examples/widgets/doc/lineedits.qdoc
index c9cb7b5f43..00f8f19f72 100644
--- a/examples/widgets/doc/lineedits.qdoc
+++ b/examples/widgets/doc/lineedits.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/lineedits
+ \example widgets/widgets/lineedits
\title Line Edits Example
The Line Edits example demonstrates the many ways that QLineEdit can be used, and
@@ -46,7 +46,7 @@
The \c Window class inherits QWidget and contains a constructor and several
slots:
- \snippet widgets/lineedits/window.h 0
+ \snippet widgets/widgets/lineedits/window.h 0
The slots are used to update the type of validator used for a given line edit when
a new validator has been selected in the associated combobox. The line edits
@@ -61,7 +61,7 @@
We begin by constructing a \l{QGroupBox}{group box} to hold a label, combobox,
and line edit so that we can demonstrate the QLineEdit::echoMode property:
- \snippet widgets/lineedits/window.cpp 0
+ \snippet widgets/widgets/lineedits/window.cpp 0
At this point, none of these widgets have been arranged in layouts. Eventually,
the \c echoLabel, \c echoComboBox, and \c echoLineEdit will be placed in a
@@ -70,29 +70,29 @@
Similarly, we construct group boxes and collections of widgets to show the
effects of QIntValidator and QDoubleValidator on a line edit's contents:
- \snippet widgets/lineedits/window.cpp 1
+ \snippet widgets/widgets/lineedits/window.cpp 1
Text alignment is demonstrated by another group of widgets:
- \snippet widgets/lineedits/window.cpp 2
+ \snippet widgets/widgets/lineedits/window.cpp 2
QLineEdit supports the use of \l{QLineEdit::inputMask}{input masks}.
These only allow the user to type characters into the line edit that
follow a simple specification. We construct a group of widgets to
demonstrate a selection of predefined masks:
- \snippet widgets/lineedits/window.cpp 3
+ \snippet widgets/widgets/lineedits/window.cpp 3
Another useful feature of QLineEdit is its ability to make its contents
read-only. This property is used to control access to a line edit in the
following group of widgets:
- \snippet widgets/lineedits/window.cpp 4
+ \snippet widgets/widgets/lineedits/window.cpp 4
Now that all the child widgets have been constructed, we connect signals
from the comboboxes to slots in the \c Window object:
- \snippet widgets/lineedits/window.cpp 5
+ \snippet widgets/widgets/lineedits/window.cpp 5
Each of these connections use the QComboBox::activated() signal that
supplies an integer to the slot. This will be used to efficiently
@@ -101,16 +101,16 @@
We place each combobox, line edit, and label in a layout for each group
box, beginning with the layout for the \c echoGroup group box:
- \snippet widgets/lineedits/window.cpp 6
+ \snippet widgets/widgets/lineedits/window.cpp 6
The other layouts are constructed in the same way:
- \snippet widgets/lineedits/window.cpp 7
+ \snippet widgets/widgets/lineedits/window.cpp 7
Finally, we place each group box in a grid layout for the \c Window object
and set the window title:
- \snippet widgets/lineedits/window.cpp 8
+ \snippet widgets/widgets/lineedits/window.cpp 8
The slots respond to signals emitted when the comboboxes are changed by the
user.
@@ -118,7 +118,7 @@
When the combobox for the \uicontrol{Echo} group box is changed, the \c echoChanged()
slot is called:
- \snippet widgets/lineedits/window.cpp 9
+ \snippet widgets/widgets/lineedits/window.cpp 9
The slot updates the line edit in the same group box to use an echo mode that
corresponds to the entry described in the combobox.
@@ -126,7 +126,7 @@
When the combobox for the \uicontrol{Validator} group box is changed, the
\c validatorChanged() slot is called:
- \snippet widgets/lineedits/window.cpp 10
+ \snippet widgets/widgets/lineedits/window.cpp 10
The slot either creates a new validator for the line edit to use, or it removes
the validator in use by calling QLineEdit::setValidator() with a zero pointer.
@@ -136,7 +136,7 @@
When the combobox for the \uicontrol{Alignment} group box is changed, the
\c alignmentChanged() slot is called:
- \snippet widgets/lineedits/window.cpp 11
+ \snippet widgets/widgets/lineedits/window.cpp 11
This changes the way that text is displayed in the line edit to correspond with
the description selected in the combobox.
@@ -144,7 +144,7 @@
The \c inputMaskChanged() slot handles changes to the combobox in the
\uicontrol{Input Mask} group box:
- \snippet widgets/lineedits/window.cpp 12
+ \snippet widgets/widgets/lineedits/window.cpp 12
Each entry in the relevant combobox is associated with an input mask. We set
a new mask by calling the QLineEdit::setMask() function with a suitable string;
@@ -153,7 +153,7 @@
The \c accessChanged() slot handles changes to the combobox in the
\uicontrol{Access} group box:
- \snippet widgets/lineedits/window.cpp 13
+ \snippet widgets/widgets/lineedits/window.cpp 13
Here, we simply associate the \uicontrol{False} and \uicontrol{True} entries in the combobox
with \c false and \c true values to be passed to QLineEdit::setReadOnly(). This
diff --git a/examples/widgets/doc/mainwindow.qdoc b/examples/widgets/doc/mainwindow.qdoc
index b4f6aebed1..4e9e8a0061 100644
--- a/examples/widgets/doc/mainwindow.qdoc
+++ b/examples/widgets/doc/mainwindow.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/mainwindow
+ \example widgets/mainwindows/mainwindow
\title Main Window
The Main Window example shows Qt's extensive support for tool bars,
diff --git a/examples/widgets/doc/mdi.qdoc b/examples/widgets/doc/mdi.qdoc
index e8b1b5c9ef..909fc9b387 100644
--- a/examples/widgets/doc/mdi.qdoc
+++ b/examples/widgets/doc/mdi.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/mdi
+ \example widgets/mainwindows/mdi
\title MDI Example
The MDI example shows how to implement a Multiple Document Interface using Qt's
diff --git a/examples/widgets/doc/menus.qdoc b/examples/widgets/doc/menus.qdoc
index 3531e439c1..3a9bb8e6a0 100644
--- a/examples/widgets/doc/menus.qdoc
+++ b/examples/widgets/doc/menus.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/menus
+ \example widgets/mainwindows/menus
\title Menus Example
The Menus example demonstrates how menus can be used in a main
@@ -57,7 +57,7 @@
tool bars, dock widgets and a status bar around a large central
widget.
- \snippet mainwindows/menus/mainwindow.h 0
+ \snippet widgets/mainwindows/menus/mainwindow.h 0
In this example, we will see how to implement pull-down menus as
well as a context menu. In order to implement a custom context
@@ -65,7 +65,7 @@
{QWidget::}{contextMenuEvent()} function to receive the context
menu events for our main window.
- \snippet mainwindows/menus/mainwindow.h 1
+ \snippet widgets/mainwindows/menus/mainwindow.h 1
We must also implement a collection of private slots to respond to
the user activating any of our menu entries. Note that these
@@ -73,14 +73,14 @@
i.e., most of them are only displaying the action's path in the
main window's central widget.
- \snippet mainwindows/menus/mainwindow.h 2
+ \snippet widgets/mainwindows/menus/mainwindow.h 2
We have chosen to simplify the constructor by implementing two
private convenience functions to create the various actions, to
add them to menus and to insert the menus into our main window's
menu bar.
- \snippet mainwindows/menus/mainwindow.h 3
+ \snippet widgets/mainwindows/menus/mainwindow.h 3
Finally, we declare the various menus and actions as well as a
simple information label in the application wide scope.
@@ -104,9 +104,9 @@
window takes ownership of the widget pointer and deletes it at the
appropriate time.
- \snippet mainwindows/menus/mainwindow.cpp 0
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 0
\codeline
- \snippet mainwindows/menus/mainwindow.cpp 1
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 1
Then we create the information label as well as a top and bottom
filler that we add to a layout which we install on the central
@@ -115,7 +115,7 @@
layout with a main window as a parent, is considered an error. You
should always set your own layout on the central widget instead.
- \snippet mainwindows/menus/mainwindow.cpp 2
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 2
To create the actions and menus we call our two convenience
functions: \c createActions() and \c createMenus(). We will get
@@ -132,7 +132,7 @@
Now, let's take a closer look at the \c createActions() convenience
function that creates the various actions:
- \snippet mainwindows/menus/mainwindow.cpp 4
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 4
\dots
A QAction object may contain an icon, a text, a shortcut, a status
@@ -151,7 +151,7 @@
The rest of the actions are created in a similar manner. Please
see the source code for details.
- \snippet mainwindows/menus/mainwindow.cpp 7
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 7
Once we have created the \uicontrol {Left Align}, \uicontrol {Right Align},
@@ -169,7 +169,7 @@
function to add the actions to the menus and to insert the menus
into the menu bar:
- \snippet mainwindows/menus/mainwindow.cpp 8
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 8
QMenuBar's \l {QMenuBar::addMenu()}{addMenu()} function appends a
new QMenu with the given title, to the menu bar (note that the
@@ -189,7 +189,7 @@
returns true, and adds the new action to the menu's list of
actions.
- \snippet mainwindows/menus/mainwindow.cpp 12
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 12
Note the \uicontrol Format menu. First of all, it is added as a submenu
to the \uicontrol Edit Menu using QMenu's \l
@@ -200,7 +200,7 @@
to the menu separately while the action group does its magic
behind the scene.
- \snippet mainwindows/menus/mainwindow.cpp 3
+ \snippet widgets/mainwindows/menus/mainwindow.cpp 3
To provide a custom context menu, we must reimplement QWidget's \l
{QWidget::}{contextMenuEvent()} function to receive the widget's
diff --git a/examples/widgets/doc/moveblocks.qdoc b/examples/widgets/doc/moveblocks.qdoc
index 8c12280989..074e9d0dca 100644
--- a/examples/widgets/doc/moveblocks.qdoc
+++ b/examples/widgets/doc/moveblocks.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/moveblocks
+ \example widgets/animation/moveblocks
\title Move Blocks Example
The Move Blocks example shows how to animate items in a
@@ -62,7 +62,7 @@
After QApplication has been initialized, we set up the
QGraphicsScene with its \c{QGraphicsRectWidget}s.
- \snippet animation/moveblocks/main.cpp 1
+ \snippet widgets/animation/moveblocks/main.cpp 1
After adding the scene to a QGraphicsView, it is time to build the
state graph. Let's first look at a statechart of what we are
@@ -75,7 +75,7 @@
graph will be examined line-by-line, and will show how the graph
works. First off, we construct the \c group state:
- \snippet animation/moveblocks/main.cpp 2
+ \snippet widgets/animation/moveblocks/main.cpp 2
The timer is used to add a delay between each time the blocks are
moved. The timer is started when \c group is entered. As we will
@@ -84,9 +84,9 @@
machine, so an animation will be scheduled when the example is
started.
- \snippet animation/moveblocks/main.cpp 3
+ \snippet widgets/animation/moveblocks/main.cpp 3
\dots
- \snippet animation/moveblocks/main.cpp 4
+ \snippet widgets/animation/moveblocks/main.cpp 4
\c createGeometryState() returns a QState that will set the
geometry of our items upon entry. It also assigns \c group as the
@@ -98,20 +98,20 @@
properties and the values in the target state. We add animated
transitions to the state graph later.
- \snippet animation/moveblocks/main.cpp 5
+ \snippet widgets/animation/moveblocks/main.cpp 5
We move the items in parallel. Each item is added to \c
animationGroup, which is the animation that is inserted into the
transitions.
- \snippet animation/moveblocks/main.cpp 6
+ \snippet widgets/animation/moveblocks/main.cpp 6
The sequential animation group, \c subGroup, helps us insert a
delay between the animation of each item.
- \snippet animation/moveblocks/main.cpp 7
+ \snippet widgets/animation/moveblocks/main.cpp 7
\dots
- \snippet animation/moveblocks/main.cpp 8
+ \snippet widgets/animation/moveblocks/main.cpp 8
A StateSwitchTransition is added to the state switcher
in \c StateSwitcher::addState(). We also add the animation in this
@@ -122,7 +122,7 @@
As mentioned previously, we add a transition to the state switcher
that triggers when the timer times out.
- \snippet animation/moveblocks/main.cpp 9
+ \snippet widgets/animation/moveblocks/main.cpp 9
Finally, we can create the state machine, add our initial state,
and start execution of the state graph.
@@ -132,7 +132,7 @@
In \c createGeometryState(), we set up the geometry for each
graphics item.
- \snippet animation/moveblocks/main.cpp 13
+ \snippet widgets/animation/moveblocks/main.cpp 13
As mentioned before, QAbstractTransition will set up an animation
added with \l{QAbstractTransition::}{addAnimation()} using
@@ -147,20 +147,20 @@
All functions in \c StateSwitcher are inlined. We'll step through
its definition.
- \snippet animation/moveblocks/main.cpp 10
+ \snippet widgets/animation/moveblocks/main.cpp 10
\c StateSwitcher is a state designed for a particular purpose and
will always be a top-level state. We use \c m_stateCount to keep
track of how many states we are managing, and \c m_lastIndex to
remember which state was the last state to which we transitioned.
- \snippet animation/moveblocks/main.cpp 11
+ \snippet widgets/animation/moveblocks/main.cpp 11
We select the next state we are going to transition to, and post a
\c StateSwitchEvent, which we know will trigger the \c
StateSwitchTransition to the selected state.
- \snippet animation/moveblocks/main.cpp 12
+ \snippet widgets/animation/moveblocks/main.cpp 12
This is where the magic happens. We assign a number to each state
added. This number is given to both a StateSwitchTransition and to
@@ -174,7 +174,7 @@
let's take a look at its \l{QAbstractTransition::}{eventTest()}
function, which is the only function that we define..
- \snippet animation/moveblocks/main.cpp 14
+ \snippet widgets/animation/moveblocks/main.cpp 14
\c eventTest is called by QStateMachine when it checks whether a
transition should be triggered--a return value of true means that
@@ -188,7 +188,7 @@
\c StateSwitcher. We have already seen how it is used to trigger
\c{StateSwitchTransition}s in \c StateSwitcher.
- \snippet animation/moveblocks/main.cpp 15
+ \snippet widgets/animation/moveblocks/main.cpp 15
We only have inlined functions in this class, so a look at its
definition will do.
@@ -200,7 +200,7 @@
which is the only function we define. Here is the
QGraphicsRectWidget class definition:
- \snippet animation/moveblocks/main.cpp 16
+ \snippet widgets/animation/moveblocks/main.cpp 16
\section1 Moving On
diff --git a/examples/widgets/doc/movie.qdoc b/examples/widgets/doc/movie.qdoc
index 7573d796c3..0d8f04b460 100644
--- a/examples/widgets/doc/movie.qdoc
+++ b/examples/widgets/doc/movie.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/movie
+ \example widgets/widgets/movie
\title Movie Example
The Movie example demonstrates how to use QMovie and QLabel to
diff --git a/examples/widgets/doc/orderform.qdoc b/examples/widgets/doc/orderform.qdoc
index ed40c65093..062cc52547 100644
--- a/examples/widgets/doc/orderform.qdoc
+++ b/examples/widgets/doc/orderform.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example richtext/orderform
+ \example widgets/richtext/orderform
\title Order Form Example
The Order Form example shows how to generate rich text documents by
@@ -43,7 +43,7 @@
\c verify() to allow contents of the \c DetailsDialog to be verified later.
This is further explained in \c DetailsDialog Implementation.
- \snippet richtext/orderform/detailsdialog.h 0
+ \snippet widgets/richtext/orderform/detailsdialog.h 0
The constructor of \c DetailsDialog accepts parameters \a title and
\a parent. The class defines four \e{getter} functions: \c orderItems(),
@@ -72,11 +72,11 @@
\c rejected() signals are connected to the \c verify() and \c reject()
slots in \c DetailsDialog.
- \snippet richtext/orderform/detailsdialog.cpp 0
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 0
A QGridLayout is used to place all the objects on the \c DetailsDialog.
- \snippet richtext/orderform/detailsdialog.cpp 1
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 1
The \c setupItemsTable() function instantiates the QTableWidget object,
\c itemsTable, and sets the number of rows based on the QStringList
@@ -88,29 +88,29 @@
\c itemsTable have this value for quantity; but this can be modified by
editing the contents of the cells at run time.
- \snippet richtext/orderform/detailsdialog.cpp 2
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 2
The \c orderItems() function extracts data from the \c itemsTable and
returns it in the form of a QList<QPair<QString,int>> where each QPair
corresponds to an item and the quantity ordered.
- \snippet richtext/orderform/detailsdialog.cpp 3
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 3
The \c senderName() function is used to return the value of the QLineEdit
used to store the name field for the order form.
- \snippet richtext/orderform/detailsdialog.cpp 4
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 4
The \c senderAddress() function is used to return the value of the
QTextEdit containing the address for the order form.
- \snippet richtext/orderform/detailsdialog.cpp 5
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 5
The \c sendOffers() function is used to return a \c true or \c false
value that is used to determine if the customer in the order form
wishes to receive more information on the company's offers and promotions.
- \snippet richtext/orderform/detailsdialog.cpp 6
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 6
The \c verify() function is an additionally implemented slot used to
verify the details entered by the user into the \c DetailsDialog. If
@@ -118,7 +118,7 @@
providing the user the option to discard the \c DetailsDialog. Otherwise,
the details are accepted and the \c accept() function is invoked.
- \snippet richtext/orderform/detailsdialog.cpp 7
+ \snippet widgets/richtext/orderform/detailsdialog.cpp 7
\section1 MainWindow Definition
@@ -126,7 +126,7 @@
slots - \c openDialog() and \c printFile(). It also contains a private
instance of QTabWidget, \c letters.
- \snippet richtext/orderform/mainwindow.h 0
+ \snippet widgets/richtext/orderform/mainwindow.h 0
\section1 MainWindow Implementation
@@ -136,20 +136,20 @@
and the default close() slot. The QTabWidget, \c letters, is
instantiated and set as the window's central widget.
- \snippet richtext/orderform/mainwindow.cpp 0
+ \snippet widgets/richtext/orderform/mainwindow.cpp 0
The \c createLetter() function creates a new QTabWidget with a QTextEdit,
\c editor, as the parent. This function accepts four parameters that
correspond to we obtained through \c DetailsDialog, in order to "fill"
the \c editor.
- \snippet richtext/orderform/mainwindow.cpp 1
+ \snippet widgets/richtext/orderform/mainwindow.cpp 1
We then obtain the cursor for the \c editor using QTextEdit::textCursor().
The \c cursor is then moved to the start of the document using
QTextCursor::Start.
- \snippet richtext/orderform/mainwindow.cpp 2
+ \snippet widgets/richtext/orderform/mainwindow.cpp 2
Recall the structure of a \l{Rich Text Document Structure}
{Rich Text Document}, where sequences of frames and
@@ -180,7 +180,7 @@
This is accomplished with the following code:
- \snippet richtext/orderform/mainwindow.cpp 3
+ \snippet widgets/richtext/orderform/mainwindow.cpp 3
Note that \c topFrame is the \c {editor}'s top-level frame and is not shown
in the document structure.
@@ -189,7 +189,7 @@
\c topFrame and fill in the customer's name (provided by the constructor)
and address - using a \c foreach loop to traverse the QString, \c address.
- \snippet richtext/orderform/mainwindow.cpp 4
+ \snippet widgets/richtext/orderform/mainwindow.cpp 4
The \c cursor is now back in \c topFrame and the document structure for
the above portion of code is:
@@ -209,12 +209,12 @@
{setWidth()} to increase the width of \c bodyFrameFormat and we insert
a new frame with that width.
- \snippet richtext/orderform/mainwindow.cpp 5
+ \snippet widgets/richtext/orderform/mainwindow.cpp 5
The following code inserts standard text into the order form.
- \snippet richtext/orderform/mainwindow.cpp 6
- \snippet richtext/orderform/mainwindow.cpp 7
+ \snippet widgets/richtext/orderform/mainwindow.cpp 6
+ \snippet widgets/richtext/orderform/mainwindow.cpp 7
This part of the document structure now contains the date, a frame with
\c bodyFrameFormat, as well as the standard text.
@@ -241,17 +241,17 @@
A QTextTableFormat object, \c orderTableFormat, is used to hold the type
of item and the quantity ordered.
- \snippet richtext/orderform/mainwindow.cpp 8
+ \snippet widgets/richtext/orderform/mainwindow.cpp 8
We use \l{QTextTable::cellAt()}{cellAt()} to set the headers for the
\c orderTable.
- \snippet richtext/orderform/mainwindow.cpp 9
+ \snippet widgets/richtext/orderform/mainwindow.cpp 9
Then, we iterate through the QList of QPair objects to populate
\c orderTable.
- \snippet richtext/orderform/mainwindow.cpp 10
+ \snippet widgets/richtext/orderform/mainwindow.cpp 10
The resulting document structure for this section is:
@@ -284,13 +284,13 @@
\l{QTextFrame::lastPosition()}{lastPosition()} and more standard text
is inserted.
- \snippet richtext/orderform/mainwindow.cpp 11
- \snippet richtext/orderform/mainwindow.cpp 12
+ \snippet widgets/richtext/orderform/mainwindow.cpp 11
+ \snippet widgets/richtext/orderform/mainwindow.cpp 12
Another QTextTable is inserted, to display the customer's
preference regarding offers.
- \snippet richtext/orderform/mainwindow.cpp 13
+ \snippet widgets/richtext/orderform/mainwindow.cpp 13
The document structure for this portion is:
@@ -315,7 +315,7 @@
name. More blocks are inserted for spacing purposes. The \c printAction
is enabled to indicate that an order form can now be printed.
- \snippet richtext/orderform/mainwindow.cpp 14
+ \snippet widgets/richtext/orderform/mainwindow.cpp 14
The bottom portion of the document structure is:
@@ -337,18 +337,18 @@
The \c createSample() function is used for illustration purposes, to create
a sample order form.
- \snippet richtext/orderform/mainwindow.cpp 15
+ \snippet widgets/richtext/orderform/mainwindow.cpp 15
The \c openDialog() function opens a \c DetailsDialog object. If the
details in \c dialog are accepted, the \c createLetter() function is
invoked using the parameters extracted from \c dialog.
- \snippet richtext/orderform/mainwindow.cpp 16
+ \snippet widgets/richtext/orderform/mainwindow.cpp 16
In order to print out the order form, a \c printFile() function is
included, as shown below:
- \snippet richtext/orderform/mainwindow.cpp 17
+ \snippet widgets/richtext/orderform/mainwindow.cpp 17
This function also allows the user to print a selected area with
QTextCursor::hasSelection(), instead of printing the entire document.
@@ -359,6 +359,6 @@
640x480 pixels before invoking the \c show() function and
\c createSample() function.
- \snippet richtext/orderform/main.cpp 0
+ \snippet widgets/richtext/orderform/main.cpp 0
*/
diff --git a/examples/widgets/doc/padnavigator.qdoc b/examples/widgets/doc/padnavigator.qdoc
index 8b1da516b5..dc924ecd65 100644
--- a/examples/widgets/doc/padnavigator.qdoc
+++ b/examples/widgets/doc/padnavigator.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example graphicsview/padnavigator
+ \example widgets/graphicsview/padnavigator
\title Pad Navigator Example
The Pad Navigator Example shows how you can use Graphics View together with
@@ -60,7 +60,7 @@
Let's start by reviewing the \c RoundRectItem class declaration.
- \snippet graphicsview/padnavigator/roundrectitem.h 0
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.h 0
\c RoundRectItem inherits QGraphicsObject, which makes it easy to control
its properties using QPropertyAnimation. Its constructor takes a rectangle
@@ -76,7 +76,7 @@
Otherwise the contents are filled using a gradient based on the color
passed to \c RoundRectItem's constructor.
- \snippet graphicsview/padnavigator/roundrectitem.h 1
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.h 1
The private data members are:
@@ -91,7 +91,7 @@
We will now review the \c RoundRectItem implementation. Let's start by
looking at its constructor:
- \snippet graphicsview/padnavigator/roundrectitem.cpp 0
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 0
The constructor initializes its member variables and forwards the \c parent
argument to QGraphicsObject's constructor. It then constructs the linear
@@ -110,24 +110,24 @@
remains persistent as we move and transform the item. This mode is ideal
for this example, and works particularly well with OpenGL and OpenGL ES.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 1
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 1
The \c pixmap property implementation simple returns the member pixmap, or
sets it and then calls \l{QGraphicsItem::update()}{update()}.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 2
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 2
As the \l{QGraphicsItem::paint()}{paint()} implementation below draws a
simple drop shadow down and to the right of the item, we return a slightly
adjusted rectangle from \l{QGraphicsItem::boundingRect()}{boundingRect()}.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 3
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 3
The \l{QGraphicsItem::paint()}{paint()} implementation starts by rendering
a semi transparent black round rectangle drop shadow, two units down and to
the right of the main item.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 4
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 4
We then draw the "foreground" round rectangle itself. The fill depends on
the \c fill property; if true, we will with a plain QPalette::Window color.
@@ -135,14 +135,14 @@
unit wide pen for the stroke, assign the brush, and then draw the
rectangle.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 5
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 5
If a pixmap has been assigned to the \e pixmap property, we draw this
pixmap in the center of the rectangle item. The pixmaps are scaled to match
the size of the icons; in arguably a better approach would have been to
store the icons with the right size in the first places.
- \snippet graphicsview/padnavigator/roundrectitem.cpp 6
+ \snippet widgets/graphicsview/padnavigator/roundrectitem.cpp 6
Finally, for completeness we include the \c fill property implementation.
It returns the \c fill member variable's value, and when assigned to, it
@@ -157,7 +157,7 @@
\c FlippablePad is, in addition to its inherited \c RoundRectItem
responsibilities, responsible for creating and managing a grid of icons.
- \snippet graphicsview/padnavigator/flippablepad.h 0
+ \snippet widgets/graphicsview/padnavigator/flippablepad.h 0
Its declaration is very simple: It inherits \c RoundRectItem and does not
need any special polymorphic behavior. It's suitable to declare its own
@@ -175,26 +175,26 @@
starts with two helper functions: \c boundsFromSize() and \c
posForLocation():
- \snippet graphicsview/padnavigator/flippablepad.cpp 0
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 0
\c boundsForSize() takes a QSize argument, and returns the bounding
rectangle of the flippable pad item. The QSize determines how many rows and
columns the icon grid should have. Each icon is given 150x150 units of
space, and this determines the bounds.
- \snippet graphicsview/padnavigator/flippablepad.cpp 1
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 1
\c posForLocation() returns the position of an icon given its row and
column position. Like \c boundsForSize(), the function assumes each icon is
given 150x150 units of space, and that all icons are centered around the
flippable pad item's origin (0, 0).
- \snippet graphicsview/padnavigator/flippablepad.cpp 2
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 2
The \c FlippablePad constructor passes suitable bounds (using \c
boundsForSize()) and specific color to \c RoundRectItem's constructor.
- \snippet graphicsview/padnavigator/flippablepad.cpp 3
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 3
It then loads pixmaps from compiled-in resources to use for its icons.
QDirIterator is very useful in this context, as it allows us to fetch all
@@ -203,7 +203,7 @@
We also make sure not to load more pixmaps than we need.
- \snippet graphicsview/padnavigator/flippablepad.cpp 4
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 4
Now that we have the pixmaps, we can create icons, position then and assign
pixmaps. We start by finding a suitable size and color for the icons, and
@@ -222,7 +222,7 @@
natural to assign the pixmaps directly, or that the icons themselves
provide suitable pixmaps.
- \snippet graphicsview/padnavigator/flippablepad.cpp 5
+ \snippet widgets/graphicsview/padnavigator/flippablepad.cpp 5
Finally, the \c iconAt() function returns a pointer to the icon at a
specific row and column. It makes a somewhat bold assumption that the input
@@ -238,7 +238,7 @@
started, and disappears after pressing any key. The animation is controlled
by \c PadNavigator; this class is very simple by itself.
- \snippet graphicsview/padnavigator/splashitem.h 0
+ \snippet widgets/graphicsview/padnavigator/splashitem.h 0
The class declaration shows that \c SplashItem inherits QGraphicsObject to
allow it to be controlled by QPropertyAnimation. It reimplements the
@@ -249,7 +249,7 @@
Let's look at its implementation.
- \snippet graphicsview/padnavigator/splashitem.cpp 0
+ \snippet widgets/graphicsview/padnavigator/splashitem.cpp 0
The constructor forwards to QGraphicsObject as expected, assigns a text
message to the \c text member variable, and enables
@@ -263,11 +263,11 @@
We use caching to avoid having to relayout and rerender the text for each
frame. An alterative approach would be to use the new QStaticText class.
- \snippet graphicsview/padnavigator/splashitem.cpp 1
+ \snippet widgets/graphicsview/padnavigator/splashitem.cpp 1
\c SplashItem's bounding rectangle is fixed at (400x175).
- \snippet graphicsview/padnavigator/splashitem.cpp 2
+ \snippet widgets/graphicsview/padnavigator/splashitem.cpp 2
The \l{QGraphicsItem::paint()}{paint()} implementation draws a clipped
round rectangle with a thick 2-unit border and a semi-transparent white
@@ -284,7 +284,7 @@
application. It creates and controls a somewhat complex state machine, and
several animations. Its class declaration is very simple:
- \snippet graphicsview/padnavigator/padnavigator.h 0
+ \snippet widgets/graphicsview/padnavigator/padnavigator.h 0
It inherits QGraphicsView and reimplements only one function:
\l{QGraphicsView::resizeEvent()}{resizeEvent()}, to ensure the scene is
@@ -296,7 +296,7 @@
It also keeps a private member instance, \c form, which is the generated
code for the pad's back side item's QGraphicsProxyWidget-embedded form.
- \snippet graphicsview/padnavigator/padnavigator.cpp 0
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 0
\c PadNavigator's constructor is a bit long. In short, its job is to create
all items, including the \c FlippablePad, the \c SplashItem and the
@@ -305,13 +305,13 @@
It starts out simple, by forwarding to QGraphicsView's constructor.
- \snippet graphicsview/padnavigator/padnavigator.cpp 1
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 1
The first item to be created is \c SplashItem. This is going to be a top-level
item in the scene, next to \c FlippablePad, and stacked on top of it, so we
assign it a \l{QGraphicsItem::zValue()}{Z-value} of 1.
- \snippet graphicsview/padnavigator/padnavigator.cpp 2
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 2
Now we construct the \c FlippablePad item, passing its column-row count to
its constructor.
@@ -334,7 +334,7 @@
The combination of all three rotations is assigned via
QGraphicsItem::setTransformations().
- \snippet graphicsview/padnavigator/padnavigator.cpp 3
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 3
Now we construct the QGraphicsProxyWidget-embedded \c backItem. The proxy
widget is created as a child of the pad. We create a new QWidget and
@@ -353,7 +353,7 @@
We enable \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache} to
ensure the flip animation can run smoothly.
- \snippet graphicsview/padnavigator/padnavigator.cpp 4
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 4
We now create the selection item. This is simply another instance of \c
RoundRectItem that is slightly larger than the icons on the pad. We create
@@ -364,7 +364,7 @@
What follows now is a series of animation initializations.
- \snippet graphicsview/padnavigator/padnavigator.cpp 5
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 5
We begin with the animations that apply to the splash item. The first
animation, \c smoothSplashMove, ensures that the "y" property of \c splash
@@ -375,14 +375,14 @@
The values are assigned by \c PadNavigator's state machine, which is
created later.
- \snippet graphicsview/padnavigator/padnavigator.cpp 6
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 6
These are the animations that control the selection item's movement and the
\c xRotation and \c yRotation QGraphicsRotation objects that tilt the pad.
All animations have a duration of 125 milliseconds, and they all use the
\l{QEasingCurve::InOutQuad}{InOutQuad} easing function.
- \snippet graphicsview/padnavigator/padnavigator.cpp 7
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 7
We now create the animations that control the flip-effect when you press
the enter key. The main goal is to rotate the pad by 180 degrees or back,
@@ -407,7 +407,7 @@
duration, or 250 milliseconds, the pad will be scaled down to 0.7x of its
original size, which gives a great visual effect while flipping.
- \snippet graphicsview/padnavigator/padnavigator.cpp 8
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 8
This section uses a trick to ensure that certain properties are assigned
precisely when the flip animation passes 50%, or 90 degrees, rotation. In
@@ -424,7 +424,7 @@
This approach can also be used to call functions or set any other
properties at a specific time while an animation is running.
- \snippet graphicsview/padnavigator/padnavigator.cpp 9
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 9
We will now create the state machine. The whole \c PadNavigator state
machinery is controlled by one single state machine that has a
@@ -440,7 +440,7 @@
can interact with the QGraphicsProxyWidget-embedded form.
\endlist
- \snippet graphicsview/padnavigator/padnavigator.cpp 10
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 10
Each state assigns specific properties to objects on entry. Most
interesting perhaps is the assignment of the value 0.0 to the pad's \c
@@ -454,7 +454,7 @@
before we start the state engine. We proceed with creating some
transitions.
- \snippet graphicsview/padnavigator/padnavigator.cpp 11
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 11
QEventTransition defines a very flexible transition type. You can use this
class to trigger a transition based on an object receiving an event of a
@@ -465,7 +465,7 @@
We register the \c splashItem's animations to this transition to ensure they
are used to animate the item's movement and opacity.
- \snippet graphicsview/padnavigator/padnavigator.cpp 12
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 12
We use QKeyEventTransition to capture specific key events. In this case, we
detect that the user presses Qt::Key_Return or Qt::Key_Enter, and use this
@@ -475,7 +475,7 @@
We continue by defining the states for each of the icons in the grid.
- \snippet graphicsview/padnavigator/padnavigator.cpp 13
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 13
We will use state groups to control transitions between icons. Each icon
represents a \e substate of \c frontState. We will then define transitions
@@ -491,7 +491,7 @@
substate. We initialze the selection item's position to be exactly where
the top-left icon is.
- \snippet graphicsview/padnavigator/padnavigator.cpp 14
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 14
We can now create four transitions for each icon. Each transition ensures
that we move to the state corresponding to which arrow key has been
@@ -499,7 +499,7 @@
specific transitions to and from each of the sub states depending on these
and other keys.
- \snippet graphicsview/padnavigator/padnavigator.cpp 15
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 15
Also, for each of the icons, we assign suitable values to the \c xRotation
and \c yRotation objects' "angle"-properties. If you recall, these
@@ -509,7 +509,7 @@
assigned at the right time, we add property-controlling animations to the
\c setVariableSequence animation defined earlier.
- \snippet graphicsview/padnavigator/padnavigator.cpp 16
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 16
We are now finished with all states, transitions, and animations. We now
create the scene that will contain all our items. The scene gets a defined
@@ -521,12 +521,12 @@
Then the scene is assigned to the view, or in our case, \c PadNavigator
itself.
- \snippet graphicsview/padnavigator/padnavigator.cpp 17
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 17
Now that the scene has received its final size, we can position the splash
item at the very top, find its fade-out position, and add it to the scene.
- \snippet graphicsview/padnavigator/padnavigator.cpp 18
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 18
The view toggles a few necessary properties:
@@ -547,7 +547,7 @@
Finally, we start the state engine.
- \snippet graphicsview/padnavigator/padnavigator.cpp 19
+ \snippet widgets/graphicsview/padnavigator/padnavigator.cpp 19
The \l{QGraphicsView::resizeEvent()}{resizeEvent()} implementation calls
the base implementation, and then calls QGraphicsView::fitInView() to scale
@@ -559,7 +559,7 @@
\section1 The main() Function
- \snippet graphicsview/padnavigator/main.cpp 0
+ \snippet widgets/graphicsview/padnavigator/main.cpp 0
The \c main function creates the QApplication instance, uses
Q_INIT_RESOURCE to ensure our compiled-in resources aren't removed by the
diff --git a/examples/widgets/doc/painterpaths.qdoc b/examples/widgets/doc/painterpaths.qdoc
index 45b0697cee..cc3ccf312d 100644
--- a/examples/widgets/doc/painterpaths.qdoc
+++ b/examples/widgets/doc/painterpaths.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/painterpaths
+ \example widgets/painting/painterpaths
\title Painter Paths Example
The Painter Paths example shows how painter paths can be used to
@@ -66,7 +66,7 @@
user to manipulate the painter paths' filling, pen, color and
rotation angle.
- \snippet painting/painterpaths/window.h 0
+ \snippet widgets/painting/painterpaths/window.h 0
We declare three private slots to respond to user input regarding
filling and color: \c fillRuleChanged(), \c fillGradientChanged()
@@ -80,14 +80,14 @@
argument; so we need to retrieve the new value, or values, before
we can update the \c RenderArea widgets.
- \snippet painting/painterpaths/window.h 1
+ \snippet widgets/painting/painterpaths/window.h 1
We also declare a couple of private convenience functions: \c
populateWithColors() populates a given QComboBox with items
corresponding to the color names Qt knows about, and \c
currentItemData() returns the current item for a given QComboBox.
- \snippet painting/painterpaths/window.h 2
+ \snippet widgets/painting/painterpaths/window.h 2
Then we declare the various components of the main window
widget. We also declare a convenience constant specifying the
@@ -98,13 +98,13 @@
In the implementation of the \c Window class we first declare the
constant \c Pi with six significant figures:
- \snippet painting/painterpaths/window.cpp 0
+ \snippet widgets/painting/painterpaths/window.cpp 0
In the constructor, we then define the various painter paths and
create corresponding \c RenderArea widgets which will render the
graphical shapes:
- \snippet painting/painterpaths/window.cpp 1
+ \snippet widgets/painting/painterpaths/window.cpp 1
We construct a rectangle with sharp corners using the
QPainterPath::moveTo() and QPainterPath::lineTo()
@@ -135,7 +135,7 @@
painter path's current position after the rect has been added is
at the top-left corner of the rectangle.
- \snippet painting/painterpaths/window.cpp 2
+ \snippet widgets/painting/painterpaths/window.cpp 2
Then we construct a rectangle with rounded corners. As before, we
use the QPainterPath::moveTo() and QPainterPath::lineTo()
@@ -150,7 +150,7 @@
current point to the starting point of the arc if they are not
already connected.
- \snippet painting/painterpaths/window.cpp 3
+ \snippet widgets/painting/painterpaths/window.cpp 3
We also use the QPainterPath::arcTo() function to construct the
ellipse path. First we move the current point starting a new
@@ -164,7 +164,7 @@
is composed of a clockwise curve, starting and finishing at zero
degrees (the 3 o'clock position).
- \snippet painting/painterpaths/window.cpp 4
+ \snippet widgets/painting/painterpaths/window.cpp 4
When constructing the pie chart path we continue to use a
combination of the mentioned functions: First we move the current
@@ -173,7 +173,7 @@
the subpath, we implicitly construct the last line back to the
center of the chart.
- \snippet painting/painterpaths/window.cpp 5
+ \snippet widgets/painting/painterpaths/window.cpp 5
Constructing a polygon is equivalent to constructing a rectangle.
@@ -182,7 +182,7 @@
new subpath. Current position after the polygon has been added is
the last point in polygon.
- \snippet painting/painterpaths/window.cpp 6
+ \snippet widgets/painting/painterpaths/window.cpp 6
Then we create a path consisting of a group of subpaths: First we
move the current point, and create a circle using the
@@ -201,7 +201,7 @@
QPainterPath::addPath() which adds a given path to the path that
calls the function.
- \snippet painting/painterpaths/window.cpp 7
+ \snippet widgets/painting/painterpaths/window.cpp 7
When creating the text path, we first create the font. Then we set
the font's style strategy which tells the font matching algorithm
@@ -214,7 +214,7 @@
that the left end of the text's baseline lies at the specified
point.
- \snippet painting/painterpaths/window.cpp 8
+ \snippet widgets/painting/painterpaths/window.cpp 8
To create the Bezier path, we use the QPainterPath::cubicTo()
function which adds a Bezier curve between the current point and
@@ -228,21 +228,21 @@
when filling the path as can be seen in the applications main
window.
- \snippet painting/painterpaths/window.cpp 9
+ \snippet widgets/painting/painterpaths/window.cpp 9
The final path that we construct shows that you can use
QPainterPath to construct rather complex shapes using only the
previous mentioned QPainterPath::moveTo(), QPainterPath::lineTo()
and QPainterPath::closeSubpath() functions.
- \snippet painting/painterpaths/window.cpp 10
+ \snippet widgets/painting/painterpaths/window.cpp 10
Now that we have created all the painter paths that we need, we
create a corresponding \c RenderArea widget for each. In the end,
we make sure that the number of render areas is correct using the
Q_ASSERT() macro.
- \snippet painting/painterpaths/window.cpp 11
+ \snippet widgets/painting/painterpaths/window.cpp 11
Then we create the widgets associated with the painter paths' fill
rule.
@@ -264,12 +264,12 @@
The Qt::WindingFill rule can in most cases be considered as the
intersection of closed shapes.
- \snippet painting/painterpaths/window.cpp 12
+ \snippet widgets/painting/painterpaths/window.cpp 12
We also create the other widgets associated with the filling, the
pen and the rotation angle.
- \snippet painting/painterpaths/window.cpp 16
+ \snippet widgets/painting/painterpaths/window.cpp 16
We connect the comboboxes \l {QComboBox::activated()}{activated()}
signals to the associated slots in the \c Window class, while we
@@ -277,23 +277,23 @@
{QSpinBox::valueChanged()}{valueChanged()} signal directly to the
\c RenderArea widget's respective slots.
- \snippet painting/painterpaths/window.cpp 17
+ \snippet widgets/painting/painterpaths/window.cpp 17
We add the \c RenderArea widgets to a separate layout which we
then add to the main layout along with the rest of the widgets.
- \snippet painting/painterpaths/window.cpp 18
+ \snippet widgets/painting/painterpaths/window.cpp 18
Finally, we initialize the \c RenderArea widgets by calling the \c
fillRuleChanged(), \c fillGradientChanged() and \c
penColorChanged() slots, and we set the initial pen width and
window title.
- \snippet painting/painterpaths/window.cpp 19
+ \snippet widgets/painting/painterpaths/window.cpp 19
\codeline
- \snippet painting/painterpaths/window.cpp 20
+ \snippet widgets/painting/painterpaths/window.cpp 20
\codeline
- \snippet painting/painterpaths/window.cpp 21
+ \snippet widgets/painting/painterpaths/window.cpp 21
The private slots are implemented to retrieve the new value, or
values, from the associated comboboxes and update the RenderArea
@@ -304,13 +304,13 @@
function. Then we call the associated slot for each of the \c
RenderArea widgets to update the painter paths.
- \snippet painting/painterpaths/window.cpp 22
+ \snippet widgets/painting/painterpaths/window.cpp 22
The \c populateWithColors() function populates the given combobox
with items corresponding to the color names Qt knows about
provided by the static QColor::colorNames() function.
- \snippet painting/painterpaths/window.cpp 23
+ \snippet widgets/painting/painterpaths/window.cpp 23
The \c currentItemData() function simply return the current item
of the given combobox.
@@ -320,7 +320,7 @@
The \c RenderArea class inherits QWidget, and is a custom widget
displaying a single painter path.
- \snippet painting/painterpaths/renderarea.h 0
+ \snippet widgets/painting/painterpaths/renderarea.h 0
We declare several public slots updating the \c RenderArea
widget's associated painter path. In addition we reimplement the
@@ -329,7 +329,7 @@
application, and we reimplement the QWidget::paintEvent() event
handler to draw its painter path.
- \snippet painting/painterpaths/renderarea.h 1
+ \snippet widgets/painting/painterpaths/renderarea.h 1
Each instance of the \c RenderArea class has a QPainterPath, a
couple of fill colors, a pen width, a pen color and a rotation
@@ -340,7 +340,7 @@
The constructor takes a QPainterPath as argument (in addition to
the optional QWidget parent):
- \snippet painting/painterpaths/renderarea.cpp 0
+ \snippet widgets/painting/painterpaths/renderarea.cpp 0
In the constructor we initialize the \c RenderArea widget with the
QPainterPath parameter as well as initializing the pen width and
@@ -348,23 +348,23 @@
{QWidget::backgroundRole()}{background role}; QPalette::Base is
typically white.
- \snippet painting/painterpaths/renderarea.cpp 1
+ \snippet widgets/painting/painterpaths/renderarea.cpp 1
\codeline
- \snippet painting/painterpaths/renderarea.cpp 2
+ \snippet widgets/painting/painterpaths/renderarea.cpp 2
Then we reimplement the QWidget::minimumSizeHint() and
QWidget::sizeHint() functions to give the \c RenderArea widget a
reasonable size within our application.
- \snippet painting/painterpaths/renderarea.cpp 3
+ \snippet widgets/painting/painterpaths/renderarea.cpp 3
\codeline
- \snippet painting/painterpaths/renderarea.cpp 4
+ \snippet widgets/painting/painterpaths/renderarea.cpp 4
\codeline
- \snippet painting/painterpaths/renderarea.cpp 5
+ \snippet widgets/painting/painterpaths/renderarea.cpp 5
\codeline
- \snippet painting/painterpaths/renderarea.cpp 6
+ \snippet widgets/painting/painterpaths/renderarea.cpp 6
\codeline
- \snippet painting/painterpaths/renderarea.cpp 7
+ \snippet widgets/painting/painterpaths/renderarea.cpp 7
The various public slots updates the \c RenderArea widget's
painter path by setting the associated property and make a call to
@@ -375,7 +375,7 @@
instead it schedules a paint event for processing when Qt returns
to the main event loop.
- \snippet painting/painterpaths/renderarea.cpp 8
+ \snippet widgets/painting/painterpaths/renderarea.cpp 8
A paint event is a request to repaint all or parts of the
widget. The paintEvent() function is an event handler that can be
@@ -390,7 +390,7 @@
should anti-alias the edges of primitives if possible, i.e. put
additional pixels around the original ones to smooth the edges.
- \snippet painting/painterpaths/renderarea.cpp 9
+ \snippet widgets/painting/painterpaths/renderarea.cpp 9
Then we scale the QPainter's coordinate system to ensure that the
painter path is rendered in the right size, i.e that it grows with
@@ -407,7 +407,7 @@
performed the rotation, we must remember to translate the
coordinate system back again.
- \snippet painting/painterpaths/renderarea.cpp 10
+ \snippet widgets/painting/painterpaths/renderarea.cpp 10
Then we set the QPainter's pen with the instance's rendering
preferences. We create a QLinearGradient and set its colors
diff --git a/examples/widgets/doc/pathstroke.qdoc b/examples/widgets/doc/pathstroke.qdoc
index 89a0182934..eea9704047 100644
--- a/examples/widgets/doc/pathstroke.qdoc
+++ b/examples/widgets/doc/pathstroke.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/pathstroke
+ \example widgets/painting/pathstroke
\title Path Stroking
In this example we show some of the various types of pens that can be
diff --git a/examples/widgets/doc/pingpong.qdoc b/examples/widgets/doc/pingpong.qdoc
index c56085d8cf..7594c87c68 100644
--- a/examples/widgets/doc/pingpong.qdoc
+++ b/examples/widgets/doc/pingpong.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example statemachine/pingpong
+ \example widgets/statemachine/pingpong
\title Ping Pong States Example
The Ping Pong States example shows how to use parallel states together
@@ -48,35 +48,35 @@
ponger state will respond by posting a \c pong event; this will cause the
\c pinger state to post a new \c ping event; and so on.
- \snippet statemachine/pingpong/main.cpp 0
+ \snippet widgets/statemachine/pingpong/main.cpp 0
Two custom events are defined, \c PingEvent and \c PongEvent.
- \snippet statemachine/pingpong/main.cpp 1
+ \snippet widgets/statemachine/pingpong/main.cpp 1
The \c Pinger class defines a state that posts a \c PingEvent to the state
machine when the state is entered.
- \snippet statemachine/pingpong/main.cpp 2
+ \snippet widgets/statemachine/pingpong/main.cpp 2
The \c PingTransition class defines a transition that is triggered by
events of type \c PingEvent, and that posts a \c PongEvent (with a delay
of 500 milliseconds) to the state machine when the transition is
triggered.
- \snippet statemachine/pingpong/main.cpp 3
+ \snippet widgets/statemachine/pingpong/main.cpp 3
The \c PongTransition class defines a transition that is triggered by
events of type \c PongEvent, and that posts a \c PingEvent (with a delay
of 500 milliseconds) to the state machine when the transition is
triggered.
- \snippet statemachine/pingpong/main.cpp 4
+ \snippet widgets/statemachine/pingpong/main.cpp 4
The main() function begins by creating a state machine and a parallel
state group.
- \snippet statemachine/pingpong/main.cpp 5
+ \snippet widgets/statemachine/pingpong/main.cpp 5
Next, the \c pinger and \c ponger states are created, with the parallel
state group as their parent state. Note that the transitions are \e
@@ -85,7 +85,7 @@
be called, and the state machine's configuration will remain the same,
which is precisely what we want in this case.
- \snippet statemachine/pingpong/main.cpp 6
+ \snippet widgets/statemachine/pingpong/main.cpp 6
Finally, the group is added to the state machine, the machine is started,
and the application event loop is entered.
diff --git a/examples/widgets/doc/pixelator.qdoc b/examples/widgets/doc/pixelator.qdoc
index 099c382c82..a44feb61fc 100644
--- a/examples/widgets/doc/pixelator.qdoc
+++ b/examples/widgets/doc/pixelator.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/pixelator
+ \example widgets/itemviews/pixelator
\title Pixelator Example
The Pixelator example shows how delegates can be used to customize the way that
@@ -60,7 +60,7 @@
The \c ImageModel class is defined as follows:
- \snippet itemviews/pixelator/imagemodel.h 0
+ \snippet widgets/itemviews/pixelator/imagemodel.h 0
Since we only require a simple, read-only table model, we only need to implement
functions to indicate the dimensions of the image and supply data to other
@@ -70,11 +70,11 @@
The constructor is trivial:
- \snippet itemviews/pixelator/imagemodel.cpp 0
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 0
The \c setImage() function sets the image that will be used by the model:
- \snippet itemviews/pixelator/imagemodel.cpp 1
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 1
The QAbstractItemModel::reset() call tells the view(s) that the model
has changed.
@@ -82,8 +82,8 @@
The \c rowCount() and \c columnCount() functions return the height and width of
the image respectively:
- \snippet itemviews/pixelator/imagemodel.cpp 2
- \snippet itemviews/pixelator/imagemodel.cpp 3
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 2
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 3
Since the image is a simple two-dimensional structure, the \c parent arguments
to these functions are unused. They both simply return the relevant size from
@@ -92,7 +92,7 @@
The \c data() function returns data for the item that corresponds to a given
model index in a format that is suitable for a particular role:
- \snippet itemviews/pixelator/imagemodel.cpp 4
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 4
In this implementation, we only check that the model index is valid, and that
the role requested is the \l{Qt::ItemDataRole}{DisplayRole}. If so, the function
@@ -105,7 +105,7 @@
The \c headerData() function is also reimplemented:
- \snippet itemviews/pixelator/imagemodel.cpp 5
+ \snippet widgets/itemviews/pixelator/imagemodel.cpp 5
We return (1, 1) as the size hint for a header item. If we
didn't, the headers would default to a larger size, preventing
@@ -116,7 +116,7 @@
The \c PixelDelegate class is defined as follows:
- \snippet itemviews/pixelator/pixeldelegate.h 0
+ \snippet widgets/itemviews/pixelator/pixeldelegate.h 0
This class provides only basic features for a delegate so, unlike the
\l{Spin Box Delegate Example}{Spin Box Delegate} example, we subclass
@@ -134,7 +134,7 @@
also called to ensure that the delegate is set up with a parent object,
if one is supplied:
- \snippet itemviews/pixelator/pixeldelegate.cpp 0
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 0
Each item is rendered by the delegate's
\l{QAbstractItemDelegate::paint()}{paint()} function. The view calls this
@@ -142,7 +142,7 @@
delegate should use to correctly draw the item, and an index to the item in
the model:
- \snippet itemviews/pixelator/pixeldelegate.cpp 1
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 1
The first task the delegate has to perform is to draw the item's background
correctly. Usually, selected items appear differently to non-selected items,
@@ -151,8 +151,8 @@
The radius of each circle is calculated in the following lines of code:
- \snippet itemviews/pixelator/pixeldelegate.cpp 3
- \snippet itemviews/pixelator/pixeldelegate.cpp 4
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 3
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 4
First, the largest possible radius of the circle is determined by taking the
smallest dimension of the style option's \c rect attribute.
@@ -161,22 +161,22 @@
scaling the brightness to fit within the item and subtracting it from the
largest possible radius.
- \snippet itemviews/pixelator/pixeldelegate.cpp 5
- \snippet itemviews/pixelator/pixeldelegate.cpp 6
- \snippet itemviews/pixelator/pixeldelegate.cpp 7
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 5
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 6
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 7
We save the painter's state, turn on antialiasing (to obtain smoother
curves), and turn off the pen.
- \snippet itemviews/pixelator/pixeldelegate.cpp 8
- \snippet itemviews/pixelator/pixeldelegate.cpp 9
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 8
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 9
The foreground of the item (the circle representing a pixel) must be
rendered using an appropriate brush. For unselected items, we will use a
solid black brush; selected items are drawn using a predefined brush from
the style option's palette.
- \snippet itemviews/pixelator/pixeldelegate.cpp 10
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 10
Finally, we paint the circle within the rectangle specified by the style
option and we call \l{QPainter::}{restore()} on the painter.
@@ -191,12 +191,12 @@
returns a size for the item based on the predefined pixel size, initially set
up in the constructor:
- \snippet itemviews/pixelator/pixeldelegate.cpp 11
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 11
The delegate's size is updated whenever the pixel size is changed.
We provide a custom slot to do this:
- \snippet itemviews/pixelator/pixeldelegate.cpp 12
+ \snippet widgets/itemviews/pixelator/pixeldelegate.cpp 12
\section1 Using The Custom Delegate
@@ -210,9 +210,9 @@
In the constructor, we set up a table view, turn off its grid, and hide its
headers:
- \snippet itemviews/pixelator/mainwindow.cpp 0
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 0
\dots
- \snippet itemviews/pixelator/mainwindow.cpp 1
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 1
This enables the items to be drawn without any gaps between them. Removing
the headers also prevents the user from adjusting the sizes of individual
@@ -226,7 +226,7 @@
The custom delegate is constructed with the main window as its parent, so
that it will be deleted correctly later, and we set it on the table view.
- \snippet itemviews/pixelator/mainwindow.cpp 2
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 2
Each item in the table view will be rendered by the \c PixelDelegate
instance.
@@ -234,21 +234,21 @@
We construct a spin box to allow the user to change the size of each "pixel"
drawn by the delegate:
- \snippet itemviews/pixelator/mainwindow.cpp 3
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 3
This spin box is connected to the custom slot we implemented in the
\c PixelDelegate class. This ensures that the delegate always draws each
pixel at the currently specified size:
- \snippet itemviews/pixelator/mainwindow.cpp 4
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 4
\dots
- \snippet itemviews/pixelator/mainwindow.cpp 5
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 5
We also connect the spin box to a slot in the \c MainWindow class. This
forces the view to take into account the new size hints for each item;
these are provided by the delegate in its \c sizeHint() function.
- \snippet itemviews/pixelator/mainwindow.cpp 6
+ \snippet widgets/itemviews/pixelator/mainwindow.cpp 6
We explicitly resize the columns and rows to match the
\uicontrol{Pixel size} combobox.
diff --git a/examples/widgets/doc/recentfiles.qdoc b/examples/widgets/doc/recentfiles.qdoc
index e2e876b088..8806057d4b 100644
--- a/examples/widgets/doc/recentfiles.qdoc
+++ b/examples/widgets/doc/recentfiles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/recentfiles
+ \example widgets/mainwindows/recentfiles
\title Recent Files Example
The Recent Files example shows how a standard File menu can be extended to show
diff --git a/examples/widgets/doc/rogue.qdoc b/examples/widgets/doc/rogue.qdoc
index 4c65dd2d6e..ed1f64e851 100644
--- a/examples/widgets/doc/rogue.qdoc
+++ b/examples/widgets/doc/rogue.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example statemachine/rogue
+ \example widgets/statemachine/rogue
\title Rogue Example
The Rogue example shows how to use the Qt state machine for event
@@ -95,7 +95,7 @@
connects the states in the machine. It is the key events from this
widget that are used by the machine.
- \snippet statemachine/rogue/window.h 0
+ \snippet widgets/statemachine/rogue/window.h 0
\c Direction specifies the direction in which the rogue is to
move. We use this in \c movePlayer(), which moves the rogue and
@@ -105,7 +105,7 @@
setting any Qt \l{Qt's Property System}{property} when entered.
More on this later.
- \snippet statemachine/rogue/window.h 1
+ \snippet widgets/statemachine/rogue/window.h 1
The \c map is an array with the characters that are currently
displayed. We set up the array in \c setupMap(), and update it
@@ -124,15 +124,15 @@
Here is the constructor of \c Window:
- \snippet statemachine/rogue/window.cpp 0
+ \snippet widgets/statemachine/rogue/window.cpp 0
\dots
- \snippet statemachine/rogue/window.cpp 1
+ \snippet widgets/statemachine/rogue/window.cpp 1
The player starts off at position (5, 5). We then set up the map
and statemachine. Let's proceed with the \c buildMachine()
function:
- \snippet statemachine/rogue/window.cpp 2
+ \snippet widgets/statemachine/rogue/window.cpp 2
We enter \c inputState when the machine is started and from the \c
quitState if the user wants to continue playing. We then set the
@@ -147,7 +147,7 @@
inputState as the target state, we would first have left and then
entered the \c inputState again.
- \snippet statemachine/rogue/window.cpp 3
+ \snippet widgets/statemachine/rogue/window.cpp 3
When we enter \c quitState, we update the status bar of the
window.
@@ -157,12 +157,12 @@
specify the key on which the transition should trigger and the
target state of the transition.
- \snippet statemachine/rogue/window.cpp 4
+ \snippet widgets/statemachine/rogue/window.cpp 4
The transition from \c inputState allows triggering the quit state
when the player types \c {q}.
- \snippet statemachine/rogue/window.cpp 5
+ \snippet widgets/statemachine/rogue/window.cpp 5
The machine is set up, so it's time to start it.
@@ -172,13 +172,13 @@
rogue to be moved (by typing 2, 4, 6, or 8) when the machine is in
the \c inputState.
- \snippet statemachine/rogue/movementtransition.h 0
+ \snippet widgets/statemachine/rogue/movementtransition.h 0
In the constructor, we tell QEventTransition to only send
\l{QEvent::}{KeyPress} events to the
\l{QAbstractTransition::}{eventTest()} function:
- \snippet statemachine/rogue/movementtransition.h 1
+ \snippet widgets/statemachine/rogue/movementtransition.h 1
The KeyPress events come wrapped in \l{QStateMachine::WrappedEvent}s. \c event
must be confirmed to be a wrapped event because Qt uses other
@@ -187,7 +187,7 @@
Let's move on to the \c onTransition() function:
- \snippet statemachine/rogue/movementtransition.h 2
+ \snippet widgets/statemachine/rogue/movementtransition.h 2
When \c onTransition() is invoked, we know that we have a
\l{QEvent::}{KeyPress} event with 2, 4, 6, or 8, and can ask \c
diff --git a/examples/widgets/doc/screenshot.qdoc b/examples/widgets/doc/screenshot.qdoc
index 2d41cf0d85..5b2743f748 100644
--- a/examples/widgets/doc/screenshot.qdoc
+++ b/examples/widgets/doc/screenshot.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example desktop/screenshot
+ \example widgets/desktop/screenshot
\title Screenshot Example
The Screenshot example shows how to take a screenshot of the
@@ -51,7 +51,7 @@
\section1 Screenshot Class Definition
- \snippet desktop/screenshot/screenshot.h 0
+ \snippet widgets/desktop/screenshot/screenshot.h 0
The \c Screenshot class inherits QWidget and is the application's
main widget. It displays the application options and a preview of
@@ -84,7 +84,7 @@
\section1 Screenshot Class Implementation
- \snippet desktop/screenshot/screenshot.cpp 0
+ \snippet widgets/desktop/screenshot/screenshot.cpp 0
In the constructor we first create the QLabel displaying the
screenshot preview.
@@ -103,7 +103,7 @@
delay and the window title, before we resize the widget to a
suitable size.
- \snippet desktop/screenshot/screenshot.cpp 1
+ \snippet widgets/desktop/screenshot/screenshot.cpp 1
The \c resizeEvent() function is reimplemented to receive the
resize events dispatched to the widget. The purpose is to scale
@@ -121,7 +121,7 @@
only is repainted (using the private \c updateScreenshotLabel()
function) when it actually changes its size.
- \snippet desktop/screenshot/screenshot.cpp 2
+ \snippet widgets/desktop/screenshot/screenshot.cpp 2
The private \c newScreenshot() slot is called when the user
requests a new screenshot; but the slot only prepares a new
@@ -139,7 +139,7 @@
specified by the \uicontrol {Screenshot Delay} option. It is \c
shootScreen() that actually performs the screenshot.
- \snippet desktop/screenshot/screenshot.cpp 3
+ \snippet widgets/desktop/screenshot/screenshot.cpp 3
The \c saveScreenshot() slot is called when the user push the \uicontrol
Save button, and it presents a file dialog using the QFileDialog
@@ -158,7 +158,7 @@
name is valid, we use the QPixmap::save() function to save the
screenshot's original pixmap in that file.
- \snippet desktop/screenshot/screenshot.cpp 4
+ \snippet widgets/desktop/screenshot/screenshot.cpp 4
The \c shootScreen() slot is called to take the screenshot. If the
user has chosen to delay the screenshot, we make the application
@@ -170,7 +170,7 @@
events from the window system and other sources are processed and
dispatched.
- \snippet desktop/screenshot/screenshot.cpp 5
+ \snippet widgets/desktop/screenshot/screenshot.cpp 5
Using the static function QApplication::primaryScreen(), we
obtain the QScreen object for the application's main screen.
@@ -187,7 +187,7 @@
Screenshot} button, and finally we make the \c Screenshot widget
visible if it was hidden during the screenshot.
- \snippet desktop/screenshot/screenshot.cpp 6
+ \snippet widgets/desktop/screenshot/screenshot.cpp 6
The \uicontrol {Hide This Window} option is enabled or disabled
depending on the delay of the screenshot. If there is no delay,
@@ -197,7 +197,7 @@
The \c updateCheckBox() slot is called whenever the user changes
the delay using the \uicontrol {Screenshot Delay} option.
- \snippet desktop/screenshot/screenshot.cpp 7
+ \snippet widgets/desktop/screenshot/screenshot.cpp 7
The private \c createOptionsGroupBox() function is called from the
constructor.
@@ -215,20 +215,20 @@
widgets are automatically reparented to the widget the layout is
installed on.
- \snippet desktop/screenshot/screenshot.cpp 8
+ \snippet widgets/desktop/screenshot/screenshot.cpp 8
The private \c createButtonsLayout() function is called from the
constructor. We create the application's buttons using the private
\c createButton() function, and add them to a QHBoxLayout.
- \snippet desktop/screenshot/screenshot.cpp 9
+ \snippet widgets/desktop/screenshot/screenshot.cpp 9
The private \c createButton() function is called from the \c
createButtonsLayout() function. It simply creates a QPushButton
with the provided text, connects it to the provided receiver and
slot, and returns a pointer to the button.
- \snippet desktop/screenshot/screenshot.cpp 10
+ \snippet widgets/desktop/screenshot/screenshot.cpp 10
The private \c updateScreenshotLabel() function is called whenever
the screenshot changes, or when a resize event changes the size of
diff --git a/examples/widgets/doc/scribble.qdoc b/examples/widgets/doc/scribble.qdoc
index 5749b9ed07..513dbe36ad 100644
--- a/examples/widgets/doc/scribble.qdoc
+++ b/examples/widgets/doc/scribble.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/scribble
+ \example widgets/widgets/scribble
\title Scribble Example
The Scribble example shows how to reimplement some of QWidget's
@@ -65,7 +65,7 @@
\section1 ScribbleArea Class Definition
- \snippet widgets/scribble/scribblearea.h 0
+ \snippet widgets/widgets/scribble/scribblearea.h 0
The \c ScribbleArea class inherits from QWidget. We reimplement
the \c mousePressEvent(), \c mouseMoveEvent() and \c
@@ -98,7 +98,7 @@
\section1 ScribbleArea Class Implementation
- \snippet widgets/scribble/scribblearea.cpp 0
+ \snippet widgets/widgets/scribble/scribblearea.cpp 0
In the constructor, we set the Qt::WA_StaticContents
attribute for the widget, indicating that the widget contents are
@@ -108,8 +108,8 @@
for widgets whose contents are static and rooted to the top-left
corner.
- \snippet widgets/scribble/scribblearea.cpp 1
- \snippet widgets/scribble/scribblearea.cpp 2
+ \snippet widgets/widgets/scribble/scribblearea.cpp 1
+ \snippet widgets/widgets/scribble/scribblearea.cpp 2
In the \c openImage() function, we load the given image. Then we
resize the loaded QImage to be at least as large as the widget in
@@ -117,8 +117,8 @@
we set the \c image member variable to be the loaded image. At
the end, we call QWidget::update() to schedule a repaint.
- \snippet widgets/scribble/scribblearea.cpp 3
- \snippet widgets/scribble/scribblearea.cpp 4
+ \snippet widgets/widgets/scribble/scribblearea.cpp 3
+ \snippet widgets/widgets/scribble/scribblearea.cpp 4
The \c saveImage() function creates a QImage object that covers
only the visible section of the actual \c image and saves it using
@@ -126,26 +126,26 @@
scribble area's \c modified variable to \c false, because there is
no unsaved data.
- \snippet widgets/scribble/scribblearea.cpp 5
- \snippet widgets/scribble/scribblearea.cpp 6
+ \snippet widgets/widgets/scribble/scribblearea.cpp 5
+ \snippet widgets/widgets/scribble/scribblearea.cpp 6
\codeline
- \snippet widgets/scribble/scribblearea.cpp 7
- \snippet widgets/scribble/scribblearea.cpp 8
+ \snippet widgets/widgets/scribble/scribblearea.cpp 7
+ \snippet widgets/widgets/scribble/scribblearea.cpp 8
The \c setPenColor() and \c setPenWidth() functions set the
current pen color and width. These values will be used for future
drawing operations.
- \snippet widgets/scribble/scribblearea.cpp 9
- \snippet widgets/scribble/scribblearea.cpp 10
+ \snippet widgets/widgets/scribble/scribblearea.cpp 9
+ \snippet widgets/widgets/scribble/scribblearea.cpp 10
The public \c clearImage() slot clears the image displayed in the
scribble area. We simply fill the entire image with white, which
corresponds to RGB value (255, 255, 255). As usual when we modify
the image, we set \c modified to \c true and schedule a repaint.
- \snippet widgets/scribble/scribblearea.cpp 11
- \snippet widgets/scribble/scribblearea.cpp 12
+ \snippet widgets/widgets/scribble/scribblearea.cpp 11
+ \snippet widgets/widgets/scribble/scribblearea.cpp 12
For mouse press and mouse release events, we use the
QMouseEvent::button() function to find out which button caused
@@ -163,8 +163,8 @@
releases the button, we call the private \c drawLineTo() function
to draw.
- \snippet widgets/scribble/scribblearea.cpp 13
- \snippet widgets/scribble/scribblearea.cpp 14
+ \snippet widgets/widgets/scribble/scribblearea.cpp 13
+ \snippet widgets/widgets/scribble/scribblearea.cpp 14
In the reimplementation of the \l
{QWidget::paintEvent()}{paintEvent()} function, we simply create
@@ -195,8 +195,8 @@
QWidget into a QImage again, we might lose some information.
\endlist
- \snippet widgets/scribble/scribblearea.cpp 15
- \snippet widgets/scribble/scribblearea.cpp 16
+ \snippet widgets/widgets/scribble/scribblearea.cpp 15
+ \snippet widgets/widgets/scribble/scribblearea.cpp 16
When the user starts the Scribble application, a resize event is
generated and an image is created and displayed in the scribble
@@ -206,8 +206,8 @@
would be very inefficient). But when the main window becomes
larger than this initial size, the image needs to be resized.
- \snippet widgets/scribble/scribblearea.cpp 17
- \snippet widgets/scribble/scribblearea.cpp 18
+ \snippet widgets/widgets/scribble/scribblearea.cpp 17
+ \snippet widgets/widgets/scribble/scribblearea.cpp 18
In \c drawLineTo(), we draw a line from the point where the mouse
was located when the last mouse press or mouse move occurred, we
@@ -220,8 +220,8 @@
inside the scribble are needs updating, to avoid a complete
repaint of the widget.
- \snippet widgets/scribble/scribblearea.cpp 19
- \snippet widgets/scribble/scribblearea.cpp 20
+ \snippet widgets/widgets/scribble/scribblearea.cpp 19
+ \snippet widgets/widgets/scribble/scribblearea.cpp 20
QImage has no nice API for resizing an image. There's a
QImage::copy() function that could do the trick, but when used to
@@ -237,7 +237,7 @@
Printing is handled by the \c print() slot:
- \snippet widgets/scribble/scribblearea.cpp 21
+ \snippet widgets/widgets/scribble/scribblearea.cpp 21
We construct a high resolution QPrinter object for the required
output format, using a QPrintDialog to ask the user to specify a
@@ -246,7 +246,7 @@
If the dialog is accepted, we perform the task of printing to the paint
device:
- \snippet widgets/scribble/scribblearea.cpp 22
+ \snippet widgets/widgets/scribble/scribblearea.cpp 22
Printing an image to a file in this way is simply a matter of
painting onto the QPrinter. We scale the image to fit within the
@@ -255,7 +255,7 @@
\section1 MainWindow Class Definition
- \snippet widgets/scribble/mainwindow.h 0
+ \snippet widgets/widgets/scribble/mainwindow.h 0
The \c MainWindow class inherits from QMainWindow. We reimplement
the \l{QWidget::closeEvent()}{closeEvent()} handler from QWidget.
@@ -272,14 +272,14 @@
\section1 MainWindow Class Implementation
- \snippet widgets/scribble/mainwindow.cpp 0
+ \snippet widgets/widgets/scribble/mainwindow.cpp 0
In the constructor, we create a scribble area which we make the
central widget of the \c MainWindow widget. Then we create the
associated actions and menus.
- \snippet widgets/scribble/mainwindow.cpp 1
- \snippet widgets/scribble/mainwindow.cpp 2
+ \snippet widgets/widgets/scribble/mainwindow.cpp 1
+ \snippet widgets/widgets/scribble/mainwindow.cpp 2
Close events are sent to widgets that the users want to close,
usually by clicking \uicontrol{File|Exit} or by clicking the \uicontrol X
@@ -294,16 +294,16 @@
\c maybeSave() returns false, the user clicked \uicontrol Cancel, so we
"ignore" the event, leaving the application unaffected by it.
- \snippet widgets/scribble/mainwindow.cpp 3
- \snippet widgets/scribble/mainwindow.cpp 4
+ \snippet widgets/widgets/scribble/mainwindow.cpp 3
+ \snippet widgets/widgets/scribble/mainwindow.cpp 4
In the \c open() slot we first give the user the opportunity to
save any modifications to the currently displayed image, before a
new image is loaded into the scribble area. Then we ask the user
to choose a file and we load the file in the \c ScribbleArea.
- \snippet widgets/scribble/mainwindow.cpp 5
- \snippet widgets/scribble/mainwindow.cpp 6
+ \snippet widgets/widgets/scribble/mainwindow.cpp 5
+ \snippet widgets/widgets/scribble/mainwindow.cpp 6
The \c save() slot is called when the users choose the \uicontrol {Save
As} menu entry, and then choose an entry from the format menu. The
@@ -326,15 +326,15 @@
Now that we know the format, we call the private \c saveFile()
function to save the currently displayed image.
- \snippet widgets/scribble/mainwindow.cpp 7
- \snippet widgets/scribble/mainwindow.cpp 8
+ \snippet widgets/widgets/scribble/mainwindow.cpp 7
+ \snippet widgets/widgets/scribble/mainwindow.cpp 8
We use the \c penColor() slot to retrieve a new color from the
user with a QColorDialog. If the user chooses a new color, we
make it the scribble area's color.
- \snippet widgets/scribble/mainwindow.cpp 9
- \snippet widgets/scribble/mainwindow.cpp 10
+ \snippet widgets/widgets/scribble/mainwindow.cpp 9
+ \snippet widgets/widgets/scribble/mainwindow.cpp 10
To retrieve a new pen width in the \c penWidth() slot, we use
QInputDialog. The QInputDialog class provides a simple
@@ -348,14 +348,14 @@
The boolean \c ok variable will be set to \c true if the user
clicked \uicontrol OK and to \c false if the user pressed \uicontrol Cancel.
- \snippet widgets/scribble/mainwindow.cpp 11
- \snippet widgets/scribble/mainwindow.cpp 12
+ \snippet widgets/widgets/scribble/mainwindow.cpp 11
+ \snippet widgets/widgets/scribble/mainwindow.cpp 12
We implement the \c about() slot to create a message box
describing what the example is designed to show.
- \snippet widgets/scribble/mainwindow.cpp 13
- \snippet widgets/scribble/mainwindow.cpp 14
+ \snippet widgets/widgets/scribble/mainwindow.cpp 13
+ \snippet widgets/widgets/scribble/mainwindow.cpp 14
In the \c createAction() function we create the actions
representing the menu entries and connect them to the appropriate
@@ -369,8 +369,8 @@
deduced the file format from the action's text, by truncating the
"...", but that would have been inelegant.
- \snippet widgets/scribble/mainwindow.cpp 15
- \snippet widgets/scribble/mainwindow.cpp 16
+ \snippet widgets/widgets/scribble/mainwindow.cpp 15
+ \snippet widgets/widgets/scribble/mainwindow.cpp 16
In the \c createMenu() function, we add the previously created
format actions to the \c saveAsMenu. Then we add the rest of the
@@ -384,8 +384,8 @@
{MainWindow}'s menu bar, which we retrieve using the
QMainWindow::menuBar() function.
- \snippet widgets/scribble/mainwindow.cpp 17
- \snippet widgets/scribble/mainwindow.cpp 18
+ \snippet widgets/widgets/scribble/mainwindow.cpp 17
+ \snippet widgets/widgets/scribble/mainwindow.cpp 18
In \c mayBeSave(), we check if there are any unsaved changes. If
there are any, we use QMessageBox to give the user a warning that
@@ -407,8 +407,8 @@
The \c maybeSave() function returns \c false if the user clicks
\uicontrol Cancel; otherwise it returns \c true.
- \snippet widgets/scribble/mainwindow.cpp 19
- \snippet widgets/scribble/mainwindow.cpp 20
+ \snippet widgets/widgets/scribble/mainwindow.cpp 19
+ \snippet widgets/widgets/scribble/mainwindow.cpp 20
In \c saveFile(), we pop up a file dialog with a file name
suggestion. The static QFileDialog::getSaveFileName() function
diff --git a/examples/widgets/doc/sdi.qdoc b/examples/widgets/doc/sdi.qdoc
index b686888797..f9911efd30 100644
--- a/examples/widgets/doc/sdi.qdoc
+++ b/examples/widgets/doc/sdi.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example mainwindows/sdi
+ \example widgets/mainwindows/sdi
\title SDI Example
The SDI example shows how to create a Single Document Interface. It uses a number of
diff --git a/examples/widgets/doc/shapedclock.qdoc b/examples/widgets/doc/shapedclock.qdoc
index 8d7b856fd6..320cae4adb 100644
--- a/examples/widgets/doc/shapedclock.qdoc
+++ b/examples/widgets/doc/shapedclock.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/shapedclock
+ \example widgets/widgets/shapedclock
\title Shaped Clock Example
The Shaped Clock example shows how to apply a widget mask to a top-level
@@ -50,7 +50,7 @@
\l{Analog Clock Example}{Analog Clock} example. The whole class definition is
presented below:
- \snippet widgets/shapedclock/shapedclock.h 0
+ \snippet widgets/widgets/shapedclock/shapedclock.h 0
The \l{QWidget::paintEvent()}{paintEvent()} implementation is the same as that found
in the \c AnalogClock class. We implement \l{QWidget::sizeHint()}{sizeHint()}
@@ -68,7 +68,7 @@
The \c ShapedClock constructor performs many of the same tasks as the \c AnalogClock
constructor. We set up a timer and connect it to the widget's update() slot:
- \snippet widgets/shapedclock/shapedclock.cpp 0
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 0
We inform the window manager that the widget is not to be decorated with a window
frame by setting the Qt::FramelessWindowHint flag on the widget. As a result, we need
@@ -76,7 +76,7 @@
Mouse button events are delivered to the \c mousePressEvent() handler:
- \snippet widgets/shapedclock/shapedclock.cpp 1
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 1
If the left mouse button is pressed over the widget, we record the displacement in
global (screen) coordinates between the top-left position of the widget's frame (even
@@ -88,7 +88,7 @@
The \c mouseMoveEvent() handler is called if the mouse is moved over the widget.
- \snippet widgets/shapedclock/shapedclock.cpp 2
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 2
If the left button is held down while the mouse is moved, the top-left corner of the
widget is moved to the point given by subtracting the \c dragPosition from the current
@@ -98,12 +98,12 @@
\l{Analog Clock Example}{Analog Clock} example for a description of the process used
to render the clock.
- \snippet widgets/shapedclock/shapedclock.cpp 3
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 3
In the \c resizeEvent() handler, we re-use some of the code from the \c paintEvent()
to determine the region of the widget that is visible to the user:
- \snippet widgets/shapedclock/shapedclock.cpp 4
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 4
Since the clock face is a circle drawn in the center of the widget, this is the region
we use as the mask.
@@ -117,7 +117,7 @@
Finally, we implement the \c sizeHint() for the widget so that it is given a reasonable
default size when it is first shown:
- \snippet widgets/shapedclock/shapedclock.cpp 5
+ \snippet widgets/widgets/shapedclock/shapedclock.cpp 5
\section1 Notes on Widget Masks
diff --git a/examples/widgets/doc/simpledommodel.qdoc b/examples/widgets/doc/simpledommodel.qdoc
index 2564c654fa..54e141d5d3 100644
--- a/examples/widgets/doc/simpledommodel.qdoc
+++ b/examples/widgets/doc/simpledommodel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/simpledommodel
+ \example widgets/itemviews/simpledommodel
\title Simple DOM Model Example
The Simple DOM Model example shows how an existing class can be adapted for use with
@@ -69,7 +69,7 @@
Let us begin by examining the \c DomModel class:
- \snippet itemviews/simpledommodel/dommodel.h 0
+ \snippet widgets/itemviews/simpledommodel/dommodel.h 0
The class definition contains all the basic functions that are needed for a
read-only model. Only the constructor and \c document() function are specific to
@@ -82,7 +82,7 @@
The \c DomItem class is used to hold information about a specific QDomNode in
the document:
- \snippet itemviews/simpledommodel/domitem.h 0
+ \snippet widgets/itemviews/simpledommodel/domitem.h 0
Each \c DomItem provides a wrapper for a QDomNode obtained from the underlying
document which contains a reference to the node, it's location in the parent node's
@@ -105,18 +105,18 @@
The constructor simply records details of the QDomNode that needs to be wrapped:
- \snippet itemviews/simpledommodel/domitem.cpp 0
- \snippet itemviews/simpledommodel/domitem.cpp 1
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 0
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 1
As a result, functions to provide the parent wrapper, the row number occupied by
the item in its parent's list of children, and the underlying QDomNode for each item
are straightforward to write:
- \snippet itemviews/simpledommodel/domitem.cpp 4
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 4
\codeline
- \snippet itemviews/simpledommodel/domitem.cpp 6
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 6
\codeline
- \snippet itemviews/simpledommodel/domitem.cpp 3
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 3
It is necessary to maintain a collection of items which can be consistently identified
by the model. For that reason, we maintain a hash of child wrapper items that, to
@@ -125,7 +125,7 @@
of the item's QDomNode, relating the row number of each child to the newly-constructed
wrapper:
- \snippet itemviews/simpledommodel/domitem.cpp 5
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 5
If a QDomNode was previously wrapped, the cached wrapper is returned; otherwise, a
new wrapper is constructed and stored for valid children, and zero is returned for
@@ -133,7 +133,7 @@
The class's destructor deletes all the child items of the wrapper:
- \snippet itemviews/simpledommodel/domitem.cpp 2
+ \snippet widgets/itemviews/simpledommodel/domitem.cpp 2
These, in turn, will delete their children and free any QDomNode objects in use.
@@ -145,7 +145,7 @@
The constructor accepts an existing document and a parent object for the model:
- \snippet itemviews/simpledommodel/dommodel.cpp 0
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 0
A shallow copy of the document is stored for future reference, and a root item is
created to provide a wrapper around the document. We assign the root item a row
@@ -154,7 +154,7 @@
Since the model only contains information about the root item, the destructor only
needs to delete this one item:
- \snippet itemviews/simpledommodel/dommodel.cpp 1
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 1
All of the child items in the tree will be deleted by the \c DomItem destructor as
their parent items are deleted.
@@ -167,7 +167,7 @@
The number of columns exposed by the model is returned by the \c columnCount()
function:
- \snippet itemviews/simpledommodel/dommodel.cpp 2
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 2
This value is fixed, and does not depend on the location or type of the underlying
node in the document. We will use these three columns to display different kinds of
@@ -176,12 +176,12 @@
Since we only implement a read-only model, the \c flags() function is straightforward
to write:
- \snippet itemviews/simpledommodel/dommodel.cpp 5
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 5
Since the model is intended for use in a tree view, the \c headerData() function only
provides a horizontal header:
- \snippet itemviews/simpledommodel/dommodel.cpp 6
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 6
The model presents the names of nodes in the first column, element attributes in the
second, and any node values in the third.
@@ -191,7 +191,7 @@
The index() function creates a model index for the item with the given row, column,
and parent in the model:
- \snippet itemviews/simpledommodel/dommodel.cpp 7
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 7
The function first has to relate the parent index to an item that contains a node
from the underlying document. If the parent index is invalid, it refers to the root
@@ -201,7 +201,7 @@
will have been created by this function, and we store pointers to item objects in
any new indexes that we create with QAbstractItemModel::createIndex():
- \snippet itemviews/simpledommodel/dommodel.cpp 8
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 8
A child item for the given row is provided by the parent item's \c child() function.
If a suitable child item was found then we call
@@ -217,7 +217,7 @@
function, and is the number of child nodes contained by the node that corresponds to
the specified model index:
- \snippet itemviews/simpledommodel/dommodel.cpp 10
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 10
To obtain the relevant node in the underlying document, we access the item via the
internal pointer stored in the model index. If an invalid index is supplied, the
@@ -228,7 +228,7 @@
provide an implementation for the \c parent() function. This returns a model index
that corresponds to the parent of a child model index supplied as its argument:
- \snippet itemviews/simpledommodel/dommodel.cpp 9
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 9
For valid indexes other than the index corresponding to the root item, we obtain
a pointer to the relevant item using the method described in the \c index() function,
@@ -243,13 +243,13 @@
the \l{Qt::DisplayRole}{display role}, returning an invalid variant for all other
requests:
- \snippet itemviews/simpledommodel/dommodel.cpp 3
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 3
As before, we obtain an item pointer for the index supplied, and use it to obtain
the underlying document node. Depending on the column specified, the data we return
is obtained in different ways:
- \snippet itemviews/simpledommodel/dommodel.cpp 4
+ \snippet widgets/itemviews/simpledommodel/dommodel.cpp 4
For the first column, we return the node's name. For the second column, we read any
attributes that the node may have, and return a string that contains a space-separated
diff --git a/examples/widgets/doc/simpletreemodel.qdoc b/examples/widgets/doc/simpletreemodel.qdoc
index c054352cb8..792a893f98 100644
--- a/examples/widgets/doc/simpletreemodel.qdoc
+++ b/examples/widgets/doc/simpletreemodel.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/simpletreemodel
+ \example widgets/itemviews/simpletreemodel
\title Simple Tree Model Example
The Simple Tree Model example shows how to create a basic, read-only
@@ -93,7 +93,7 @@
The \c TreeItem class is defined as follows:
- \snippet itemviews/simpletreemodel/treeitem.h 0
+ \snippet widgets/itemviews/simpletreemodel/treeitem.h 0
The class is a basic C++ class. It does not inherit from QObject or
provide signals and slots. It is used to hold a list of QVariants,
@@ -121,19 +121,19 @@
The constructor is only used to record the item's parent and the data
associated with each column.
- \snippet itemviews/simpletreemodel/treeitem.cpp 0
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 0
A pointer to each of the child items belonging to this item will be
stored in the \c childItems private member variable. When the class's
destructor is called, it must delete each of these to ensure that
their memory is reused:
- \snippet itemviews/simpletreemodel/treeitem.cpp 1
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 1
Since each of the child items are constructed when the model is initially
populated with data, the function to add child items is straightforward:
- \snippet itemviews/simpletreemodel/treeitem.cpp 2
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 2
Each item is able to return any of its child items when given a suitable
row number. For example, in the \l{#SimpleTreeModelStructure}{above diagram},
@@ -144,11 +144,11 @@
The \c child() function returns the child that corresponds to
the specified row number in the item's list of child items:
- \snippet itemviews/simpletreemodel/treeitem.cpp 3
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 3
The number of child items held can be found with \c childCount():
- \snippet itemviews/simpletreemodel/treeitem.cpp 4
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 4
The \c TreeModel uses this function to determine the number of rows that
exist for a given parent item.
@@ -156,7 +156,7 @@
The \c row() function reports the item's location within its parent's
list of items:
- \snippet itemviews/simpletreemodel/treeitem.cpp 8
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 8
Note that, although the root item (with no parent item) is automatically
assigned a row number of 0, this information is never used by the model.
@@ -164,17 +164,17 @@
The number of columns of data in the item is trivially returned by the
\c columnCount() function.
- \snippet itemviews/simpletreemodel/treeitem.cpp 5
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 5
Column data is returned by the \c data() function, taking advantage of
QList's ability to provide sensible default values if the column number
is out of range:
- \snippet itemviews/simpletreemodel/treeitem.cpp 6
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 6
The item's parent is found with \c parent():
- \snippet itemviews/simpletreemodel/treeitem.cpp 7
+ \snippet widgets/itemviews/simpletreemodel/treeitem.cpp 7
Note that, since the root item in the model will not have a parent, this
function will return zero in that case. We need to ensure that the model
@@ -185,7 +185,7 @@
The \c TreeModel class is defined as follows:
- \snippet itemviews/simpletreemodel/treemodel.h 0
+ \snippet widgets/itemviews/simpletreemodel/treemodel.h 0
This class is similar to most other subclasses of QAbstractItemModel that
provide read-only models. Only the form of the constructor and the
@@ -198,7 +198,7 @@
result, the constructor takes an argument containing the data that the
model will share with views and delegates:
- \snippet itemviews/simpletreemodel/treemodel.cpp 0
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 0
It is up to the constructor to create a root item for the model. This
item only contains vertical header data for convenience. We also use it
@@ -213,7 +213,7 @@
The destructor ensures that the root item and all of its descendants
are deleted when the model is destroyed:
- \snippet itemviews/simpletreemodel/treemodel.cpp 1
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 1
Since we cannot add data to the model after it is constructed and set
up, this simplifies the way that the internal tree of items is managed.
@@ -234,7 +234,7 @@
so we can guarantee that any valid model indexes that we receive will
contain a valid data pointer.
- \snippet itemviews/simpletreemodel/treemodel.cpp 6
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 6
Since the row and column arguments to this function refer to a
child item of the corresponding parent item, we obtain the item using
@@ -247,7 +247,7 @@
The way that the \c TreeItem objects are defined makes writing the
\c parent() function easy:
- \snippet itemviews/simpletreemodel/treemodel.cpp 7
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 7
We only need to ensure that we never return a model index corresponding
to the root item. To be consistent with the way that the \c index()
@@ -266,7 +266,7 @@
for the \c TreeItem that corresponds to a given model index, or the
number of top-level items if an invalid index is specified:
- \snippet itemviews/simpletreemodel/treemodel.cpp 8
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 8
Since each item manages its own column data, the \c columnCount()
function has to call the item's own \c columnCount() function to
@@ -275,13 +275,13 @@
specified, the number of columns returned is determined from the
root item:
- \snippet itemviews/simpletreemodel/treemodel.cpp 2
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 2
Data is obtained from the model via \c data(). Since the item manages
its own columns, we need to use the column number to retrieve the data
with the \c TreeItem::data() function:
- \snippet itemviews/simpletreemodel/treemodel.cpp 3
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 3
Note that we only support the \l{Qt::ItemDataRole}{DisplayRole}
in this implementation, and we also return invalid QVariant objects for
@@ -290,12 +290,12 @@
We use the \c flags() function to ensure that views know that the
model is read-only:
- \snippet itemviews/simpletreemodel/treemodel.cpp 4
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 4
The \c headerData() function returns data that we conveniently stored
in the root item:
- \snippet itemviews/simpletreemodel/treemodel.cpp 5
+ \snippet widgets/itemviews/simpletreemodel/treemodel.cpp 5
This information could have been supplied in a different way: either
specified in the constructor, or hard coded into the \c headerData()
diff --git a/examples/widgets/doc/simplewidgetmapper.qdoc b/examples/widgets/doc/simplewidgetmapper.qdoc
index 2b7cd2d79a..33e2569974 100644
--- a/examples/widgets/doc/simplewidgetmapper.qdoc
+++ b/examples/widgets/doc/simplewidgetmapper.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/simplewidgetmapper
+ \example widgets/itemviews/simplewidgetmapper
\title Simple Widget Mapper Example
The Simple Widget Mapper example shows how to use a widget mapper to display
@@ -50,7 +50,7 @@
The class provides a constructor, a slot to keep the buttons up to date,
and a private function to set up the model:
- \snippet itemviews/simplewidgetmapper/window.h Window definition
+ \snippet widgets/itemviews/simplewidgetmapper/window.h Window definition
In addition to the QDataWidgetMapper object and the controls used to make
up the user interface, we use a QStandardItemModel to hold our data.
@@ -62,7 +62,7 @@
The constructor of the \c Window class can be explained in three parts.
In the first part, we set up the widgets used for the user interface:
- \snippet itemviews/simplewidgetmapper/window.cpp Set up widgets
+ \snippet widgets/itemviews/simplewidgetmapper/window.cpp Set up widgets
We also set up the buddy relationships between various labels and the
corresponding input widgets.
@@ -70,7 +70,7 @@
Next, we set up the widget mapper, relating each input widget to a column
in the model specified by the call to \l{QDataWidgetMapper::}{setModel()}:
- \snippet itemviews/simplewidgetmapper/window.cpp Set up the mapper
+ \snippet widgets/itemviews/simplewidgetmapper/window.cpp Set up the mapper
We also connect the mapper to the \uicontrol{Next} and \uicontrol{Previous} buttons
via its \l{QDataWidgetMapper::}{toNext()} and
@@ -81,7 +81,7 @@
In the final part of the constructor, we set up the layout, placing each
of the widgets in a grid (we could also use a QFormLayout for this):
- \snippet itemviews/simplewidgetmapper/window.cpp Set up the layout
+ \snippet widgets/itemviews/simplewidgetmapper/window.cpp Set up the layout
Lastly, we set the window title and initialize the mapper by setting it to
refer to the first row in the model.
@@ -90,7 +90,7 @@
we create a standard model with 5 rows and 3 columns, and we insert some
sample names, addresses and ages into each row:
- \snippet itemviews/simplewidgetmapper/window.cpp Set up the model
+ \snippet widgets/itemviews/simplewidgetmapper/window.cpp Set up the model
As a result, each row can be treated like a record in a database, and the
widget mapper will read the data from each row, using the column numbers
@@ -104,7 +104,7 @@
user-friendly, we implement the \c{updateButtons()} slot to show when the
user is viewing the first or last records:
- \snippet itemviews/simplewidgetmapper/window.cpp Slot for updating the buttons
+ \snippet widgets/itemviews/simplewidgetmapper/window.cpp Slot for updating the buttons
If the mapper is referring to the first row in the model, the \uicontrol{Previous}
button is disabled. Similarly, the \uicontrol{Next} button is disabled if the
diff --git a/examples/widgets/doc/sipdialog.qdoc b/examples/widgets/doc/sipdialog.qdoc
index b5f18cb4be..7bd054e12d 100644
--- a/examples/widgets/doc/sipdialog.qdoc
+++ b/examples/widgets/doc/sipdialog.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/sipdialog
+ \example widgets/dialogs/sipdialog
\title SIP Dialog Example
\ingroup qtce
@@ -50,7 +50,7 @@
slot, \c desktopResized(), and a public function, \c reactToSIP(). Also,
it holds a private instance of QRect, \c desktopGeometry.
- \snippet dialogs/sipdialog/dialog.h Dialog header
+ \snippet widgets/dialogs/sipdialog/dialog.h Dialog header
\section1 Dialog Class Implementation
@@ -59,7 +59,7 @@
\l{QDesktopWidget::availableGeometry()}{availableGeometry()}. The
parameter used is \c 0 to indicate that we require the primary screen.
- \snippet dialogs/sipdialog/dialog.cpp Dialog constructor part1
+ \snippet widgets/dialogs/sipdialog/dialog.cpp Dialog constructor part1
We set the window's title to "SIP Dialog Example" and declare a QScrollArea
object, \c scrollArea. Next we instantiate a QGroupBox, \c groupBox, with
@@ -71,7 +71,7 @@
\l{QWidget::setMinimumWidth()}{minimumWidth} property to 220 pixels,
respectively.
- \snippet dialogs/sipdialog/dialog.cpp Dialog constructor part2
+ \snippet widgets/dialogs/sipdialog/dialog.cpp Dialog constructor part2
Also, all three widgets' text are set accordingly. The
\l{QGridLayout::setVerticalSpacing()}{verticalSpacing} property of
@@ -79,14 +79,14 @@
is to adapt to the different form factors of Windows Mobile. Then, we
add our widgets to the layout.
- \snippet dialogs/sipdialog/dialog.cpp Dialog constructor part3
+ \snippet widgets/dialogs/sipdialog/dialog.cpp Dialog constructor part3
The \c{scrollArea}'s widget is set to \c groupBox. We use a QHBoxLayout
object, \c layout, to contain \c scrollArea. The \c{Dialog}'s layout
is set to \c layout and the scroll area's horizontal scroll bar is turned
off.
- \snippet dialogs/sipdialog/dialog.cpp Dialog constructor part4
+ \snippet widgets/dialogs/sipdialog/dialog.cpp Dialog constructor part4
The following signals are connected to their respective slots:
\list
@@ -97,19 +97,19 @@
{workAreaResized()} signal to \c{dialog}'s \c desktopResized() slot.
\endlist
- \snippet dialogs/sipdialog/dialog.cpp Dialog constructor part5
+ \snippet widgets/dialogs/sipdialog/dialog.cpp Dialog constructor part5
The \c desktopResized() function accepts an integer, \a screen,
corresponding to the screen's index. We only invoke \c reactToSIP()
if \a screen is the primary screen (e.g. index = 0).
- \snippet dialogs/sipdialog/dialog.cpp desktopResized() function
+ \snippet widgets/dialogs/sipdialog/dialog.cpp desktopResized() function
The \c reactToSIP() function resizes \c dialog accordingly if the
desktop's available geometry changed vertically, as this change signifies
that the SIP may have been opened or closed.
- \snippet dialogs/sipdialog/dialog.cpp reactToSIP() function
+ \snippet widgets/dialogs/sipdialog/dialog.cpp reactToSIP() function
If the height has decreased, we unset the maximized window state.
Otherwise, we set the maximized window state. Lastly, we update
@@ -120,7 +120,7 @@
The \c main() function for the SIP Dialog example instantiates \c Dialog
and invokes its \l{QDialog::exec()}{exec()} function.
- \snippet dialogs/sipdialog/main.cpp main() function
+ \snippet widgets/dialogs/sipdialog/main.cpp main() function
\note Although this example uses a dialog, the techniques used here apply to
all top-level widgets respectively.
diff --git a/examples/widgets/doc/sliders.qdoc b/examples/widgets/doc/sliders.qdoc
index efc52e24d7..7c51d2cddb 100644
--- a/examples/widgets/doc/sliders.qdoc
+++ b/examples/widgets/doc/sliders.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/sliders
+ \example widgets/widgets/sliders
\title Sliders Example
Qt provides three types of slider-like widgets: QSlider,
@@ -62,7 +62,7 @@
\section1 Window Class Definition
- \snippet widgets/sliders/window.h 0
+ \snippet widgets/widgets/sliders/window.h 0
The \c Window class inherits from QWidget. It displays the slider
widgets and allows the user to set their minimum, maximum and
@@ -73,7 +73,7 @@
\section1 Window Class Implementation
- \snippet widgets/sliders/window.cpp 0
+ \snippet widgets/widgets/sliders/window.cpp 0
In the constructor we first create the two \c SlidersGroup
widgets that display the slider widgets horizontally and
@@ -85,8 +85,8 @@
widgets. The rest of the controlling mechanisms is implemented by
the same function call.
- \snippet widgets/sliders/window.cpp 1
- \snippet widgets/sliders/window.cpp 2
+ \snippet widgets/widgets/sliders/window.cpp 1
+ \snippet widgets/widgets/sliders/window.cpp 2
Then we connect the \c horizontalSliders, \c verticalSliders and
\c valueSpinBox to each other, so that the slider widgets and the
@@ -104,8 +104,8 @@
minimum and maximum values propagate through the connections we
created with \c createControls().
- \snippet widgets/sliders/window.cpp 3
- \snippet widgets/sliders/window.cpp 4
+ \snippet widgets/widgets/sliders/window.cpp 3
+ \snippet widgets/widgets/sliders/window.cpp 4
In the private \c createControls() function, we let a QGroupBox
(\c controlsGroup) display the control widgets. A group box can
@@ -150,8 +150,8 @@
bindings are inverted by default: \uicontrol PageDown increases the
current value, and \uicontrol PageUp decreases it.
- \snippet widgets/sliders/window.cpp 5
- \snippet widgets/sliders/window.cpp 6
+ \snippet widgets/widgets/sliders/window.cpp 5
+ \snippet widgets/widgets/sliders/window.cpp 6
Then we create the spin boxes. QSpinBox allows the user to choose
a value by clicking the up and down buttons or pressing the \key
@@ -166,8 +166,8 @@
a list of options to the user in a way that takes up the minimum
amount of screen space.
- \snippet widgets/sliders/window.cpp 7
- \snippet widgets/sliders/window.cpp 8
+ \snippet widgets/widgets/sliders/window.cpp 7
+ \snippet widgets/widgets/sliders/window.cpp 8
We synchronize the behavior of the control widgets and the slider
widgets through their signals and slots. We connect each control
@@ -179,7 +179,7 @@
\section1 SlidersGroup Class Definition
- \snippet widgets/sliders/slidersgroup.h 0
+ \snippet widgets/widgets/sliders/slidersgroup.h 0
The \c SlidersGroup class inherits from QGroupBox. It provides a
frame and a title, and contains a QSlider, a QScrollBar and a
@@ -193,7 +193,7 @@
\section1 SlidersGroup Class Implementation
- \snippet widgets/sliders/slidersgroup.cpp 0
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 0
First we create the slider-like widgets with the appropriate
properties. In particular we set the focus policy for each
@@ -205,24 +205,24 @@
Then we connect the widgets with each other, so that they will
stay synchronized when the current value of one of them changes.
- \snippet widgets/sliders/slidersgroup.cpp 1
- \snippet widgets/sliders/slidersgroup.cpp 2
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 1
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 2
We connect \c {dial}'s \c valueChanged() signal to the
\c{SlidersGroup}'s \c valueChanged() signal, to notify the other
widgets in the application (i.e., the control widgets) of the
changed value.
- \snippet widgets/sliders/slidersgroup.cpp 3
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 3
\codeline
- \snippet widgets/sliders/slidersgroup.cpp 4
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 4
Finally, depending on the \l {Qt::Orientation}{orientation} given
at the time of construction, we choose and create the layout for
the slider widgets within the group box.
- \snippet widgets/sliders/slidersgroup.cpp 5
- \snippet widgets/sliders/slidersgroup.cpp 6
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 5
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 6
The \c setValue() slot sets the value of the QSlider. We don't
need to explicitly call
@@ -231,21 +231,21 @@
\l{QAbstractSlider::valueChanged()}{valueChanged()} signal when
its value changes, triggering a domino effect.
- \snippet widgets/sliders/slidersgroup.cpp 7
- \snippet widgets/sliders/slidersgroup.cpp 8
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 7
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 8
\codeline
- \snippet widgets/sliders/slidersgroup.cpp 9
- \snippet widgets/sliders/slidersgroup.cpp 10
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 9
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 10
The \c setMinimum() and \c setMaximum() slots are used by the \c
Window class to set the range of the QSlider, QScrollBar, and
QDial widgets.
- \snippet widgets/sliders/slidersgroup.cpp 11
- \snippet widgets/sliders/slidersgroup.cpp 12
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 11
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 12
\codeline
- \snippet widgets/sliders/slidersgroup.cpp 13
- \snippet widgets/sliders/slidersgroup.cpp 14
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 13
+ \snippet widgets/widgets/sliders/slidersgroup.cpp 14
The \c invertAppearance() and \c invertKeyBindings() slots
control the child widgets'
diff --git a/examples/widgets/doc/spinboxdelegate.qdoc b/examples/widgets/doc/spinboxdelegate.qdoc
index 95e764dd83..9c2838f96f 100644
--- a/examples/widgets/doc/spinboxdelegate.qdoc
+++ b/examples/widgets/doc/spinboxdelegate.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/spinboxdelegate
+ \example widgets/itemviews/spinboxdelegate
\title Spin Box Delegate Example
The Spin Box Delegate example shows how to create an editor for a custom delegate in
@@ -49,7 +49,7 @@
The definition of the delegate is as follows:
- \snippet itemviews/spinboxdelegate/delegate.h 0
+ \snippet widgets/itemviews/spinboxdelegate/delegate.h 0
The delegate class declares only those functions that are needed to
create an editor widget, display it at the correct location in a view,
@@ -66,7 +66,7 @@
call the base class's constructor with the parent QObject as its
argument:
- \snippet itemviews/spinboxdelegate/delegate.cpp 0
+ \snippet widgets/itemviews/spinboxdelegate/delegate.cpp 0
Since the delegate is a subclass of QItemDelegate, the data it retrieves
from the model is displayed in a default style, and we do not need to
@@ -76,7 +76,7 @@
spin box that restricts values from the model to integers from 0 to 100
inclusive.
- \snippet itemviews/spinboxdelegate/delegate.cpp 1
+ \snippet widgets/itemviews/spinboxdelegate/delegate.cpp 1
We install an event filter on the spin box to ensure that it behaves in
a way that is consistent with other delegates. The implementation for
@@ -85,7 +85,7 @@
The \c setEditorData() function reads data from the model, converts it
to an integer value, and writes it to the editor widget.
- \snippet itemviews/spinboxdelegate/delegate.cpp 2
+ \snippet widgets/itemviews/spinboxdelegate/delegate.cpp 2
Since the view treats delegates as ordinary QWidget instances, we have
to use a static cast before we can set the value in the spin box.
@@ -93,7 +93,7 @@
The \c setModelData() function reads the contents of the spin box, and
writes it to the model.
- \snippet itemviews/spinboxdelegate/delegate.cpp 3
+ \snippet widgets/itemviews/spinboxdelegate/delegate.cpp 3
We call \l{QSpinBox::interpretText()}{interpretText()} to make sure that
we obtain the most up-to-date value in the spin box.
@@ -102,7 +102,7 @@
geometry using the information supplied in the style option. This is the
minimum that the delegate must do in this case.
- \snippet itemviews/spinboxdelegate/delegate.cpp 4
+ \snippet widgets/itemviews/spinboxdelegate/delegate.cpp 4
More complex editor widgets may divide the rectangle available in
\c{option.rect} between different child widgets if required.
@@ -118,7 +118,7 @@
model to hold some data, set up a table view to use the data in the
model, and construct a custom delegate to use for editing:
- \snippet itemviews/spinboxdelegate/main.cpp 0
+ \snippet widgets/itemviews/spinboxdelegate/main.cpp 0
The table view is informed about the delegate, and will use it to
display each of the items. Since the delegate is a subclass of
@@ -127,13 +127,13 @@
We insert some arbitrary data into the model for demonstration purposes:
- \snippet itemviews/spinboxdelegate/main.cpp 1
- \snippet itemviews/spinboxdelegate/main.cpp 2
+ \snippet widgets/itemviews/spinboxdelegate/main.cpp 1
+ \snippet widgets/itemviews/spinboxdelegate/main.cpp 2
Finally, the table view is displayed with a window title, and we start
the application's event loop:
- \snippet itemviews/spinboxdelegate/main.cpp 3
+ \snippet widgets/itemviews/spinboxdelegate/main.cpp 3
Each of the cells in the table can now be edited in the usual way, but
the spin box ensures that the data returned to the model is always
diff --git a/examples/widgets/doc/spinboxes.qdoc b/examples/widgets/doc/spinboxes.qdoc
index ed4eea6a60..38a3483a47 100644
--- a/examples/widgets/doc/spinboxes.qdoc
+++ b/examples/widgets/doc/spinboxes.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/spinboxes
+ \example widgets/widgets/spinboxes
\title Spin Boxes Example
The Spin Boxes example shows how to use the many different types of spin boxes
@@ -43,7 +43,7 @@
The \c Window class inherits QWidget and contains two slots that are used
to provide interactive features:
- \snippet widgets/spinboxes/window.h 0
+ \snippet widgets/widgets/spinboxes/window.h 0
The private functions are used to set up each type of spin box in the window.
We use member variables to keep track of various widgets so that they can
@@ -54,7 +54,7 @@
The constructor simply calls private functions to set up the different types
of spin box used in the example, and places each group in a layout:
- \snippet widgets/spinboxes/window.cpp 0
+ \snippet widgets/widgets/spinboxes/window.cpp 0
We use the layout to manage the arrangement of the window's child widgets,
and change the window title.
@@ -63,7 +63,7 @@
QSpinBox widgets inside it with descriptive labels to indicate the types of
input they expect.
- \snippet widgets/spinboxes/window.cpp 1
+ \snippet widgets/widgets/spinboxes/window.cpp 1
The first spin box shows the simplest way to use QSpinBox. It accepts values
from -20 to 20, the current value can be increased or decreased by 1 with
@@ -73,7 +73,7 @@
The second spin box uses a larger step size and displays a suffix to
provide more information about the type of data the number represents:
- \snippet widgets/spinboxes/window.cpp 2
+ \snippet widgets/widgets/spinboxes/window.cpp 2
This spin box also displays a
\l{QAbstractSpinBox::specialValueText}{special value} instead of the minimum
@@ -82,12 +82,12 @@
The third spin box shows how a prefix can be used:
- \snippet widgets/spinboxes/window.cpp 4
+ \snippet widgets/widgets/spinboxes/window.cpp 4
For simplicity, we show a spin box with a prefix and no suffix. It is also
possible to use both at the same time.
- \snippet widgets/spinboxes/window.cpp 5
+ \snippet widgets/widgets/spinboxes/window.cpp 5
The rest of the function sets up a layout for the group box and places each
of the widgets inside it.
@@ -95,7 +95,7 @@
The \c createDateTimeEdits() function constructs another group box with a
selection of spin boxes used for editing dates and times.
- \snippet widgets/spinboxes/window.cpp 6
+ \snippet widgets/widgets/spinboxes/window.cpp 6
The first spin box is a QDateEdit widget that is able to accept dates
within a given range specified using QDate values. The arrow buttons and
@@ -104,7 +104,7 @@
The second spin box is a QTimeEdit widget:
- \snippet widgets/spinboxes/window.cpp 7
+ \snippet widgets/widgets/spinboxes/window.cpp 7
Acceptable values for the time are defined using QTime values.
@@ -113,19 +113,19 @@
times for a meeting. These widgets will be updated when the user changes a
format string.
- \snippet widgets/spinboxes/window.cpp 8
+ \snippet widgets/widgets/spinboxes/window.cpp 8
The format string used for the date time editor, which is also shown in the
string displayed by the label, is chosen from a set of strings in a combobox:
- \snippet widgets/spinboxes/window.cpp 9
+ \snippet widgets/widgets/spinboxes/window.cpp 9
\codeline
- \snippet widgets/spinboxes/window.cpp 10
+ \snippet widgets/widgets/spinboxes/window.cpp 10
A signal from this combobox is connected to a slot in the \c Window class
(shown later).
- \snippet widgets/spinboxes/window.cpp 11
+ \snippet widgets/widgets/spinboxes/window.cpp 11
Each child widget of the group box in placed in a layout.
@@ -133,13 +133,13 @@
format string in the combobox. The display format for the QDateTimeEdit
widget is set using the raw string passed by the signal:
- \snippet widgets/spinboxes/window.cpp 12
+ \snippet widgets/widgets/spinboxes/window.cpp 12
Depending on the visible sections in the widget, we set a new date or time
range, and update the associated label to provide relevant information for
the user:
- \snippet widgets/spinboxes/window.cpp 13
+ \snippet widgets/widgets/spinboxes/window.cpp 13
When the format string is changed, there will be an appropriate label and
entry widget for dates, times, or both types of input.
@@ -147,7 +147,7 @@
The \c createDoubleSpinBoxes() function constructs three spin boxes that are
used to input double-precision floating point numbers:
- \snippet widgets/spinboxes/window.cpp 14
+ \snippet widgets/widgets/spinboxes/window.cpp 14
Before the QDoubleSpinBox widgets are constructed, we create a spin box to
control how many decimal places they show. By default, only two decimal places
@@ -158,23 +158,23 @@
same range, step size, and default value as the first spin box in the
\c createSpinBoxes() function:
- \snippet widgets/spinboxes/window.cpp 15
+ \snippet widgets/widgets/spinboxes/window.cpp 15
However, this spin box also allows non-integer values to be entered.
The second spin box displays a suffix and shows a special value instead
of the minimum value:
- \snippet widgets/spinboxes/window.cpp 16
+ \snippet widgets/widgets/spinboxes/window.cpp 16
The third spin box displays a prefix instead of a suffix:
- \snippet widgets/spinboxes/window.cpp 17
+ \snippet widgets/widgets/spinboxes/window.cpp 17
We connect the QSpinBox widget that specifies the precision to a slot in
the \c Window class.
- \snippet widgets/spinboxes/window.cpp 18
+ \snippet widgets/widgets/spinboxes/window.cpp 18
The rest of the function places each of the widgets into a layout for the
group box.
@@ -182,7 +182,7 @@
The \c changePrecision() slot is called when the user changes the value in
the precision spin box:
- \snippet widgets/spinboxes/window.cpp 19
+ \snippet widgets/widgets/spinboxes/window.cpp 19
This function simply uses the integer supplied by the signal to specify the
number of decimal places in each of the QDoubleSpinBox widgets. Each one
diff --git a/examples/widgets/doc/spreadsheet.qdoc b/examples/widgets/doc/spreadsheet.qdoc
index 7364f022cb..ececf0af09 100644
--- a/examples/widgets/doc/spreadsheet.qdoc
+++ b/examples/widgets/doc/spreadsheet.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/spreadsheet
+ \example widgets/itemviews/spreadsheet
\title Spreadsheet
The Spreadsheet example shows how a table view can be used to create a
diff --git a/examples/widgets/doc/standarddialogs.qdoc b/examples/widgets/doc/standarddialogs.qdoc
index b56642b6ec..05596ac84c 100644
--- a/examples/widgets/doc/standarddialogs.qdoc
+++ b/examples/widgets/doc/standarddialogs.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/standarddialogs
+ \example widgets/dialogs/standarddialogs
\title Standard Dialogs Example
The Standard Dialogs example shows the standard dialogs that are provided by Qt.
diff --git a/examples/widgets/doc/stardelegate.qdoc b/examples/widgets/doc/stardelegate.qdoc
index aba8864c2b..2887006778 100644
--- a/examples/widgets/doc/stardelegate.qdoc
+++ b/examples/widgets/doc/stardelegate.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example itemviews/stardelegate
+ \example widgets/itemviews/stardelegate
\title Star Delegate Example
The Star Delegate example shows how to create a delegate that
@@ -77,7 +77,7 @@
Here's the definition of the \c StarDelegate class:
- \snippet itemviews/stardelegate/stardelegate.h 0
+ \snippet widgets/itemviews/stardelegate/stardelegate.h 0
All public functions are reimplemented virtual functions from
QItemDelegate to provide custom rendering and editing.
@@ -88,7 +88,7 @@
reimplemented from QItemDelegate and is called whenever the view
needs to repaint an item:
- \snippet itemviews/stardelegate/stardelegate.cpp 0
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 0
The function is invoked once for each item, represented by a
QModelIndex object from the model. If the data stored in the item
@@ -107,7 +107,7 @@
The \l{QAbstractItemDelegate::}{createEditor()} function is
called when the user starts editing an item:
- \snippet itemviews/stardelegate/stardelegate.cpp 2
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 2
If the item is a \c StarRating, we create a \c StarEditor and
connect its \c editingFinished() signal to our \c
@@ -116,7 +116,7 @@
Here's the implementation of \c commitAndCloseEditor():
- \snippet itemviews/stardelegate/stardelegate.cpp 5
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 5
When the user is done editing, we emit
\l{QAbstractItemDelegate::}{commitData()} and
@@ -128,7 +128,7 @@
called when an editor is created to initialize it with data
from the model:
- \snippet itemviews/stardelegate/stardelegate.cpp 3
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 3
We simply call \c setStarRating() on the editor.
@@ -136,11 +136,11 @@
called when editing is finished, to commit data from the editor
to the model:
- \snippet itemviews/stardelegate/stardelegate.cpp 4
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 4
The \c sizeHint() function returns an item's preferred size:
- \snippet itemviews/stardelegate/stardelegate.cpp 1
+ \snippet widgets/itemviews/stardelegate/stardelegate.cpp 1
We simply forward the call to \c StarRating.
@@ -149,7 +149,7 @@
The \c StarEditor class was used when implementing \c
StarDelegate. Here's the class definition:
- \snippet itemviews/stardelegate/stareditor.h 0
+ \snippet widgets/itemviews/stardelegate/stareditor.h 0
The class lets the user edit a \c StarRating by moving the mouse
over the editor. It emits the \c editingFinished() signal when
@@ -164,7 +164,7 @@
Let's start with the constructor:
- \snippet itemviews/stardelegate/stareditor.cpp 0
+ \snippet widgets/itemviews/stardelegate/stareditor.cpp 0
We enable \l{QWidget::setMouseTracking()}{mouse tracking} on the
widget so we can follow the cursor even when the user doesn't
@@ -176,32 +176,32 @@
The \l{QWidget::}{paintEvent()} function is reimplemented from
QWidget:
- \snippet itemviews/stardelegate/stareditor.cpp 1
+ \snippet widgets/itemviews/stardelegate/stareditor.cpp 1
We simply call \c StarRating::paint() to draw the stars, just
like we did when implementing \c StarDelegate.
- \snippet itemviews/stardelegate/stareditor.cpp 2
+ \snippet widgets/itemviews/stardelegate/stareditor.cpp 2
In the mouse event handler, we call \c setStarCount() on the
private data member \c myStarRating to reflect the current cursor
position, and we call QWidget::update() to force a repaint.
- \snippet itemviews/stardelegate/stareditor.cpp 3
+ \snippet widgets/itemviews/stardelegate/stareditor.cpp 3
When the user releases a mouse button, we simply emit the \c
editingFinished() signal.
- \snippet itemviews/stardelegate/stareditor.cpp 4
+ \snippet widgets/itemviews/stardelegate/stareditor.cpp 4
The \c starAtPosition() function uses basic linear algebra to
find out which star is under the cursor.
\section1 StarRating Class Definition
- \snippet itemviews/stardelegate/starrating.h 0
+ \snippet widgets/itemviews/stardelegate/starrating.h 0
\codeline
- \snippet itemviews/stardelegate/starrating.h 1
+ \snippet widgets/itemviews/stardelegate/starrating.h 1
The \c StarRating class represents a rating as a number of stars.
In addition to holding the data, it is also capable of painting
@@ -219,12 +219,12 @@
The constructor initializes \c myStarCount and \c myMaxStarCount,
and sets up the polygons used to draw stars and diamonds:
- \snippet itemviews/stardelegate/starrating.cpp 0
+ \snippet widgets/itemviews/stardelegate/starrating.cpp 0
The \c paint() function paints the stars in this \c StarRating
object on a paint device:
- \snippet itemviews/stardelegate/starrating.cpp 2
+ \snippet widgets/itemviews/stardelegate/starrating.cpp 2
We first set the pen and brush we will use for painting. The \c
mode parameter can be either \c Editable or \c ReadOnly. If \c
@@ -239,7 +239,7 @@
The \c sizeHint() function returns the preferred size for an area
to paint the stars on:
- \snippet itemviews/stardelegate/starrating.cpp 1
+ \snippet widgets/itemviews/stardelegate/starrating.cpp 1
The preferred size is just enough to paint the maximum number of
stars. The function is called by both \c StarDelegate::sizeHint()
@@ -249,7 +249,7 @@
Here's the program's \c main() function:
- \snippet itemviews/stardelegate/main.cpp 5
+ \snippet widgets/itemviews/stardelegate/main.cpp 5
The \c main() function creates a QTableWidget and sets a \c
StarDelegate on it. \l{QAbstractItemView::}{DoubleClicked} and
@@ -261,13 +261,13 @@
The \c populateTableWidget() function fills the QTableWidget with
data:
- \snippet itemviews/stardelegate/main.cpp 0
- \snippet itemviews/stardelegate/main.cpp 1
+ \snippet widgets/itemviews/stardelegate/main.cpp 0
+ \snippet widgets/itemviews/stardelegate/main.cpp 1
\dots
- \snippet itemviews/stardelegate/main.cpp 2
- \snippet itemviews/stardelegate/main.cpp 3
+ \snippet widgets/itemviews/stardelegate/main.cpp 2
+ \snippet widgets/itemviews/stardelegate/main.cpp 3
\codeline
- \snippet itemviews/stardelegate/main.cpp 4
+ \snippet widgets/itemviews/stardelegate/main.cpp 4
Notice the call to qVariantFromValue to convert a \c
StarRating to a QVariant.
diff --git a/examples/widgets/doc/states.qdoc b/examples/widgets/doc/states.qdoc
index 52eda087f1..887c9e03d7 100644
--- a/examples/widgets/doc/states.qdoc
+++ b/examples/widgets/doc/states.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/states
+ \example widgets/animation/states
\title States Example
The States example shows how to use the Qt state machine to play
diff --git a/examples/widgets/doc/stickman.qdoc b/examples/widgets/doc/stickman.qdoc
index cffdb64822..d224b0ee2b 100644
--- a/examples/widgets/doc/stickman.qdoc
+++ b/examples/widgets/doc/stickman.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/stickman
+ \example widgets/animation/stickman
\title Stickman Example
The Stickman example shows how to animate transitions in a state machine to implement key frame
@@ -51,12 +51,12 @@
creating states that assign values to the the "position" properties of each of the nodes in the
skeleton graph.
- \snippet animation/stickman/lifecycle.cpp 1
+ \snippet widgets/animation/stickman/lifecycle.cpp 1
The states are then bound together with signal transitions that listen to the
propertiesAssigned() signal.
- \snippet animation/stickman/lifecycle.cpp 2
+ \snippet widgets/animation/stickman/lifecycle.cpp 2
The last frame state is given a transition to the first one, so that the animation will loop
until it is interrupted when a transition out from the animation state is taken. To get smooth
@@ -65,7 +65,7 @@
and will be selected by default when taking any transition that leads into a state that assigns
values to these properties.
- \snippet animation/stickman/lifecycle.cpp 3
+ \snippet widgets/animation/stickman/lifecycle.cpp 3
Several such animation states are constructed, and are placed together as children of a top
level "alive" state which represents the stickman life cycle. Transitions go from the parent
@@ -81,18 +81,18 @@
a custom transition type called LightningSrikesTransition which samples every second and
triggers at random (one out of fifty times on average.)
- \snippet animation/stickman/lifecycle.cpp 4
+ \snippet widgets/animation/stickman/lifecycle.cpp 4
When it triggers, the machine will first enter a "lightningBlink" state which uses a timer to
pause for a brief period of time while the background color of the scene is white. This gives us
a flash effect when the lightning strikes.
- \snippet animation/stickman/lifecycle.cpp 5
+ \snippet widgets/animation/stickman/lifecycle.cpp 5
We start and stop a QTimer object when entering and exiting the state. Then we transition into
the "dead" state when the timer times out.
- \snippet animation/stickman/lifecycle.cpp 0
+ \snippet widgets/animation/stickman/lifecycle.cpp 0
When the machine is in the "dead" state, it will be unresponsive. This is because the "dead"
state has no transitions leading out.
diff --git a/examples/widgets/doc/styles.qdoc b/examples/widgets/doc/styles.qdoc
index f8be98d2da..6dbe3304af 100644
--- a/examples/widgets/doc/styles.qdoc
+++ b/examples/widgets/doc/styles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/styles
+ \example widgets/widgets/styles
\title Styles Example
The Styles example illustrates how to create custom widget
@@ -67,7 +67,7 @@
Here's the definition of the \c NorwegianWoodStyle class:
- \snippet widgets/styles/norwegianwoodstyle.h 0
+ \snippet widgets/widgets/styles/norwegianwoodstyle.h 0
The public functions are all declared in QStyle (QMotifStyle's
grandparent class) and reimplemented here to override the Motif
@@ -78,7 +78,7 @@
We will now review the implementation of the \c
NorwegianWoodStyle class.
- \snippet widgets/styles/norwegianwoodstyle.cpp 0
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 0
The \c polish() function is reimplemented from QStyle. It takes a
QPalette as a reference and adapts the palette to fit the style.
@@ -114,7 +114,7 @@
buttonImage. This image will be used for filling buttons that the
user is holding down.
- \snippet widgets/styles/norwegianwoodstyle.cpp 1
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 1
We initialize the palette. Palettes have various
\l{QPalette::ColorRole}{color roles}, such as QPalette::Base
@@ -156,8 +156,8 @@
Let's move on to the other functions reimplemented from
QMotifStyle:
- \snippet widgets/styles/norwegianwoodstyle.cpp 3
- \snippet widgets/styles/norwegianwoodstyle.cpp 4
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 3
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 4
This QStyle::polish() overload is called once on every widget
drawn using the style. We reimplement it to set the Qt::WA_Hover
@@ -167,8 +167,8 @@
render push buttons and comboboxes differently when the mouse
pointer is over them.
- \snippet widgets/styles/norwegianwoodstyle.cpp 5
- \snippet widgets/styles/norwegianwoodstyle.cpp 6
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 5
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 6
This QStyle::unpolish() overload is called to undo any
modification done to the widget in \c polish(). For simplicity,
@@ -177,8 +177,8 @@
widgets (e.g., using a QMap<QWidget *, bool>) and restore it in
\c unpolish().
- \snippet widgets/styles/norwegianwoodstyle.cpp 7
- \snippet widgets/styles/norwegianwoodstyle.cpp 8
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 7
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 8
The \l{QStyle::pixelMetric()}{pixelMetric()} function returns the
size in pixels for a certain user interface element. By
@@ -197,8 +197,8 @@
For all other QStyle::PixelMetric elements, we use the Motif
settings.
- \snippet widgets/styles/norwegianwoodstyle.cpp 9
- \snippet widgets/styles/norwegianwoodstyle.cpp 10
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 9
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 10
The \l{QStyle::styleHint()}{styleHint()} function returns some
hints to widgets or to the base style (in our case QMotifStyle)
@@ -209,8 +209,8 @@
QStyle::SH_EtchDisabledText hint, meaning that disabled text is
rendered with an embossed look (as QWindowsStyle does).
- \snippet widgets/styles/norwegianwoodstyle.cpp 11
- \snippet widgets/styles/norwegianwoodstyle.cpp 12
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 11
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 12
The \l{QStyle::drawPrimitive()}{drawPrimitive()} function is
called by Qt widgets to draw various fundamental graphical
@@ -241,8 +241,8 @@
QStyle::State_MouseOver flag to be set when the mouse is over the
widget.
- \snippet widgets/styles/norwegianwoodstyle.cpp 13
- \snippet widgets/styles/norwegianwoodstyle.cpp 14
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 13
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 14
The \c roundRect variable is a QPainterPath. A QPainterPath is is
a vectorial specification of a shape. Any shape (rectangle,
@@ -252,10 +252,10 @@
\c roundRectPath() function is a private function; we will come
back to it later.
- \snippet widgets/styles/norwegianwoodstyle.cpp 15
- \snippet widgets/styles/norwegianwoodstyle.cpp 16
- \snippet widgets/styles/norwegianwoodstyle.cpp 17
- \snippet widgets/styles/norwegianwoodstyle.cpp 18
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 15
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 16
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 17
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 18
We define two variables, \c brush and \c darker, and initialize
them based on the state of the button:
@@ -287,11 +287,11 @@
performs a dynamic cast; if \c option is not a
QStyleOptionButton, qstyleoption_cast() returns a null pointer.
- \snippet widgets/styles/norwegianwoodstyle.cpp 19
- \snippet widgets/styles/norwegianwoodstyle.cpp 20
- \snippet widgets/styles/norwegianwoodstyle.cpp 21
- \snippet widgets/styles/norwegianwoodstyle.cpp 22
- \snippet widgets/styles/norwegianwoodstyle.cpp 23
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 19
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 20
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 21
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 22
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 23
We turn on antialiasing on QPainter. Antialiasing is a technique
that reduces the visual distortion that occurs when the edges of
@@ -306,8 +306,8 @@
semi-transparent black color (a black color with an alpha channel
of 63) to make the area darker if \c darker is true.
- \snippet widgets/styles/norwegianwoodstyle.cpp 24
- \snippet widgets/styles/norwegianwoodstyle.cpp 25
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 24
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 25
Next, we draw the outline. The top-left half of the outline and
the bottom-right half of the outline are drawn using different
@@ -318,7 +318,7 @@
\l{QAbstractButton::checked}{checked}, we invert the two
\l{QPen}s to give a sunken look to the button.
- \snippet widgets/styles/norwegianwoodstyle.cpp 26
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 26
We draw the top-left part of the outline by calling
QPainter::drawPath() with an appropriate
@@ -340,9 +340,9 @@
pass the \c -reverse command-line option to the application. This
option is recognized by the QApplication constructor.
- \snippet widgets/styles/norwegianwoodstyle.cpp 32
- \snippet widgets/styles/norwegianwoodstyle.cpp 33
- \snippet widgets/styles/norwegianwoodstyle.cpp 34
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 32
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 33
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 34
The bottom-right part of the outline is drawn in a similar
fashion. Then we draw a one-pixel wide outline around the entire
@@ -354,8 +354,8 @@
base style. Let's now turn to the other \c NorwegianWoodStyle
member functions:
- \snippet widgets/styles/norwegianwoodstyle.cpp 35
- \snippet widgets/styles/norwegianwoodstyle.cpp 36
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 35
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 36
We reimplement QStyle::drawControl() to draw the text on a
QPushButton in a bright color when the button is
@@ -368,8 +368,8 @@
QPalette::ButtonText be the same as the QPalette::BrightText
component (unless the widget is disabled).
- \snippet widgets/styles/norwegianwoodstyle.cpp 37
- \snippet widgets/styles/norwegianwoodstyle.cpp 38
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 37
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 38
The \c setTexture() function is a private function that sets the
\l{QBrush::texture()}{texture} component of the \l{QBrush}es for
@@ -378,8 +378,8 @@
inactive). We used it to initialize the Norwegian Wood palette in
\c polish(QPalette &).
- \snippet widgets/styles/norwegianwoodstyle.cpp 39
- \snippet widgets/styles/norwegianwoodstyle.cpp 40
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 39
+ \snippet widgets/widgets/styles/norwegianwoodstyle.cpp 40
The \c roundRectPath() function is a private function that
constructs a QPainterPath object for round buttons. The path
@@ -397,13 +397,13 @@
class, which contains the most common Qt widgets and allows the
user to change style dynamically. Here's the class definition:
- \snippet widgets/styles/widgetgallery.h 0
+ \snippet widgets/widgets/styles/widgetgallery.h 0
\dots
- \snippet widgets/styles/widgetgallery.h 1
+ \snippet widgets/widgets/styles/widgetgallery.h 1
Here's the \c WidgetGallery constructor:
- \snippet widgets/styles/widgetgallery.cpp 0
+ \snippet widgets/widgets/styles/widgetgallery.cpp 0
We start by creating child widgets. The \uicontrol Style combobox is
initialized with all the styles known to QStyleFactory, in
@@ -411,8 +411,8 @@
private functions that set up the various parts of the \c
WidgetGallery.
- \snippet widgets/styles/widgetgallery.cpp 1
- \snippet widgets/styles/widgetgallery.cpp 2
+ \snippet widgets/widgets/styles/widgetgallery.cpp 1
+ \snippet widgets/widgets/styles/widgetgallery.cpp 2
We connect the \uicontrol Style combobox to the \c changeStyle()
private slot, the \uicontrol{Use style's standard palette} check box to
@@ -420,20 +420,20 @@
box to the child widgets'
\l{QWidget::setDisabled()}{setDisabled()} slot.
- \snippet widgets/styles/widgetgallery.cpp 3
- \snippet widgets/styles/widgetgallery.cpp 4
+ \snippet widgets/widgets/styles/widgetgallery.cpp 3
+ \snippet widgets/widgets/styles/widgetgallery.cpp 4
Finally, we put the child widgets in layouts.
- \snippet widgets/styles/widgetgallery.cpp 5
- \snippet widgets/styles/widgetgallery.cpp 6
+ \snippet widgets/widgets/styles/widgetgallery.cpp 5
+ \snippet widgets/widgets/styles/widgetgallery.cpp 6
When the user changes the style in the combobox, we call
QApplication::setStyle() to dynamically change the style of the
application.
- \snippet widgets/styles/widgetgallery.cpp 7
- \snippet widgets/styles/widgetgallery.cpp 8
+ \snippet widgets/widgets/styles/widgetgallery.cpp 7
+ \snippet widgets/widgets/styles/widgetgallery.cpp 8
If the user turns the \uicontrol{Use style's standard palette} on, the
current style's \l{QStyle::standardPalette()}{standard palette}
@@ -443,8 +443,8 @@
always override the palette with our own palette in \c
NorwegianWoodStyle::polish().
- \snippet widgets/styles/widgetgallery.cpp 9
- \snippet widgets/styles/widgetgallery.cpp 10
+ \snippet widgets/widgets/styles/widgetgallery.cpp 9
+ \snippet widgets/widgets/styles/widgetgallery.cpp 10
The \c advanceProgressBar() slot is called at regular intervals
to advance the progress bar. Since we don't know how long the
@@ -454,8 +454,8 @@
We will review \c createProgressBar() in a moment.
- \snippet widgets/styles/widgetgallery.cpp 11
- \snippet widgets/styles/widgetgallery.cpp 12
+ \snippet widgets/widgets/styles/widgetgallery.cpp 11
+ \snippet widgets/widgets/styles/widgetgallery.cpp 12
The \c createTopLeftGroupBox() function creates the QGroupBox
that occupies the top-left corner of the \c WidgetGallery. We
@@ -463,7 +463,7 @@
createBottomLeftTabWidget(), and \c createBottomRightGroupBox()
functions, which are very similar.
- \snippet widgets/styles/widgetgallery.cpp 13
+ \snippet widgets/widgets/styles/widgetgallery.cpp 13
In \c createProgressBar(), we create a QProgressBar at the bottom
of the \c WidgetGallery and connect its
diff --git a/examples/widgets/doc/stylesheet.qdoc b/examples/widgets/doc/stylesheet.qdoc
index af45411f8c..4a520e7bc8 100644
--- a/examples/widgets/doc/stylesheet.qdoc
+++ b/examples/widgets/doc/stylesheet.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/stylesheet
+ \example widgets/widgets/stylesheet
\title Style Sheet Example
The Style Sheet Example shows how to use style sheets.
diff --git a/examples/widgets/doc/sub-attaq.qdoc b/examples/widgets/doc/sub-attaq.qdoc
index ae00eb0926..b2884eb0a9 100644
--- a/examples/widgets/doc/sub-attaq.qdoc
+++ b/examples/widgets/doc/sub-attaq.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example animation/sub-attaq
+ \example widgets/animation/sub-attaq
\title Sub-Attaq
This example shows Qt's ability to combine \l{The Animation Framework}{the animation framework}
diff --git a/examples/widgets/doc/syntaxhighlighter.qdoc b/examples/widgets/doc/syntaxhighlighter.qdoc
index 272152a3a1..e74cc342a4 100644
--- a/examples/widgets/doc/syntaxhighlighter.qdoc
+++ b/examples/widgets/doc/syntaxhighlighter.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example richtext/syntaxhighlighter
+ \example widgets/richtext/syntaxhighlighter
\title Syntax Highlighter Example
The Syntax Highlighter example shows how to perform simple syntax
@@ -53,7 +53,7 @@
\section1 Highlighter Class Definition
- \snippet richtext/syntaxhighlighter/highlighter.h 0
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.h 0
To provide your own syntax highlighting, you must subclass
QSyntaxHighlighter, reimplement the \l
@@ -79,8 +79,8 @@
applied. In this example, we have also chosen to define our
highlighting rules in the constructor:
- \snippet richtext/syntaxhighlighter/highlighter.cpp 0
- \snippet richtext/syntaxhighlighter/highlighter.cpp 1
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 0
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 1
First we define a keyword rule which recognizes the most common
C++ keywords. We give the \c keywordFormat a bold, dark blue
@@ -88,11 +88,11 @@
format to a HighlightingRule object and append the object to our
list of rules.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 2
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 2
\codeline
- \snippet richtext/syntaxhighlighter/highlighter.cpp 4
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 4
\codeline
- \snippet richtext/syntaxhighlighter/highlighter.cpp 5
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 5
Then we create a format that we will apply to Qt class names. The
class names will be rendered with a dark magenta color and a bold
@@ -106,9 +106,9 @@
expressions and are stored in HighlightingRule objects with the
associated format.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 3
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 3
\codeline
- \snippet richtext/syntaxhighlighter/highlighter.cpp 6
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 6
The C++ language has two variations of comments: The single line
comment (\c //) and the multiline comment (\c{/*...}\starslash). The single
@@ -126,7 +126,7 @@
function. At this point we only specify the multiline comment's
color.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 7
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 7
The highlightBlock() function is called automatically whenever it
is necessary by the rich text engine, i.e. when there are text
@@ -154,7 +154,7 @@
This process is repeated until the last occurrence of the pattern
in the current text block is found.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 8
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 8
To deal with constructs that can span several text blocks (like
the C++ multiline comment), it is necessary to know the end state
@@ -180,7 +180,7 @@
syntax highlighting rules are applied we initialize the current
block state to 0.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 9
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 9
If the previous block state was "in comment" (\c
{previousBlockState() == 1}), we start the search for an end
@@ -188,8 +188,8 @@
previousBlockState() returns 0, we start the search at the
location of the first occurrence of a start expression.
- \snippet richtext/syntaxhighlighter/highlighter.cpp 10
- \snippet richtext/syntaxhighlighter/highlighter.cpp 11
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 10
+ \snippet widgets/richtext/syntaxhighlighter/highlighter.cpp 11
When an end expression is found, we calculate the length of the
comment and apply the multiline comment format. Then we search for
@@ -206,7 +206,7 @@
application with an instance of the class and pass it the document
upon which you want the highlighting to be applied.
- \snippet richtext/syntaxhighlighter/mainwindow.h 0
+ \snippet widgets/richtext/syntaxhighlighter/mainwindow.h 0
In this example we declare a pointer to a \c Highlighter instance
which we later will initialize in the private \c setupEditor()
@@ -219,12 +219,12 @@
central widget of the application. Finally we set the main
window's title.
- \snippet richtext/syntaxhighlighter/mainwindow.cpp 0
+ \snippet widgets/richtext/syntaxhighlighter/mainwindow.cpp 0
We initialize and install the \c Highlighter object in the private
setupEditor() convenience function:
- \snippet richtext/syntaxhighlighter/mainwindow.cpp 1
+ \snippet widgets/richtext/syntaxhighlighter/mainwindow.cpp 1
First we create the font we want to use in the editor, then we
create the editor itself which is an instance of the QTextEdit
diff --git a/examples/widgets/doc/tabdialog.qdoc b/examples/widgets/doc/tabdialog.qdoc
index 98983d124b..dea17807a3 100644
--- a/examples/widgets/doc/tabdialog.qdoc
+++ b/examples/widgets/doc/tabdialog.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/tabdialog
+ \example widgets/dialogs/tabdialog
\title Tab Dialog Example
The Tab Dialog example shows how to construct a tab dialog using the
@@ -52,7 +52,7 @@
only contain the class constructor and a private data member for
the QTabWidget:
- \snippet dialogs/tabdialog/tabdialog.h 3
+ \snippet widgets/dialogs/tabdialog/tabdialog.h 3
In the example, the widget will be used as a top-level window, but
we define the constructor so that it can take a parent widget. This
@@ -64,7 +64,7 @@
The constructor calls the QDialog constructor and creates a QFileInfo
object for the specified filename.
- \snippet dialogs/tabdialog/tabdialog.cpp 0
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 0
The tab widget is populated with three custom widgets that each
contain information about the file. We construct each of these
@@ -74,16 +74,16 @@
We create two standard push buttons, and connect each of them to
the appropriate slots in the dialog:
- \snippet dialogs/tabdialog/tabdialog.cpp 1
- \snippet dialogs/tabdialog/tabdialog.cpp 3
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 1
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 3
We arrange the tab widget above the buttons in the dialog:
- \snippet dialogs/tabdialog/tabdialog.cpp 4
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 4
Finally, we set the dialog's title:
- \snippet dialogs/tabdialog/tabdialog.cpp 5
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 5
Each of the tabs are subclassed from QWidget, and only provide
constructors.
@@ -93,7 +93,7 @@
The GeneralTab widget definition is simple because we are only interested
in displaying the contents of a widget within a tab:
- \snippet dialogs/tabdialog/tabdialog.h 0
+ \snippet widgets/dialogs/tabdialog/tabdialog.h 0
\section1 GeneralTab Class Implementation
@@ -101,14 +101,14 @@
passed by the TabDialog. Various widgets for this purpose, and these
are arranged within a vertical layout:
- \snippet dialogs/tabdialog/tabdialog.cpp 6
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 6
\section1 PermissionsTab Class Definition
Like the GeneralTab, the PermissionsTab is just used as a placeholder
widget for its children:
- \snippet dialogs/tabdialog/tabdialog.h 1
+ \snippet widgets/dialogs/tabdialog/tabdialog.h 1
\section1 PermissionsTab Class Implementation
@@ -116,19 +116,19 @@
displaying details of the file permissions and owner in widgets that are
arranged in nested layouts:
- \snippet dialogs/tabdialog/tabdialog.cpp 7
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 7
\section1 ApplicationsTab Class Definition
The ApplicationsTab is another placeholder widget that is mostly
cosmetic:
- \snippet dialogs/tabdialog/tabdialog.h 2
+ \snippet widgets/dialogs/tabdialog/tabdialog.h 2
\section1 ApplicationsTab Class Implementation
The ApplicationsTab does not show any useful information, but could be
used as a template for a more complicated example:
- \snippet dialogs/tabdialog/tabdialog.cpp 8
+ \snippet widgets/dialogs/tabdialog/tabdialog.cpp 8
*/
diff --git a/examples/widgets/doc/tablet.qdoc b/examples/widgets/doc/tablet.qdoc
index 846a9a357b..4ca9df675d 100644
--- a/examples/widgets/doc/tablet.qdoc
+++ b/examples/widgets/doc/tablet.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/tablet
+ \example widgets/widgets/tablet
\title Tablet Example
This example shows how to use a Wacom tablet in Qt applications.
@@ -79,7 +79,7 @@
The \c MainWindow creates a \c TabletCanvas and sets it as its
center widget.
- \snippet widgets/tablet/mainwindow.h 0
+ \snippet widgets/widgets/tablet/mainwindow.h 0
The QActions let the user select if the tablets pressure and
tilt should change the pen width, color alpha component and color
@@ -97,7 +97,7 @@
We start width a look at the constructor \c MainWindow():
- \snippet widgets/tablet/mainwindow.cpp 0
+ \snippet widgets/widgets/tablet/mainwindow.cpp 0
In the constructor we create the canvas, actions, and menus.
We set the canvas as the center widget. We also initialize the
@@ -106,14 +106,14 @@
Here is the implementation of \c brushColorAct():
- \snippet widgets/tablet/mainwindow.cpp 1
+ \snippet widgets/widgets/tablet/mainwindow.cpp 1
We let the user pick a color with a QColorDialog. If it is valid,
we set a new drawing color with \c setColor().
Here is the implementation of \c alphaActionTriggered():
- \snippet widgets/tablet/mainwindow.cpp 2
+ \snippet widgets/widgets/tablet/mainwindow.cpp 2
The \c TabletCanvas class supports two ways by which the alpha
channel of the drawing color can be changed: tablet pressure and
@@ -122,14 +122,14 @@
Here is the implementation of \c lineWidthActionTriggered():
- \snippet widgets/tablet/mainwindow.cpp 3
+ \snippet widgets/widgets/tablet/mainwindow.cpp 3
We check which action is selected in \c lineWidthGroup, and set
how the canvas should change the drawing line width.
Here is the implementation of \c saturationActionTriggered():
- \snippet widgets/tablet/mainwindow.cpp 4
+ \snippet widgets/widgets/tablet/mainwindow.cpp 4
We check which action is selected in \c colorSaturationGroup, and
set how the canvas should change the color saturation of the
@@ -137,7 +137,7 @@
Here is the implementation of \c saveAct():
- \snippet widgets/tablet/mainwindow.cpp 5
+ \snippet widgets/widgets/tablet/mainwindow.cpp 5
We use the QFileDialog to let the user select a file to save the
drawing in. It is the \c TabletCanvas that save the drawing, so we
@@ -145,7 +145,7 @@
Here is the implementation of \c loadAct():
- \snippet widgets/tablet/mainwindow.cpp 6
+ \snippet widgets/widgets/tablet/mainwindow.cpp 6
We let the user select the image file to be opened with
a QFileDialog; we then ask the canvas to load the image with \c
@@ -153,7 +153,7 @@
Here is the implementation of \c aboutAct():
- \snippet widgets/tablet/mainwindow.cpp 7
+ \snippet widgets/widgets/tablet/mainwindow.cpp 7
We show a message box with a short description of the example.
@@ -164,9 +164,9 @@
Here is the implementation of \c createActions:
- \snippet widgets/tablet/mainwindow.cpp 8
+ \snippet widgets/widgets/tablet/mainwindow.cpp 8
\dots
- \snippet widgets/tablet/mainwindow.cpp 9
+ \snippet widgets/widgets/tablet/mainwindow.cpp 9
We want the user to be able to choose if the drawing color's
alpha component should be changed by the tablet pressure or tilt.
@@ -177,11 +177,11 @@
triggered() signal is emitted when an action is checked.
\dots
- \snippet widgets/tablet/mainwindow.cpp 10
+ \snippet widgets/widgets/tablet/mainwindow.cpp 10
Here is the implementation of \c createMenus():
- \snippet widgets/tablet/mainwindow.cpp 11
+ \snippet widgets/widgets/tablet/mainwindow.cpp 11
We create the menus of the example and add the actions to them.
@@ -191,7 +191,7 @@
The \c TabletCanvas class provides a surface on which the
user can draw with a tablet.
- \snippet widgets/tablet/tabletcanvas.h 0
+ \snippet widgets/widgets/tablet/tabletcanvas.h 0
The canvas can change the alpha channel, color saturation,
and line width of the drawing. We have one enum for each of
@@ -217,28 +217,28 @@
We start with a look at the constructor:
- \snippet widgets/tablet/tabletcanvas.cpp 0
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 0
In the constructor we initialize our class variables. We need
to draw the background of our pixmap, as the default is gray.
Here is the implementation of \c saveImage():
- \snippet widgets/tablet/tabletcanvas.cpp 1
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 1
QPixmap implements functionality to save itself to disk, so we
simply call \l{QPixmap::}{save()}.
Here is the implementation of \c loadImage():
- \snippet widgets/tablet/tabletcanvas.cpp 2
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 2
We simply call \l{QPixmap::}{load()}, which loads the image in \a
file.
Here is the implementation of \c tabletEvent():
- \snippet widgets/tablet/tabletcanvas.cpp 3
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 3
We get three kind of events to this function: TabletPress,
TabletRelease, and TabletMove, which is generated when a device
@@ -251,13 +251,13 @@
Here is the implementation of \c paintEvent():
- \snippet widgets/tablet/tabletcanvas.cpp 4
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 4
We simply draw the pixmap to the top left of the widget.
Here is the implementation of \c paintPixmap():
- \snippet widgets/tablet/tabletcanvas.cpp 5
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 5
In this function we draw on the pixmap based on the movement of the
device. If the device used on the tablet is a stylus we want to draw a
@@ -272,7 +272,7 @@
density; we select the style based on the tangential pressure in
\c brushPattern().
- \snippet widgets/tablet/tabletcanvas.cpp 6
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 6
We return a brush style with a point density that increases with
the tangential pressure.
@@ -282,7 +282,7 @@
colorSaturationType, and \c myColor. We will examine the code to
set up \c myBrush and \c myPen for each of these variables:
- \snippet widgets/tablet/tabletcanvas.cpp 7
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 7
We fetch the current drawingcolor's hue, saturation, value,
and alpha values. \c hValue and \c vValue are set to the
@@ -292,7 +292,7 @@
is between the device and the perpendicular of the tablet (see
QTabletEvent for an illustration).
- \snippet widgets/tablet/tabletcanvas.cpp 8
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 8
The alpha channel of QColor is given as a number between 0
and 255 where 0 is transparent and 255 is opaque.
@@ -303,20 +303,20 @@
the tablet. We select the largest of the vertical and horizontal
tilt value.
- \snippet widgets/tablet/tabletcanvas.cpp 9
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 9
The colorsaturation is given as a number between 0 and 255. It is
set with \l{QColor::}{setHsv()}. We can set the tilt values
directly, but must multiply the pressure to a number between 0 and
255.
- \snippet widgets/tablet/tabletcanvas.cpp 10
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 10
The width of the pen increases with the pressure. When the pen
width is controlled with the tilt we let the width increse with
the angle between the device and the perpendicular of the tablet.
- \snippet widgets/tablet/tabletcanvas.cpp 11
+ \snippet widgets/widgets/tablet/tabletcanvas.cpp 11
We finally check whether the pointer is the stylus or the eraser.
If it is the eraser, we set the color to the background color of
@@ -329,7 +329,7 @@
We inherit QApplication in this class because we want to
reimplement the \l{QApplication::}{event()} function.
- \snippet widgets/tablet/tabletapplication.h 0
+ \snippet widgets/widgets/tablet/tabletapplication.h 0
We keep a \c TabletCanvas we send the device type of the events we
handle in the \c event() function to. The TabletEnterProximity
@@ -344,7 +344,7 @@
Here is the implementation of \c event():
- \snippet widgets/tablet/tabletapplication.cpp 0
+ \snippet widgets/widgets/tablet/tabletapplication.cpp 0
We use this function to handle the TabletEnterProximity and
TabletLeaveProximity events, which is generated when a device
@@ -359,7 +359,7 @@
Here is the examples \c main() function:
- \snippet widgets/tablet/main.cpp 0
+ \snippet widgets/widgets/tablet/main.cpp 0
In the \c main() function we create a \c MainWinow and display it
as a top level window. We use the \c TabletApplication class. We
diff --git a/examples/widgets/doc/tetrix.qdoc b/examples/widgets/doc/tetrix.qdoc
index 1a30845024..f7ee009b8d 100644
--- a/examples/widgets/doc/tetrix.qdoc
+++ b/examples/widgets/doc/tetrix.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/tetrix
+ \example widgets/widgets/tetrix
\title Tetrix Example
The Tetrix example is a Qt version of the classic Tetrix game.
@@ -70,7 +70,7 @@
The \c TetrixWindow class is used to display the game information and contains
the playing area:
- \snippet widgets/tetrix/tetrixwindow.h 0
+ \snippet widgets/widgets/tetrix/tetrixwindow.h 0
We use private member variables for the board, various display widgets, and
buttons to allow the user to start a new game, pause the current game, and quit.
@@ -83,7 +83,7 @@
The constructor sets up the user interface elements for the game:
- \snippet widgets/tetrix/tetrixwindow.cpp 0
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 0
We begin by constructing a \c TetrixBoard instance for the playing area and a
label that shows the next piece to be dropped into the playing area; the label
@@ -93,13 +93,13 @@
lines removed. These initially show default values, and will be filled in
when a game begins:
- \snippet widgets/tetrix/tetrixwindow.cpp 1
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 1
Three buttons with shortcuts are constructed so that the user can start a
new game, pause the current game, and quit the application:
- \snippet widgets/tetrix/tetrixwindow.cpp 2
- \snippet widgets/tetrix/tetrixwindow.cpp 3
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 2
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 3
These buttons are configured so that they never receive the keyboard focus;
we want the keyboard focus to remain with the \c TetrixBoard instance so that
@@ -110,8 +110,8 @@
and \uicontrol{Pause} buttons to the board, and from the \uicontrol{Quit} button to the
application's \l{QApplication::}{quit()} slot.
- \snippet widgets/tetrix/tetrixwindow.cpp 4
- \snippet widgets/tetrix/tetrixwindow.cpp 5
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 4
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 5
Signals from the board are also connected to the LCD widgets for the purpose of
updating the score, number of lives, and lines removed from the playing area.
@@ -120,7 +120,7 @@
along with some labels that we create with the \c createLabel() convenience
function:
- \snippet widgets/tetrix/tetrixwindow.cpp 6
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 6
Finally, we set the grid layout on the widget, give the window a title, and
resize it to an appropriate size.
@@ -128,7 +128,7 @@
The \c createLabel() convenience function simply creates a new label on the
heap, gives it an appropriate alignment, and returns it to the caller:
- \snippet widgets/tetrix/tetrixwindow.cpp 7
+ \snippet widgets/widgets/tetrix/tetrixwindow.cpp 7
Since each label will be used in the widget's layout, it will become a child
of the \c TetrixWindow widget and, as a result, it will be deleted when the
@@ -140,7 +140,7 @@
playing area, including its shape, position, and the range of positions it can
occupy on the board:
- \snippet widgets/tetrix/tetrixpiece.h 0
+ \snippet widgets/widgets/tetrix/tetrixpiece.h 0
Each shape contains four blocks, and these are defined by the \c coords private
member variable. Additionally, each piece has a high-level description that is
@@ -155,7 +155,7 @@
The \c setRandomShape() function is used to select a random shape for a piece:
- \snippet widgets/tetrix/tetrixpiece.cpp 0
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 0
For convenience, it simply chooses a random shape from the \c TetrixShape enum
and calls the \c setShape() function to perform the task of positioning the
@@ -164,8 +164,8 @@
The \c setShape() function uses a look-up table of pieces to associate each
shape with an array of block positions:
- \snippet widgets/tetrix/tetrixpiece.cpp 1
- \snippet widgets/tetrix/tetrixpiece.cpp 2
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 1
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 2
These positions are read from the table into the piece's own array of positions,
and the piece's internal shape information is updated to use the new shape.
@@ -179,24 +179,24 @@
The \c minX() and \c maxX() functions return the minimum and maximum horizontal
coordinates occupied by the blocks that make up the piece:
- \snippet widgets/tetrix/tetrixpiece.cpp 3
- \snippet widgets/tetrix/tetrixpiece.cpp 4
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 3
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 4
Similarly, the \c minY() and \c maxY() functions return the minimum and maximum
vertical coordinates occupied by the blocks:
- \snippet widgets/tetrix/tetrixpiece.cpp 5
- \snippet widgets/tetrix/tetrixpiece.cpp 6
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 5
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 6
The \c rotatedLeft() function returns a new piece with the same shape as an
existing piece, but rotated counter-clockwise by 90 degrees:
- \snippet widgets/tetrix/tetrixpiece.cpp 7
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 7
Similarly, the \c rotatedRight() function returns a new piece with the same
shape as an existing piece, but rotated clockwise by 90 degrees:
- \snippet widgets/tetrix/tetrixpiece.cpp 9
+ \snippet widgets/widgets/tetrix/tetrixpiece.cpp 9
These last two functions enable each piece to create rotated copies of itself.
@@ -204,7 +204,7 @@
The \c TetrixBoard class inherits from QFrame and contains the game logic and display features:
- \snippet widgets/tetrix/tetrixboard.h 0
+ \snippet widgets/widgets/tetrix/tetrixboard.h 0
Apart from the \c setNextPieceLabel() function and the \c start() and \c pause()
public slots, we only provide public functions to reimplement QWidget::sizeHint()
@@ -214,7 +214,7 @@
The rest of the functionality is provided by reimplementations of protected event
handlers and private functions:
- \snippet widgets/tetrix/tetrixboard.h 1
+ \snippet widgets/widgets/tetrix/tetrixboard.h 1
The board is composed of a fixed-size array whose elements correspond to
spaces for individual blocks. Each element in the array contains a \c TetrixShape
@@ -233,20 +233,20 @@
keyboard input will be received by the widget by using Qt::StrongFocus for the
focus policy, and initialize the game state:
- \snippet widgets/tetrix/tetrixboard.cpp 0
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 0
The first (next) piece is also set up with a random shape.
The \c setNextPieceLabel() function is used to pass in an externally-constructed
label to the board, so that it can be shown alongside the playing area:
- \snippet widgets/tetrix/tetrixboard.cpp 1
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 1
We provide a reasonable size hint and minimum size hint for the board, based on
the size of the space for each block in the playing area:
- \snippet widgets/tetrix/tetrixboard.cpp 2
- \snippet widgets/tetrix/tetrixboard.cpp 3
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 2
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 3
By using a minimum size hint, we indicate to the layout in the parent widget
that the board should not shrink below a minimum size.
@@ -254,7 +254,7 @@
A new game is started when the \c start() slot is called. This resets the
game's state, the player's score and level, and the contents of the board:
- \snippet widgets/tetrix/tetrixboard.cpp 4
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 4
We also emit signals to inform other components of these changes before creating
a new piece that is ready to be dropped into the playing area. We start the
@@ -263,8 +263,8 @@
The \c pause() slot is used to temporarily stop the current game by stopping the
internal timer:
- \snippet widgets/tetrix/tetrixboard.cpp 5
- \snippet widgets/tetrix/tetrixboard.cpp 6
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 5
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 6
We perform checks to ensure that the game can only be paused if it is already
running and not already paused.
@@ -273,7 +273,7 @@
calling the base class's implementation of \l{QWidget::}{paintEvent()} before
constructing a QPainter for use on the board:
- \snippet widgets/tetrix/tetrixboard.cpp 7
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 7
Since the board is a subclass of QFrame, we obtain a QRect that covers the area
\e inside the frame decoration before drawing our own content.
@@ -287,22 +287,22 @@
For each space on the board that is occupied by a piece, we call the
\c drawSquare() function to draw a block at that position.
- \snippet widgets/tetrix/tetrixboard.cpp 8
- \snippet widgets/tetrix/tetrixboard.cpp 9
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 8
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 9
Spaces that are not occupied by blocks are left blank.
Unlike the existing pieces on the board, the current piece is drawn
block-by-block at its current position:
- \snippet widgets/tetrix/tetrixboard.cpp 10
- \snippet widgets/tetrix/tetrixboard.cpp 11
- \snippet widgets/tetrix/tetrixboard.cpp 12
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 10
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 11
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 12
The \c keyPressEvent() handler is called whenever the player presses a key while
the \c TetrixBoard widget has the keyboard focus.
- \snippet widgets/tetrix/tetrixboard.cpp 13
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 13
If there is no current game, the game is running but paused, or if there is no
current shape to control, we simply pass on the event to the base class.
@@ -311,7 +311,7 @@
control the current piece and, if so, we call the relevant function to handle
the input:
- \snippet widgets/tetrix/tetrixboard.cpp 14
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 14
In the case where the player presses a key that we are not interested in, we
again pass on the event to the base class's implementation of
@@ -321,9 +321,9 @@
instance times out. We need to check that the event we receive corresponds to
our timer. If it does, we can update the board:
- \snippet widgets/tetrix/tetrixboard.cpp 15
- \snippet widgets/tetrix/tetrixboard.cpp 16
- \snippet widgets/tetrix/tetrixboard.cpp 17
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 15
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 16
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 17
If a row (or line) has just been filled, we create a new piece and reset the
timer; otherwise we move the current piece down by one row. We let the base
@@ -332,14 +332,14 @@
The \c clearBoard() function simply fills the board with the
\c TetrixShape::NoShape value:
- \snippet widgets/tetrix/tetrixboard.cpp 18
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 18
The \c dropDown() function moves the current piece down as far as possible on
the board, either until it is touching the bottom of the playing area or it is
stacked on top of another piece:
- \snippet widgets/tetrix/tetrixboard.cpp 19
- \snippet widgets/tetrix/tetrixboard.cpp 20
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 19
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 20
The number of rows the piece has dropped is recorded and passed to the
\c pieceDropped() function so that the player's score can be updated.
@@ -348,7 +348,7 @@
(line), either when the user presses the \uicontrol{D} key or when the piece is
scheduled to move:
- \snippet widgets/tetrix/tetrixboard.cpp 21
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 21
If the piece cannot drop down by one line, we call the \c pieceDropped() function
with zero as the argument to indicate that it cannot fall any further, and that
@@ -359,23 +359,23 @@
and, if no lines have been removed, creating a new piece to replace the current
one:
- \snippet widgets/tetrix/tetrixboard.cpp 22
- \snippet widgets/tetrix/tetrixboard.cpp 23
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 22
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 23
We call \c removeFullLines() each time a piece has been dropped. This scans
the board from bottom to top, looking for blank spaces on each row.
- \snippet widgets/tetrix/tetrixboard.cpp 24
- \snippet widgets/tetrix/tetrixboard.cpp 25
- \snippet widgets/tetrix/tetrixboard.cpp 26
- \snippet widgets/tetrix/tetrixboard.cpp 27
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 24
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 25
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 26
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 27
If a row contains no blank spaces, the rows above it are copied down by one row
to compress the stack of pieces, the top row on the board is cleared, and the
number of full lines found is incremented.
- \snippet widgets/tetrix/tetrixboard.cpp 28
- \snippet widgets/tetrix/tetrixboard.cpp 29
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 28
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 29
If some lines have been removed, the player's score and the total number of lines
removed are updated. The \c linesRemoved() and \c scoreChanged() signals are
@@ -390,8 +390,8 @@
The \c newPiece() function places the next available piece at the top of the
board, and creates a new piece with a random shape:
- \snippet widgets/tetrix/tetrixboard.cpp 30
- \snippet widgets/tetrix/tetrixboard.cpp 31
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 30
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 31
We place a new piece in the middle of the board at the top. The game is over if
the piece can't move, so we unset its shape to prevent it from being drawn, stop
@@ -400,21 +400,21 @@
The \c showNextPiece() function updates the label that shows the next piece to
be dropped:
- \snippet widgets/tetrix/tetrixboard.cpp 32
- \snippet widgets/tetrix/tetrixboard.cpp 33
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 32
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 33
We draw the piece's component blocks onto a pixmap that is then set on the label.
The \c tryMove() function is used to determine whether a piece can be positioned
at the specified coordinates:
- \snippet widgets/tetrix/tetrixboard.cpp 34
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 34
We examine the spaces on the board that the piece needs to occupy and, if they
are already occupied by other pieces, we return \c false to indicate that the
move has failed.
- \snippet widgets/tetrix/tetrixboard.cpp 35
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 35
If the piece could be placed on the board at the desired location, we update the
current piece and its position, update the widget, and return \c true to indicate
@@ -423,7 +423,7 @@
The \c drawSquare() function draws the blocks (normally squares) that make up
each piece using different colors for pieces with different shapes:
- \snippet widgets/tetrix/tetrixboard.cpp 36
+ \snippet widgets/widgets/tetrix/tetrixboard.cpp 36
We obtain the color to use from a look-up table that relates each shape to an
RGB value, and use the painter provided to draw the block at the specified
diff --git a/examples/widgets/doc/textedit.qdoc b/examples/widgets/doc/textedit.qdoc
index 1bb596eb6e..1eb762aa3d 100644
--- a/examples/widgets/doc/textedit.qdoc
+++ b/examples/widgets/doc/textedit.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example richtext/textedit
+ \example widgets/richtext/textedit
\title Text Edit
The Text Edit example shows Qt's rich text editing facilities in action,
diff --git a/examples/widgets/doc/tooltips.qdoc b/examples/widgets/doc/tooltips.qdoc
index e06f080a93..17015cefe1 100644
--- a/examples/widgets/doc/tooltips.qdoc
+++ b/examples/widgets/doc/tooltips.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/tooltips
+ \example widgets/widgets/tooltips
\title Tool Tips Example
The Tool Tips example shows how to provide static and dynamic tool
@@ -63,7 +63,7 @@
\section1 SortingBox Class Definition
- \snippet widgets/tooltips/sortingbox.h 0
+ \snippet widgets/widgets/tooltips/sortingbox.h 0
The \c SortingBox class inherits QWidget, and it is the Tooltips
application's main widget. We reimplement several of the event
@@ -79,7 +79,7 @@
In addition we need three private slots to make the user able to
create new shape items.
- \snippet widgets/tooltips/sortingbox.h 1
+ \snippet widgets/widgets/tooltips/sortingbox.h 1
We also create several private functions: We use the \c
initialItemPosition(), \c initialItemColor() and \c
@@ -93,7 +93,7 @@
randomItemPosition() and \c randomItemColor() functions to create
new shape items.
- \snippet widgets/tooltips/sortingbox.h 2
+ \snippet widgets/widgets/tooltips/sortingbox.h 2
We keep all the shape items in a QList, and we keep three
QPainterPath objects holding the shapes of a circle, a square and
@@ -102,7 +102,7 @@
\section1 SortingBox Class Implementation
- \snippet widgets/tooltips/sortingbox.cpp 0
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 0
In the constructor, we first set the Qt::WA_StaticContents
attribute on the widget. This attribute indicates that the widget
@@ -110,7 +110,7 @@
widget will receive paint events only for the newly visible part
of itself.
- \snippet widgets/tooltips/sortingbox.cpp 1
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 1
To be able to show the appropriate tooltips while the user is
moving the cursor around, we need to enable mouse tracking for the
@@ -122,13 +122,13 @@
enabled, the widget receives mouse move events even if no buttons
are pressed.
- \snippet widgets/tooltips/sortingbox.cpp 2
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 2
A widget's background role defines the brush from the widget's
palette that is used to render the background, and QPalette::Base
is typically white.
- \snippet widgets/tooltips/sortingbox.cpp 3
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 3
After creating the application's tool buttons using the private \c
createToolButton() function, we construct the shapes of a circle,
@@ -141,14 +141,14 @@
but they can be drawn many times using only calls to
QPainter::drawPath().
- \snippet widgets/tooltips/sortingbox.cpp 4
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 4
Then we set the window title, resize the widget to a suitable
size, and finally create three initial shape items using the
private \c createShapeItem(), \c initialItemPosition() and \c
initialItemColor() functions.
- \snippet widgets/tooltips/sortingbox.cpp 5
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 5
QWidget::event() is the main event handler and receives all the
widget's events. Normally, we recommend reimplementing one of the
@@ -158,7 +158,7 @@
reason we reimplement the main event handler, and the first thing
we need to do is to determine the event's type:
- \snippet widgets/tooltips/sortingbox.cpp 6
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 6
If the type is QEvent::ToolTip, we cast the event to a QHelpEvent,
otherwise we propagate the event using the QWidget::event()
@@ -178,7 +178,7 @@
QToolTip::showText() function needs the event's position in global
coordinates provided by QHelpEvent::globalPos().
- \snippet widgets/tooltips/sortingbox.cpp 7
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 7
The \c resizeEvent() function is reimplemented to receive the
resize events dispatched to the widget. It makes sure that the
@@ -187,14 +187,14 @@
aligned in the application's bottom right corner, so each time the
main widget is resized we update the buttons geometry.
- \snippet widgets/tooltips/sortingbox.cpp 8
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 8
The \c paintEvent() function is reimplemented to receive paint
events for the widget. We create a QPainter for the \c SortingBox
widget, and run through the list of created shape items, drawing
each item at its defined position.
- \snippet widgets/tooltips/sortingbox.cpp 9
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 9
The painter will by default draw all the shape items at position
(0,0) in the \c SortingBox widget. The QPainter::translate()
@@ -204,7 +204,7 @@
drawn, otherwise the next shape item will appear at a position
relative to the item we drawed last.
- \snippet widgets/tooltips/sortingbox.cpp 10
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 10
The QPainter::setBrush() function sets the current brush used by
the painter. When the provided argument is a QColor, the function
@@ -213,7 +213,7 @@
QPainter::drawPath() function draws the given path using the
current pen for outline and the current brush for filling.
- \snippet widgets/tooltips/sortingbox.cpp 11
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 11
The \c mousePressEvent() function is reimplemented to receive the
mouse press events dispatched to the widget. It determines if an
@@ -230,7 +230,7 @@
repaint; instead it schedules a paint event for processing when Qt
returns to the main event loop.
- \snippet widgets/tooltips/sortingbox.cpp 12
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 12
The \c mouseMoveEvent() function is reimplemented to receive mouse
move events for the widget. If the left mouse button is pressed
@@ -239,7 +239,7 @@
corresponding to the offset between the positions of the current
mouse event and the previous one.
- \snippet widgets/tooltips/sortingbox.cpp 13
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 13
The \c mouseReleaseEvent() function is reimplemented to receive
the mouse release events dispatched to the widget. If the left
@@ -250,18 +250,18 @@
now. To move the item further, the user will need to press the
left mouse button again.
- \snippet widgets/tooltips/sortingbox.cpp 14
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 14
\codeline
- \snippet widgets/tooltips/sortingbox.cpp 15
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 15
\codeline
- \snippet widgets/tooltips/sortingbox.cpp 16
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 16
The \c createNewCircle(), \c createNewSquare() and \c
createNewTriangle() slots simply create new shape items, using the
private \c createShapeItem(), \c randomItemPosition() and \c
randomItemColor() functions.
- \snippet widgets/tooltips/sortingbox.cpp 17
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 17
In the \c itemAt() function, we run through the list of created
shape items to check if the given position is contained within the
@@ -273,7 +273,7 @@
-1. We run through the list backwards to get the index of the
uppermost shape item in case several items cover the position.
- \snippet widgets/tooltips/sortingbox.cpp 18
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 18
The \c moveItemTo() function moves the shape item in motion, and
the parameter \c pos is the position of a mouse event. First we
@@ -289,13 +289,13 @@
rectangle's top left corner, regardless of the item's previous
position.
- \snippet widgets/tooltips/sortingbox.cpp 19
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 19
Finally, we update the previous mouse event position, and make a
call to the QWidget::update() function to make the item appear at
its new position.
- \snippet widgets/tooltips/sortingbox.cpp 20
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 20
In the \c updateButtonGeometry() function we set the geometry for
the given button. The parameter coordinates define the bottom
@@ -310,7 +310,7 @@
QStyle::pixelMetric() to determine the widget's preferred default
spacing between its child widgets.
- \snippet widgets/tooltips/sortingbox.cpp 21
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 21
The \c createShapeItem() function creates a single shape item. It
sets the path, tooltip, position and color, using the item's own
@@ -319,7 +319,7 @@
make it appear with the other items within the \c SortingBox
widget.
- \snippet widgets/tooltips/sortingbox.cpp 22
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 22
The \c createToolButton() function is called from the \c
SortingBox constructor. We create a tool button with the given
@@ -327,14 +327,14 @@
and its size is 32 x 32 pixels. Before we return the button, we
connect it to the given slot.
- \snippet widgets/tooltips/sortingbox.cpp 23
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 23
The \c initialItemPosition() function is also called from the
constructor. We want the three first items to initially be
centered in the middle of the \c SortingBox widget, and we use
this function to calculate their positions.
- \snippet widgets/tooltips/sortingbox.cpp 24
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 24
Whenever the user creates a new shape item, we want the new item
to appear at a random position, and we use the \c
@@ -343,21 +343,21 @@
\c SortingBox widget, using the widget's current width and height
when calculating the random coordinates.
- \snippet widgets/tooltips/sortingbox.cpp 25
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 25
As with \c initialItemPosition(), the \c initialItemColor()
function is called from the constructor. The purposes of both
functions are purely cosmetic: We want to control the initial
position and color of the three first items.
- \snippet widgets/tooltips/sortingbox.cpp 26
+ \snippet widgets/widgets/tooltips/sortingbox.cpp 26
Finally the \c randomItemColor() function is implemented to give
the shape items the user creates, a random color.
\section1 ShapeItem Class Definition
- \snippet widgets/tooltips/shapeitem.h 0
+ \snippet widgets/widgets/tooltips/shapeitem.h 0
The \c ShapeItem class is a custom widget representing one single
shape item. The widget has a path, a position, a color and a
@@ -369,25 +369,25 @@
\section1 ShapeItem Class Implementation
- \snippet widgets/tooltips/shapeitem.cpp 0
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 0
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 1
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 1
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 2
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 2
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 3
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 3
This first group of functions simply return the objects that are
requested. The objects are returned as constants, i.e. they cannot
be modified.
- \snippet widgets/tooltips/shapeitem.cpp 4
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 4
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 5
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 5
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 6
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 6
\codeline
- \snippet widgets/tooltips/shapeitem.cpp 7
+ \snippet widgets/widgets/tooltips/shapeitem.cpp 7
The last group of functions set or modify the shape item's path,
position, color and tooltip, respectively.
diff --git a/examples/widgets/doc/trafficlight.qdoc b/examples/widgets/doc/trafficlight.qdoc
index ec3578abaa..c35fa4915d 100644
--- a/examples/widgets/doc/trafficlight.qdoc
+++ b/examples/widgets/doc/trafficlight.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example statemachine/trafficlight
+ \example widgets/statemachine/trafficlight
\title Traffic Light Example
The Traffic Light example shows how to use \l{The State Machine Framework}
@@ -39,20 +39,20 @@
one light to another (red to yellow to green to yellow to red again) at
certain intervals.
- \snippet statemachine/trafficlight/main.cpp 0
+ \snippet widgets/statemachine/trafficlight/main.cpp 0
The LightWidget class represents a single light of the traffic light. It
provides an \c on property and two slots, turnOn() and turnOff(), to turn
the light on and off, respectively. The widget paints itself in the color
that's passed to the constructor.
- \snippet statemachine/trafficlight/main.cpp 1
+ \snippet widgets/statemachine/trafficlight/main.cpp 1
The TrafficLightWidget class represents the visual part of the traffic
light; it's a widget that contains three lights arranged vertically, and
provides accessor functions for these.
- \snippet statemachine/trafficlight/main.cpp 2
+ \snippet widgets/statemachine/trafficlight/main.cpp 2
The createLightState() function creates a state that turns a light on when
the state is entered, and off when the state is exited. The state uses a
@@ -64,7 +64,7 @@
\caption This is a caption
\endomit
- \snippet statemachine/trafficlight/main.cpp 3
+ \snippet widgets/statemachine/trafficlight/main.cpp 3
The TrafficLight class combines the TrafficLightWidget with a state
machine. The state graph has four states: red-to-yellow, yellow-to-green,
@@ -78,7 +78,7 @@
\caption This is a caption
\endomit
- \snippet statemachine/trafficlight/main.cpp 4
+ \snippet widgets/statemachine/trafficlight/main.cpp 4
The main() function constructs a TrafficLight and shows it.
diff --git a/examples/widgets/doc/transformations.qdoc b/examples/widgets/doc/transformations.qdoc
index 79681a2799..af548b92d0 100644
--- a/examples/widgets/doc/transformations.qdoc
+++ b/examples/widgets/doc/transformations.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example painting/transformations
+ \example widgets/painting/transformations
\title Transformations Example
The Transformations example shows how transformations influence
@@ -76,7 +76,7 @@
transformation matrix, see the \l {Coordinate System} and
QTransform documentation.
- \snippet painting/transformations/renderarea.h 0
+ \snippet widgets/painting/transformations/renderarea.h 0
The global \c Operation enum is declared in the \c renderarea.h
file and describes the various transformation operations available
@@ -87,7 +87,7 @@
The \c RenderArea class inherits QWidget, and controls the
rendering of a given shape.
- \snippet painting/transformations/renderarea.h 1
+ \snippet widgets/painting/transformations/renderarea.h 1
We declare two public functions, \c setOperations() and
\c setShape(), to be able to specify the \c RenderArea widget's shape
@@ -101,7 +101,7 @@
reimplement the QWidget::paintEvent() event handler to draw the
render area's shape applying the user's transformation choices.
- \snippet painting/transformations/renderarea.h 2
+ \snippet widgets/painting/transformations/renderarea.h 2
We also declare several convenience functions to draw the shape,
the coordinate system's outline and the coordinates, and to
@@ -120,7 +120,7 @@
we will take a quick look at the constructor and at the functions
that provides access to the \c RenderArea widget:
- \snippet painting/transformations/renderarea.cpp 0
+ \snippet widgets/painting/transformations/renderarea.cpp 0
In the constructor we pass the parent parameter on to the base
class, and customize the font that we will use to render the
@@ -140,18 +140,18 @@
bounding rectangle of the given character relative to the
left-most point on the base line.
- \snippet painting/transformations/renderarea.cpp 1
+ \snippet widgets/painting/transformations/renderarea.cpp 1
\codeline
- \snippet painting/transformations/renderarea.cpp 2
+ \snippet widgets/painting/transformations/renderarea.cpp 2
In the \c setShape() and \c setOperations() functions we update
the \c RenderArea widget by storing the new value or values
followed by a call to the QWidget::update() slot which schedules a
paint event for processing when Qt returns to the main event loop.
- \snippet painting/transformations/renderarea.cpp 3
+ \snippet widgets/painting/transformations/renderarea.cpp 3
\codeline
- \snippet painting/transformations/renderarea.cpp 4
+ \snippet widgets/painting/transformations/renderarea.cpp 4
We reimplement the QWidget's \l
{QWidget::minimumSizeHint()}{minimumSizeHint()} and \l
@@ -161,7 +161,7 @@
if there is no layout for this widget, and returns the layout's
minimum size or preferred size, respectively, otherwise.
- \snippet painting/transformations/renderarea.cpp 5
+ \snippet widgets/painting/transformations/renderarea.cpp 5
The \c paintEvent() event handler receives the \c RenderArea
widget's paint events. A paint event is a request to repaint all
@@ -179,7 +179,7 @@
ensure that the original shape is renderend with a suitable
margin.
- \snippet painting/transformations/renderarea.cpp 6
+ \snippet widgets/painting/transformations/renderarea.cpp 6
Before we start to render the shape, we call the QPainter::save()
function.
@@ -197,11 +197,11 @@
the QPainter::restore() function (i.e. popping the saved state off
the stack).
- \snippet painting/transformations/renderarea.cpp 7
+ \snippet widgets/painting/transformations/renderarea.cpp 7
Then we draw the square outline.
- \snippet painting/transformations/renderarea.cpp 8
+ \snippet widgets/painting/transformations/renderarea.cpp 8
Since we want the coordinates to correspond with the coordinate
system the shape is rendered within, we must make another call to
@@ -217,11 +217,11 @@
There is no need to save the QPainter state this time since
drawing the coordinates is the last painting operation.
- \snippet painting/transformations/renderarea.cpp 9
+ \snippet widgets/painting/transformations/renderarea.cpp 9
\codeline
- \snippet painting/transformations/renderarea.cpp 10
+ \snippet widgets/painting/transformations/renderarea.cpp 10
\codeline
- \snippet painting/transformations/renderarea.cpp 11
+ \snippet widgets/painting/transformations/renderarea.cpp 11
The \c drawCoordinates(), \c drawOutline() and \c drawShape() are
convenience functions called from the \c paintEvent() event
@@ -229,7 +229,7 @@
operations and how to display basic graphics primitives, see the
\l {painting/basicdrawing}{Basic Drawing} example.
- \snippet painting/transformations/renderarea.cpp 12
+ \snippet widgets/painting/transformations/renderarea.cpp 12
The \c transformPainter() convenience function is also called from
the \c paintEvent() event handler, and transforms the given
@@ -247,7 +247,7 @@
addition to all the transformations applied to the \c RenderArea
widgets to their left.
- \snippet painting/transformations/window.h 0
+ \snippet widgets/painting/transformations/window.h 0
We declare two public slots to make the application able to
respond to user interaction, updating the displayed \c RenderArea
@@ -259,7 +259,7 @@
\c shapeSelected() slot updates the \c RenderArea widgets' shapes
whenever the user changes the preferred shape.
- \snippet painting/transformations/window.h 1
+ \snippet widgets/painting/transformations/window.h 1
We also declare a private convenience function, \c setupShapes(),
that is used when constructing the \c Window widget, and we
@@ -274,7 +274,7 @@
In the constructor we create and initialize the application's
components:
- \snippet painting/transformations/window.cpp 0
+ \snippet widgets/painting/transformations/window.cpp 0
First we create the \c RenderArea widget that will render the
shape in the default coordinate system. We also create the
@@ -283,7 +283,7 @@
themselves are created at the end of the constructor, using the
\c setupShapes() convenience function.
- \snippet painting/transformations/window.cpp 1
+ \snippet widgets/painting/transformations/window.cpp 1
Then we create the \c RenderArea widgets that will render their
shapes with coordinate tranformations. By default the applied
@@ -298,7 +298,7 @@
operationChanged() slot to update the application whenever the
user changes the selected transformation operations.
- \snippet painting/transformations/window.cpp 2
+ \snippet widgets/painting/transformations/window.cpp 2
Finally, we set the layout for the application window using the
QWidget::setLayout() function, construct the available shapes
@@ -307,13 +307,13 @@
\c shapeSelected() slot before we set the window title.
- \snippet painting/transformations/window.cpp 3
- \snippet painting/transformations/window.cpp 4
- \snippet painting/transformations/window.cpp 5
- \snippet painting/transformations/window.cpp 6
+ \snippet widgets/painting/transformations/window.cpp 3
+ \snippet widgets/painting/transformations/window.cpp 4
+ \snippet widgets/painting/transformations/window.cpp 5
+ \snippet widgets/painting/transformations/window.cpp 6
\dots
- \snippet painting/transformations/window.cpp 7
+ \snippet widgets/painting/transformations/window.cpp 7
The \c setupShapes() function is called from the constructor and
create the QPainterPath objects representing the shapes that are
@@ -327,7 +327,7 @@
shapeSelected() slot to update the application when the user
changes the preferred shape.
- \snippet painting/transformations/window.cpp 8
+ \snippet widgets/painting/transformations/window.cpp 8
The public \c operationChanged() slot is called whenever the user
changes the selected operations.
@@ -342,7 +342,7 @@
associated operation to a QList of transformations which we apply
to the widget before proceeding to the next.
- \snippet painting/transformations/window.cpp 9
+ \snippet widgets/painting/transformations/window.cpp 9
The \c shapeSelected() slot is called whenever the user changes
the preferred shape, updating the \c RenderArea widgets using
diff --git a/examples/widgets/doc/trivialwizard.qdoc b/examples/widgets/doc/trivialwizard.qdoc
index e27f9cadc2..fb4a08a527 100644
--- a/examples/widgets/doc/trivialwizard.qdoc
+++ b/examples/widgets/doc/trivialwizard.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dialogs/trivialwizard
+ \example widgets/dialogs/trivialwizard
\title Trivial Wizard Example
The Trivial Wizard example illustrates how to create a linear three-page
@@ -45,7 +45,7 @@
A QVBoxLayout is used to hold the \c label. This \c page is returned
when the \c createIntroPage() function is called.
- \snippet dialogs/trivialwizard/trivialwizard.cpp 0
+ \snippet widgets/dialogs/trivialwizard/trivialwizard.cpp 0
\section1 Registration Page
@@ -56,7 +56,7 @@
and an e-mail address. A QGridLayout is used to hold the QLabel and
QLineEdit objects.
- \snippet dialogs/trivialwizard/trivialwizard.cpp 2
+ \snippet widgets/dialogs/trivialwizard/trivialwizard.cpp 2
\section1 Conclusion Page
@@ -67,7 +67,7 @@
QLabel is used to inform the user that the registration process has
completed successfully.
- \snippet dialogs/trivialwizard/trivialwizard.cpp 6
+ \snippet widgets/dialogs/trivialwizard/trivialwizard.cpp 6
\section1 \c main() Function
@@ -76,7 +76,7 @@
set to "Trivial Wizard" and its \c show() function is invoked to display
it.
- \snippet dialogs/trivialwizard/trivialwizard.cpp 10
+ \snippet widgets/dialogs/trivialwizard/trivialwizard.cpp 10
\sa QWizard, {Class Wizard Example}, {License Wizard Example}
*/
diff --git a/examples/widgets/doc/twowaybutton.qdoc b/examples/widgets/doc/twowaybutton.qdoc
index 40f8c6f1f3..a380d14122 100644
--- a/examples/widgets/doc/twowaybutton.qdoc
+++ b/examples/widgets/doc/twowaybutton.qdoc
@@ -26,41 +26,41 @@
****************************************************************************/
/*!
- \example statemachine/twowaybutton
+ \example widgets/statemachine/twowaybutton
\title Two-way Button Example
The Two-way button example shows how to use \l{The State Machine
Framework} to implement a simple state machine that toggles the current
state when a button is clicked.
- \snippet statemachine/twowaybutton/main.cpp 0
+ \snippet widgets/statemachine/twowaybutton/main.cpp 0
The application's main() function begins by constructing the application
object, a button and a state machine.
- \snippet statemachine/twowaybutton/main.cpp 1
+ \snippet widgets/statemachine/twowaybutton/main.cpp 1
The state machine has two states; \c on and \c off. When either state is
entered, the text of the button will be set accordingly.
- \snippet statemachine/twowaybutton/main.cpp 2
+ \snippet widgets/statemachine/twowaybutton/main.cpp 2
When the state machine is in the \c off state and the button is clicked,
it will transition to the \c on state; when the state machine is in the \c
on state and the button is clicked, it will transition to the \c off
state.
- \snippet statemachine/twowaybutton/main.cpp 3
+ \snippet widgets/statemachine/twowaybutton/main.cpp 3
The states are added to the state machine; they become top-level (sibling)
states.
- \snippet statemachine/twowaybutton/main.cpp 4
+ \snippet widgets/statemachine/twowaybutton/main.cpp 4
The initial state is \c off; this is the state the state machine will
immediately transition to once the state machine is started.
- \snippet statemachine/twowaybutton/main.cpp 5
+ \snippet widgets/statemachine/twowaybutton/main.cpp 5
Finally, the button is resized and made visible, and the application event
loop is entered.
diff --git a/examples/widgets/doc/wiggly.qdoc b/examples/widgets/doc/wiggly.qdoc
index e84ab00e61..868a9b9390 100644
--- a/examples/widgets/doc/wiggly.qdoc
+++ b/examples/widgets/doc/wiggly.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/wiggly
+ \example widgets/widgets/wiggly
\title Wiggly Example
The Wiggly example shows how to animate a widget using
@@ -60,14 +60,14 @@
\section1 Dialog Class Definition
- \snippet widgets/wiggly/dialog.h 0
+ \snippet widgets/widgets/wiggly/dialog.h 0
The \c Dialog class provides a dialog widget that allows the user
to enter a text. The text is then rendered by \c WigglyWidget.
\section1 Dialog Class Implementation
- \snippet widgets/wiggly/dialog.cpp 0
+ \snippet widgets/widgets/wiggly/dialog.cpp 0
In the constructor we create a wiggly widget along with a
\l{QLineEdit}{line edit}, and we put the two widgets in a
@@ -79,7 +79,7 @@
\section1 WigglyWidget Class Definition
- \snippet widgets/wiggly/wigglywidget.h 0
+ \snippet widgets/widgets/wiggly/wigglywidget.h 0
The \c WigglyWidget class provides the wiggly line displaying the
text. We subclass QWidget and reimplement the standard \l
@@ -96,7 +96,7 @@
\section1 WigglyWidget Class Implementation
- \snippet widgets/wiggly/wigglywidget.cpp 0
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 0
In the constructor, we make the widget's background slightly
lighter than the usual background using the QPalette::Midlight
@@ -109,8 +109,8 @@
timer events generated when the timer times out (every 60
milliseconds).
- \snippet widgets/wiggly/wigglywidget.cpp 1
- \snippet widgets/wiggly/wigglywidget.cpp 2
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 1
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 2
The \c paintEvent() function is called whenever a QPaintEvent is
sent to the widget. Paint events are sent to widgets that need to
@@ -133,8 +133,8 @@
font below the base line). If the descent equals the ascent, they
cancel out each other and the base line is at \c height() / 2.
- \snippet widgets/wiggly/wigglywidget.cpp 3
- \snippet widgets/wiggly/wigglywidget.cpp 4
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 3
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 4
Each time the \c paintEvent() function is called, we create a
QPainter object \c painter to draw the contents of the widget.
@@ -150,8 +150,8 @@
'V'). The result is that the text isn't perfectly centered. You
can verify this by typing "AVAVAVAVAVAV" in the line edit.
- \snippet widgets/wiggly/wigglywidget.cpp 5
- \snippet widgets/wiggly/wigglywidget.cpp 6
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 5
+ \snippet widgets/widgets/wiggly/wigglywidget.cpp 6
The \c timerEvent() function receives all the timer events that
are generated for this widget. If a timer event is sent from the
diff --git a/examples/widgets/doc/windowflags.qdoc b/examples/widgets/doc/windowflags.qdoc
index e85842b30a..aa3d609287 100644
--- a/examples/widgets/doc/windowflags.qdoc
+++ b/examples/widgets/doc/windowflags.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/windowflags
+ \example widgets/widgets/windowflags
\title Window Flags Example
The Window Flags example shows how to use the window flags
@@ -58,7 +58,7 @@
\section1 ControllerWindow Class Definition
- \snippet widgets/windowflags/controllerwindow.h 0
+ \snippet widgets/widgets/windowflags/controllerwindow.h 0
The \c ControllerWindow class inherits QWidget. The widget allows
the user to choose among the available window flags, and displays
@@ -83,7 +83,7 @@
\section1 ControllerWindow Class Implementation
- \snippet widgets/windowflags/controllerwindow.cpp 0
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 0
In the constructor we first create the preview window. Then we
create the group boxes containing the available window flags using
@@ -96,21 +96,21 @@
QVBoxLayout, set the window title and refresh the preview window
using the \c updatePreview() slot.
- \snippet widgets/windowflags/controllerwindow.cpp 1
- \snippet widgets/windowflags/controllerwindow.cpp 2
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 1
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 2
The \c updatePreview() slot is called whenever the user changes
any of the window flags. First we create an empty Qt::WindowFlags
\c flags, then we determine which one of the types that is checked
and add it to \c flags.
- \snippet widgets/windowflags/controllerwindow.cpp 3
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 3
We also determine which of the hints that are checked, and add
them to \c flags using an OR operator. We use \c flags to set the
window flags for the preview window.
- \snippet widgets/windowflags/controllerwindow.cpp 4
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 4
We adjust the position of the preview window. The reason we do
that, is that playing around with the window's frame may on some
@@ -126,7 +126,7 @@
\printuntil /^\}/
\endomit
- \snippet widgets/windowflags/controllerwindow.cpp 5
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 5
The private \c createTypeGroupBox() function is called from the
constructor.
@@ -145,7 +145,7 @@
hints only affect top-level windows, we abandon the Qt::Widget
type.
- \snippet widgets/windowflags/controllerwindow.cpp 6
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 6
The private \c createHintsGroupBox() function is also called from
the constructor.
@@ -156,7 +156,7 @@
checkboxes into a QGridLayout and install the layout on the group
box.
- \snippet widgets/windowflags/controllerwindow.cpp 7
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 7
The private \c createCheckBox() function is called from \c
createHintsGroupBox().
@@ -165,7 +165,7 @@
the private \c updatePreview() slot, and return a pointer to the
checkbox.
- \snippet widgets/windowflags/controllerwindow.cpp 8
+ \snippet widgets/widgets/windowflags/controllerwindow.cpp 8
In the private \c createRadioButton() function it is a
QRadioButton we create with the provided text, and connect to the
@@ -174,7 +174,7 @@
\section1 PreviewWindow Class Definition
- \snippet widgets/windowflags/previewwindow.h 0
+ \snippet widgets/widgets/windowflags/previewwindow.h 0
The \c PreviewWindow class inherits QWidget. It is a custom widget
that displays the names of its currently set window flags in a
@@ -189,7 +189,7 @@
\section1 PreviewWindow Class Implementation
- \snippet widgets/windowflags/previewwindow.cpp 0
+ \snippet widgets/widgets/windowflags/previewwindow.cpp 0
In the constructor, we first create a QTextEdit and make sure that
it is read-only.
@@ -205,7 +205,7 @@
Then we create the \uicontrol Close button, and put both the widgets
into a QVBoxLayout before we set the window title.
- \snippet widgets/windowflags/previewwindow.cpp 1
+ \snippet widgets/widgets/windowflags/previewwindow.cpp 1
In our reimplementation of the \c setWindowFlags() function, we
first set the widgets flags using the QWidget::setWindowFlags()