the painter handle transformations is often easier than performing
manual calculations just to draw the contents of a custom widget.
- \img analogclock-viewport.png
+ \image analogclock-viewport.png
We draw the hour hand first, using a formula that rotates the coordinate
system counterclockwise by a number of degrees determined by the current
The statechart for calculating the factorial looks as follows:
- \img factorial-example.png
+ \image factorial-example.png
\omit
\caption This is a caption
\endomit
This example implements a statechart where two states communicate by
posting events to the state machine. The state chart looks as follows:
- \img pingpong-example.png
+ \image pingpong-example.png
\omit
\caption This is a caption
\endomit
timer, and as we shall see the timeout is used to transition from one
LightState to another. Here is the statechart for the light state:
- \img trafficlight-example1.png
+ \image trafficlight-example1.png
\omit
\caption This is a caption
\endomit
yellow-to-green. The same process repeats through the other states.
This is what the statechart looks like:
- \img trafficlight-example2.png
+ \image trafficlight-example2.png
\omit
\caption This is a caption
\endomit
between the second and third result, and returns the second result; and
so on.
- \img javaiterators1.png
+ \image javaiterators1.png
Here's how to iterate over the elements in reverse order:
If we continue our analogy with Web services, object paths
equate to the path part of a URL:
- \img qurl-ftppath.png
+ \image qurl-ftppath.png
Like them, object paths in D-Bus are formed resembling path
names on the filesystem: they are slash-separated labels, each
selected item. If the widget can be toggled, the "On" mode might be
used to draw a different icon.
- \img icon.png QIcon
+ \image icon.png QIcon
\sa {fowler}{GUI Design Handbook: Iconic Label}, {Icons Example}
*/
Positive values are towards the tablet's physical right. The angle
is in the range -60 to +60 degrees.
- \img qtabletevent-tilt.png
+ \image qtabletevent-tilt.png
\sa yTilt()
*/
/*!
\enum QPalette::ColorRole
- \img palette.png Color Roles
+ \image palette.png Color Roles
The ColorRole enum defines the different symbolic color roles used
in current GUIs.
The code above produces the following output:
- \img alphafill.png
+ \image alphafill.png
The alpha channel of a color can be retrieved and set using the
alpha() and setAlpha() functions if its value is an integer, and
variety of color names; the static colorNames() function returns a
QStringList color names that QColor knows about.
- \img qt-colors.png Qt Colors
+ \image qt-colors.png Qt Colors
Additionally, the Qt::color0, Qt::color1 and Qt::transparent colors
are used for special purposes.
Returns a region which is the union of this region and \a r.
- \img runion.png Region Union
+ \image runion.png Region Union
The figure shows the union of two elliptical regions.
Returns a region which is the intersection of this region and \a r.
- \img rintersect.png Region Intersection
+ \image rintersect.png Region Intersection
The figure shows the intersection of two elliptical regions.
Returns a region which is \a r subtracted from this region.
- \img rsubtract.png Region Subtraction
+ \image rsubtract.png Region Subtraction
The figure shows the result when the ellipse on the right is
subtracted from the ellipse on the left (\c {left - right}).
Returns a region which is the exclusive or (XOR) of this region
and \a r.
- \img rxor.png Region XORed
+ \image rxor.png Region XORed
The figure shows the exclusive or of two elliptical regions.
/*!
\overload
- \img bearings.png Bearings
+ \image bearings.png Bearings
Returns the logical width of character \a ch in pixels. This is a
distance appropriate for drawing a subsequent character after \a
/*!
\overload
- \img bearings.png Bearings
+ \image bearings.png Bearings
Returns the logical width of character \a ch in pixels. This is a
distance appropriate for drawing a subsequent character after \a
frame's padding(). This scheme is similar to the box model used by Cascading
Style Sheets for HTML pages.
- \img qtextframe-style.png
+ \image qtextframe-style.png
The position() of a frame is set using setPosition() and determines how it
is located relative to the surrounding text.
compares two blocks for inequality, and \l operator<() determines whether
a block precedes another in the same document.
- \img qtextblock-sequence.png
+ \image qtextblock-sequence.png
\sa QTextBlockFormat, QTextCharFormat, QTextFragment
*/
of the sentence, the second will contain the text from the middle, and the
third takes the text from the end of the sentence.
- \img qtextfragment-split.png
+ \image qtextfragment-split.png
A fragment's text and character format can be obtained with the text()
and charFormat() functions. The length() function gives the length of
The \l{dialogs/standarddialogs}{Standard Dialogs} example shows
how to use QErrorMessage as well as other built-in Qt dialogs.
- \img qerrormessage.png
+ \image qerrormessage.png
\sa QMessageBox, QStatusBar::showMessage(), {Standard Dialogs Example}
*/
The \c ok variable is set to true if the user clicks \uicontrol OK; otherwise it
is set to false.
- \img inputdialogs.png Input Dialogs
+ \image inputdialogs.png Input Dialogs
The \l{dialogs/standarddialogs}{Standard Dialogs} example shows how to use
QInputDialog as well as other built-in Qt dialogs.
\table
\row
- \li \img qmessagebox-quest.png
+ \li \image qmessagebox-quest.png
\li \l Question
\li For asking a question during normal operations.
\row
- \li \img qmessagebox-info.png
+ \li \image qmessagebox-info.png
\li \l Information
\li For reporting information about normal operations.
\row
- \li \img qmessagebox-warn.png
+ \li \image qmessagebox-warn.png
\li \l Warning
\li For reporting non-critical errors.
\row
- \li \img qmessagebox-crit.png
+ \li \image qmessagebox-crit.png
\li \l Critical
\li For reporting critical errors.
\endtable
If we have three widgets laid out using a QHBoxLayout with no stretch
factors set we will get a layout like this:
- \img layout1.png Three widgets in a row
+ \image layout1.png Three widgets in a row
If we apply stretch factors to each widget, they will be laid out in
proportion (but never less than their minimum size hint), e.g.
- \img layout2.png Three widgets with different stretch factors in a row
+ \image layout2.png Three widgets with different stretch factors in a row
\section1 Custom Widgets in Layouts
widget's client geometry.
This diagram shows most of the functions in use:
- \img geometry.png Geometry diagram
+ \image geometry.png Geometry diagram
\section2 X11 Peculiarities
\table
\row
- \li{2,1} \img graphicseffect-plain.png
+ \li{2,1} \image graphicseffect-plain.png
\row
- \li \img graphicseffect-blur.png
- \li \img graphicseffect-colorize.png
+ \li \image graphicseffect-blur.png
+ \li \image graphicseffect-colorize.png
\row
- \li \img graphicseffect-opacity.png
- \li \img graphicseffect-drop-shadow.png
+ \li \image graphicseffect-opacity.png
+ \li \image graphicseffect-drop-shadow.png
\endtable
- \img graphicseffect-widget.png
+ \image graphicseffect-widget.png
For more information on how to use each effect, refer to the specific
effect's documentation.
By default, the color is light blue (QColor(0, 0, 192)).
- \img graphicseffect-colorize.png
+ \image graphicseffect-colorize.png
\sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsOpacityEffect
*/
By default, the blur radius is 5 pixels. The blur radius is specified in
device coordinates.
- \img graphicseffect-blur.png
+ \image graphicseffect-blur.png
\sa QGraphicsDropShadowEffect, QGraphicsColorizeEffect, QGraphicsOpacityEffect
*/
of 8 pixels towards the lower right. The drop shadow offset is specified
in device coordinates.
- \img graphicseffect-drop-shadow.png
+ \image graphicseffect-drop-shadow.png
\sa QGraphicsBlurEffect, QGraphicsColorizeEffect, QGraphicsOpacityEffect
*/
By default, the opacity is 0.7.
- \img graphicseffect-opacity.png
+ \image graphicseffect-opacity.png
\sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsColorizeEffect
*/
local coordinates). Parent items propagate both their position and their
transformation to all children.
- \img graphicsview-parentchild.png
+ \image graphicsview-parentchild.png
\target Transformations
\section1 Transformations
returns the current line. By default the line is black with a
width of 0, but you can change this by calling setPen().
- \img graphicsview-lineitem.png
+ \image graphicsview-lineitem.png
QGraphicsLineItem uses the line and the pen width to provide a reasonable
implementation of boundingRect(), shape(), and contains(). The paint()
\note In order to align HTML text in the center, the item's text width must be set.
- \img graphicsview-textitem.png
+ \image graphicsview-textitem.png
\note QGraphicsTextItem accepts \l{QGraphicsItem::acceptHoverEvents()}{hover events}
by default. You can change this with \l{QGraphicsItem::}{setAcceptHoverEvents()}.
QGraphicsSimpleText does not display rich text; instead, you can use
QGraphicsTextItem, which provides full text control capabilities.
- \img graphicsview-simpletextitem.png
+ \image graphicsview-simpletextitem.png
\sa QGraphicsTextItem, QGraphicsPathItem, QGraphicsRectItem,
QGraphicsEllipseItem, QGraphicsPixmapItem, QGraphicsPolygonItem,
view coordinates and scene coordinates, and to find items on the scene
using view coordinates.
- \img graphicsview-view.png
+ \image graphicsview-view.png
\sa QGraphicsScene, QGraphicsItem, QGraphicsSceneEvent
*/
exclusive by default, only one of the actions in the group is
checked at any one time.
- \img qactiongroup-align.png Alignment options in a QMenu
+ \image qactiongroup-align.png Alignment options in a QMenu
A QActionGroup emits an triggered() signal when one of its
actions is chosen. Each action in an action group emits its
the appropriate help text is shown. The mode is left when help is
given or when the user presses Esc.
- \img whatsthis.png
+ \image whatsthis.png
You can enter "What's This?" mode programmatically with
enterWhatsThisMode(), check the mode with inWhatsThisMode(), and
documentation. QCDEStyle provides overloads for drawControl() and
drawPrimitive() which are documented here.
- \img qcdestyle.png
+ \image qcdestyle.png
\sa QWindowsXPStyle, QMacStyle, QWindowsStyle, QPlastiqueStyle, QMotifStyle
*/
reimplementations of QStyle functions; see QStyle for their
documentation.
- \img qmacstyle.png
+ \image qmacstyle.png
\sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
*/
but with some minor improvements. The Motif style is Qt's default
GUI style on Unix platforms.
- \img qmotifstyle.png
+ \image qmotifstyle.png
\sa QWindowsXPStyle, QMacStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle
*/
that closely resembles the Plastik style, introduced by Sandro Giessl in
KDE 3.2.
- \img qplastiquestyle.png
+ \image qplastiquestyle.png
\sa QWindowsXPStyle, QMacStyle, QWindowsStyle, QCDEStyle, QMotifStyle
*/
native widgets. The diagram below shows a QComboBox in eight
different styles.
- \img qstyle-comboboxes.png Eight combo boxes
+ \image qstyle-comboboxes.png Eight combo boxes
Topics:
This style is Qt's default GUI style on Windows.
- \img qwindowsstyle.png
+ \image qwindowsstyle.png
\sa QWindowsXPStyle, QMacStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
*/
drawControlMask(), drawPrimitive(), proxy()->subControlRect(), and
sizeFromContents(), are documented here.
- \img qwindowsxpstyle.png
+ \image qwindowsxpstyle.png
\sa QMacStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
*/