/*!
\class QAccessible::State
+ \inmodule QtGui
+
This structure defines bit flags that indicate
the state of an accessible object. The values are:
/*!
\class QAccessibleTextInterface
\internal
+ \inmodule QtGui
\ingroup accessibility
/*!
\class QAccessibleEditableTextInterface
\ingroup accessibility
+ \inmodule QtGui
\internal
\brief The QAccessibleEditableTextInterface class implements support for objects with editable text.
/*!
\class QAccessibleSimpleEditableTextInterface
+ \inmodule QtGui
\ingroup accessibility
\internal
/*!
\class QAccessibleValueInterface
+ \inmodule QtGui
\ingroup accessibility
\internal
/*!
\class QAccessibleImageInterface
+ \inmodule QtGui
\ingroup accessibility
\internal
\preliminary
/*!
\class QAccessibleTableCellInterface
+ \inmodule QtGui
\ingroup accessibility
\internal
painter uses to draw onto different types of devices.
The QPaintDevice class is the base class of objects that can be
- painted: Its drawing capabilities are inherited by the QWidget,
- QPixmap, QPicture, QImage, and QPrinter classes. The default
- coordinate system of a paint device has its origin at the top-left
- corner. The \e x values increase to the right and the \e y values
- increase downwards. The default unit is one pixel on pixel-based
- devices and one point (1/72 of an inch) on printers.
+ painted: Its drawing capabilities are inherited by the
+ QOpenGLPaintDevice, QImage, QPixmap and QPicture classes. The
+ default coordinate system of a paint device has its origin at the
+ top-left corner. The \e x values increase to the right and the \e
+ y values increase downwards. The default unit is one pixel on
+ pixel-based devices and one point (1/72 of an inch) on printers.
The mapping of the logical QPainter coordinates to the physical
QPaintDevice coordinates are handled by QPainter's transformation
\endtable
You can also twist the coordinate system around the origin using
- the QPainter::shear() function. See the \l {painting/affine}{Affine
- Transformations} example for a visualization of a sheared coordinate
- system. All the transformation operations operate on QPainter's
- transformation matrix that you can retrieve using the
- QPainter::worldTransform() function. A matrix transforms a point
- in the plane to another point.
+ the QPainter::shear() function. All the transformation operations
+ operate on QPainter's transformation matrix that you can retrieve
+ using the QPainter::worldTransform() function. A matrix transforms
+ a point in the plane to another point.
If you need the same transformations over and over, you can also
use QTransform objects and the QPainter::worldTransform() and
The Analog Clock example shows how to draw the contents of a
custom widget using QPainter's transformation matrix.
- Qt's example directory provides a complete walk-through of the
- example. Here, we will only review the example's \l
- {QWidget::paintEvent()}{paintEvent()} function to see how we can
- use the transformation matrix (i.e. QPainter's matrix functions)
- to draw the clock's face.
-
We recommend compiling and running this example before you read
any further. In particular, try resizing the window to different
sizes.
painting so that doesn't matter.
\endtable
- For a demonstation of Qt's ability to perform affine
- transformations on painting operations, see the \l
- {painting/affine}{Affine Transformations} example which allows the user
- to experiment with the transformation operations. See also the \l
- {painting/transformations}{Transformations} example which shows
- how transformations influence the way that QPainter renders
- graphics primitives. In particular, it shows how the order of
- transformations affects the result.
-
For more information about the transformation matrix, see the
QTransform documentation.
\endtable
\endomit
- \sa {Analog Clock Example}, {Transformations Example}
+ \sa {Analog Clock Example}
*/
+
+/*
+ ### DOC-TODO: rewrite analog clock to be QWindow based
+ */
\ No newline at end of file
\li \l{Drawing and Filling}
\li \l{Coordinate System}
\li \l{Reading and Writing Image Files}
- \li \l{Styling}
- \li \l{Printing with Qt}
\endlist
\section1 Classes for Painting
\annotatedlist painting
- Alternatively, Qt provides the QtOpenGL module, offering classes
- that makes it easy to use OpenGL in Qt applications. Among others,
- the module provides an OpenGL widget class that can be used just
- like any other Qt widget, except that it opens an OpenGL display
- buffer where the OpenGL API can be used to render the contents.
*/
The QPaintDevice class is the base class of objects that can be
painted, i.e. QPainter can draw on any QPaintDevice
subclass. QPaintDevice's drawing capabilities are currently
- implemented by the QWidget, QImage, QPixmap, QGLWidget,
- QGLPixelBuffer, QPicture and QPrinter subclasses.
+ implemented by the QImage, QPixmap, QGLPixelBuffer, QPicture and
+ QPrinter subclasses.
\image paintsystem-devices.png
\table 100%
- \row \li \b Widget
-
- The QWidget class is the base class of all user interface
- objects. The widget is the atom of the user interface: it receives
- mouse, keyboard and other events from the window system, and
- paints a representation of itself on the screen.
\row \li \b Image
Qt also provides the QBitmap convenience class, inheriting
QPixmap. QBitmap guarantees monochrome (1-bit depth) pixmaps, and
is mainly used for creating custom QCursor and QBrush objects,
- constructing QRegion objects, and for setting masks for pixmaps
- and widgets.
-
- \row \li \b {OpenGL Widget}
-
- As mentioned previously, Qt provides the QtOpenGL module offering
- classes that makes it easy to use OpenGL in Qt applications. For
- example, the QGLWidget enables the OpenGL API for
- rendering.
-
- But QGLWidget is also a QWidget subclass, and can be used by
- QPainter as any other paint device. One huge benefit from this is
- that it enables Qt to utilize the high performance of OpenGL for
- most drawing operations, such as transformations and pixmap
- drawing.
-
- \row \li \b {Pixel Buffer}
+ constructing QRegion objects.
- The QtOpenGL module also provides the QGLPixelBuffer class which
- inherits QPaintDevice directly.
+ \row \li \b {OpenGL Paint Device}
- QGLPixelBuffer encapsulates an OpenGL pbuffer. Rendering into a
- pbuffer is normally done using full hardware acceleration which
- can be significantly faster than rendering into a QPixmap.
-
- \row \li \b {Framebuffer Object}
-
- The QtOpenGL module also provides the QGLFramebufferObject class
- which inherits QPaintDevice directly.
-
- QGLFramebufferObject encapsulates an OpenGL framebuffer object.
- Framebuffer objects can also be used for off-screen rendering, and
- offer several advantages over pixel buffers for this purpose.
- These are described in the QGLFramebufferObject class documentation.
+ As mentioned previously, Qt is offering classes that makes it easy
+ to use OpenGL in Qt applications. For example, the QOpenGLPaintDevice
+ enables the OpenGL API for rendering with QPainter.
\row \li \b {Picture}
Qt provides the QPicture::load() and QPicture::save() functions
as well as streaming operators for loading and saving pictures.
- \row \li \b {Printer}
-
- The QPrinter class is a paint device that paints on a printer. On
- Windows or Mac OS X, QPrinter uses the built-in printer
- drivers. On X11, QPrinter generates postscript and sends that to
- lpr, lp, or another print program. QPrinter can also print to any
- other QPrintEngine object.
-
- The QPrintEngine class defines an interface for how QPrinter
- interacts with a given printing subsystem. The common case when
- creating your own print engine, is to derive from both
- QPaintEngine and QPrintEngine.
- The output format is by default determined by the platform the
- printer is running on, but by explicitly setting the output format
- to QPrinter::PdfFormat, QPrinter will generate its output as a PDF
- file.
\row \li \b {Custom Backends}
\endtable
- \section1 Selecting the Painting Backend
-
- Since Qt 4.5, it is possible to replace the paint engines and paint
- devices used for widgets, pixmaps and the offscreen double buffer. By
- default the backends are:
-
- \table
- \row
- \li Windows
- \li Software Rasterizer
- \row
- \li X11
- \li X11
- \row
- \li Mac OS X
- \li CoreGraphics
- \row
- \li Embedded
- \li Software Rasterizer
- \endtable
-
- Passing a command line parameter to the application, such as,
- \c{-graphicssystem raster}, specifies that Qt should use the software
- rasterizer for this application. The Software rasterizer is fully
- supported on all platforms.
-
- \code
- > analogclock -graphicssystem raster
- \endcode
-
- There is also a \c{-graphicssystem opengl} mode that uses OpenGL for
- all drawing. Currently, this engine is experimental as it does not draw
- everything correctly.
-
- Qt also supports being configured using \c {-graphicssystem
- raster|opengl} in which case all applications will use the
- specified graphics system for its graphics.
*/
/*!
colors are mapped to hardware using the QColormap class). For more
information, see the QColor class documentation.
- When creating a new widget, it is recommend to use the colors in
- the widget's palette rather than hard-coding specific colors. All
- widgets in Qt contain a palette and use their palette to draw
- themselves. A widget's palette is represented by the QPalette
- class which contains color groups for each widget state.
-
The available fill patterns are described by the Qt::BrushStyle
enum. These include basic patterns spanning from uniform color to
very sparse pattern, various line combinations, gradient fills and
\previouspage Coordinate System
\contentspage The Paint System
- \nextpage Styling
The most common way to read images is through QImage and QPixmap's
constructors, or by calling the QImage::load() and QPixmap::load()
and start using it.
*/
-/*!
- \page paintsystem-styling.html
- \title Styling
-
- \previouspage Reading and Writing Image Files
- \contentspage The Paint System
- \nextpage Printing with Qt
-
- Qt's built-in widgets use the QStyle class to perform nearly all
- of their drawing. QStyle is an abstract base class that
- encapsulates the look and feel of a GUI, and can be used to make
- the widgets look exactly like the equivalent native widgets or to
- give the widgets a custom look.
-
- Qt provides a set of QStyle subclasses that emulate the native
- look of the different platforms supported by Qt (QWindowsStyle,
- QMacStyle, QMotifStyle, etc.). These styles are built into the
- QtGui library, other styles can be made available using Qt's
- plugin mechansim.
-
- Most functions for drawing style elements take four arguments:
-
- \list
- \li an enum value specifying which graphical element to draw
- \li a QStyleOption object specifying how and where to render that element
- \li a QPainter object that should be used to draw the element
- \li a QWidget object on which the drawing is performed (optional)
- \endlist
-
- The style gets all the information it needs to render the
- graphical element from the QStyleOption class. The widget is
- passed as the last argument in case the style needs it to perform
- special effects (such as animated default buttons on Mac OS X),
- but it isn't mandatory. In fact, QStyle can be used to draw on any
- paint device (not just widgets), in which case the widget argument
- is a zero pointer.
-
- \image paintsystem-stylepainter.png
-
- The paint system also provides the QStylePainter class inheriting
- from QPainter. QStylePainter is a convenience class for drawing
- QStyle elements inside a widget, and extends QPainter with a set
- of high-level drawing functions implemented on top of QStyle's
- API. The advantage of using QStylePainter is that the parameter
- lists get considerably shorter.
-
- \table 100%
- \row
- \li \inlineimage paintsystem-icon.png
- \li \b QIcon
-
- The QIcon class provides scalable icons in different modes and states.
-
- QIcon can generate pixmaps reflecting an icon's state, mode and
- size. These pixmaps are generated from the set of pixmaps
- made available to the icon, and are used by Qt widgets to show an
- icon representing a particular action.
-
- The rendering of a QIcon object is handled by the QIconEngine
- class. Each icon has a corresponding icon engine that is
- responsible for drawing the icon with a requested size, mode and
- state.
-
- \endtable
-
- For more information about widget styling and appearance, see the
- \l{Styles and Style Aware Widgets}.
-*/
/*!
\module QtGui
- \title QtGui Module
+ \title The Qt GUI Module
\ingroup modules
- \brief The QtGui module extends QtCore with GUI functionality.
+ \brief The Qt GUI module provides the basic enablers for graphical
+ applications written with Qt.
- To include the definitions of both modules' classes, use the
+ The Qt GUI module provides classes for windowing system
+ integration, event handling, OpenGL and OpenGL ES integration, 2D
+ graphics, imaging, fonts and typography. These classes are used
+ internally by Qt's user interface technologies and can also be
+ used directly, for instance to write applications using low-level
+ OpenGL ES graphics APIs.
+
+ To include the definitions of the module's classes, use the
following directive:
\snippet code/doc_src_qtgui.pro 0
+
+ See the \l {Qt GUI Module Overview} for more details.
+
+*/
+
+/*!
+ \page qtgui-overview.html
+ \title Qt GUI Module Overview
+
+ The Qt GUI module provides classes for windowing system
+ integration, event handling, OpenGL and OpenGL ES integration, 2D
+ graphics, basic imaging, fonts and text. These classes are used
+ internally by Qt's user interface technologies and can also be
+ used directly, for instance to write applications using low-level
+ OpenGL ES graphics APIs.
+
+ For application developers writing user interfaces, Qt provides
+ higher level API's, like Qt Quick, that are much more suitable
+ than the enablers found in the Qt GUI module.
+
+
+
+ \section1 Application Windows
+
+ The most important classes in the Qt GUI module are
+ QGuiApplication and QWindow. A Qt application that wants to show
+ content on screen, will need to make use of these. QGuiApplication
+ contains the main event loop, where all events from the window
+ system and other sources are processed and dispatched. It also
+ handles the application's initialization and finalization.
+
+ The \l QWindow class represents a window in the underlying
+ windowing system. It provides a number of virtual functions to
+ handle events (\l {QEvent}) from the windowing system, such as
+ touch-input, exposure, focus, key strokes and geometry changes.
+
+
+
+ \section1 2D Graphics
+
+ The Qt GUI module contains classes for 2D graphics, imaging, fonts
+ and advanced typography.
+
+ A \l QWindow created with the surface type \l
+ {QSurface::RasterSurface} can be used in combination with \l
+ {QBackingStore} and \l {QPainter}, Qt's highly optimized 2D vector
+ graphics API. QPainter supports drawing lines, polygons, vector
+ paths, images and text. For more information, see \l{Paint
+ System}.
+
+ Qt can load and save images using the \l QImage and \l QPixmap
+ classes. By default, Qt supports the most common image formats
+ including JPEG and PNG among others. Users can add support for
+ additional formats via the \l QImageIOPlugin class. For more
+ information, see \l {Reading and Writing Image Files}
+
+ Typography in Qt is done with \l QTextDocument which uses the \l
+ QPainter API in combination with Qt's font classes, primarily
+ QFont. Applications that prefer more low-level APIs to text
+ and font handling, classes like QRawFont and QGlyphRun can be
+ used.
+
+
+
+ \section1 OpenGL and OpenGL ES integration
+
+ QWindow supports rendering using desktop OpenGL, OpenGL ES 1.1 and
+ OpenGL ES 2.0, depending on what the platform supports. OpenGL
+ rendering is enabled by setting the QWindow's surface type to
+ QSurface::OpenGLSurface, then creating a QOpenGLContext to manage
+ the native OpenGL context.
+
+ For more information, see \l {OpenGL Enablers}.
+
+ The Qt GUI module also contains a few math classes to aid with the
+ most common mathmatical operations related to 3D graphics. These
+ classes include \l {QMatrix4x4}, \l {QVector4D} and \l {QQuaternion}
+
+ A \l {QWindow} created with the \l {QSurface::OpenGLSurface} can
+ be used in combination with \l QPainter and \l QOpenGLPaintDevice
+ to have OpenGL hardware accellerated 2D graphics, by sacrificing
+ some of the visual quality.
+
+
+
+
+ \section1 Qt GUI prior to Qt 5.0
+
+ Prior to Qt 5.0, the Qt GUI library was the monolithic container
+ for all things relating to graphical user interfaces in Qt, and
+ included the Qt widget set, the item views, the graphics view
+ framework and also printing. Starting Qt 5, these classes have
+ been moved to the QtWidgets library. Printing has been
+ moved to the QtPrintSupport library. Please note that these
+ libraries can be excluded from a Qt installation.
+
+ QtGui now contains only a small set of enablers, which are generally
+ useful for all graphical applications.
+
+ */
+
+
+/*
+
+ ### DOC-TODO: link under AppWindows to hello-world for QWindow in
+ examples/gui/windows/hello-qtgui. (Idea: QWindow which
+ reimplements mouseEvent() to exit)
+
+ ### DOC-TODO: link under Painting to hello-raster for QWindow
+ in examples/gui/graphics/rasterwindow. Idea: QWindow with BS
+ which draws a rotating rectangle with some text underneath.
+
+ ### DOC-TODO: link under OpenGL to hello-opengl for QWindow in
+ examples/gui/opengl/openglwindow. Idea: QWindow which draws a
+ triangle using GLES 2.0 compatible shaders. Do not care about
+ 1.1 API as almost everyone has 2.0 support these days.
+
*/
/*!
\class QBitmap
+ \inmodule QtGui
\brief The QBitmap class provides monochrome (1-bit depth) pixmaps.
\ingroup painting
/*!
\class QImage
+ \inmodule QtGui
\ingroup painting
\ingroup shared
\brief The QImageIOHandler class defines the common image I/O
interface for all image formats in Qt.
\reentrant
+ \inmodule QtGui
Qt uses QImageIOHandler for reading and writing images through
QImageReader and QImageWriter. You can also derive from this class
/*!
\class QImageIOPlugin
+ \inmodule QtGui
\brief The QImageIOPlugin class defines an interface for writing
an image format plugin.
\reentrant
\brief The QImageReader class provides a format independent interface
for reading images from files or other devices.
+ \inmodule QtGui
\reentrant
\ingroup painting
\ingroup io
\brief The QImageWriter class provides a format independent interface
for writing images to files or other devices.
+ \inmodule QtGui
\reentrant
\ingroup painting
\ingroup io
/*!
\class QMovie
+ \inmodule QtGui
+
\brief The QMovie class is a convenience class for playing movies
with QImageReader.
- \ingroup painting
-
This class is used to show simple animations without sound. If you want
to display video and media content, use the \l{Phonon Module}{Phonon}
multimedia framework instead.
\brief The QPicture class is a paint device that records and
replays QPainter commands.
- \ingroup painting
+ \inmodule QtGui
\ingroup shared
/*!
\class QPixmap
+ \inmodule QtGui
\brief The QPixmap class is an off-screen image representation
that can be used as a paint device.
/*!
\class QPixmapCache
+ \inmodule QtGui
\brief The QPixmapCache class provides an application-wide cache for pixmaps.
- \ingroup painting
-
This class is a tool for optimized drawing with QPixmap. You can
use it to store temporary pixmaps that are expensive to generate
without using more storage space than cacheLimit(). Use insert()
\class QPixmapCache::Key
\brief The QPixmapCache::Key class can be used for efficient access
to the QPixmapCache.
+ \inmodule QtGui
\since 4.6
Use QPixmapCache::insert() to receive an instance of Key generated
/*!
\class QClipboard
\brief The QClipboard class provides access to the window system clipboard.
+ \inmodule QtGui
The clipboard offers a simple mechanism to copy and paste data
between applications.
\brief The QCursor class provides a mouse cursor with an arbitrary
shape.
+ \inmodule QtGui
\ingroup appearance
\ingroup shared
/*!
\class QDrag
+ \inmodule QtGui
\brief The QDrag class provides support for MIME-based drag and drop data
transfer.
/*!
\class QInputEvent
\ingroup events
+ \inmodule QtGui
\brief The QInputEvent class is the base class for events that
describe user input.
/*!
\class QWheelEvent
\brief The QWheelEvent class contains parameters that describe a wheel event.
+ \inmodule QtGui
\ingroup events
\class QFocusEvent
\brief The QFocusEvent class contains event parameters for widget focus
events.
+ \inmodule QtGui
\ingroup events
/*!
\class QPaintEvent
\brief The QPaintEvent class contains event parameters for paint events.
+ \inmodule QtGui
\ingroup events
/*!
\class QMoveEvent
\brief The QMoveEvent class contains event parameters for move events.
+ \inmodule QtGui
\ingroup events
\class QExposeEvent
\since 5.0
\brief The QExposeEvent class contains event parameters for expose events.
+ \inmodule QtGui
\ingroup events
/*!
\class QResizeEvent
\brief The QResizeEvent class contains event parameters for resize events.
+ \inmodule QtGui
\ingroup events
\brief The QCloseEvent class contains parameters that describe a close event.
\ingroup events
+ \inmodule QtGui
Close events are sent to widgets that the user wants to close,
usually by choosing "Close" from the window menu, or by clicking
/*!
\class QIconDragEvent
\brief The QIconDragEvent class indicates that a main icon drag has begun.
+ \inmodule QtGui
\ingroup events
/*!
\class QContextMenuEvent
\brief The QContextMenuEvent class contains parameters that describe a context menu event.
+ \inmodule QtGui
\ingroup events
/*!
\class QInputMethodEvent
\brief The QInputMethodEvent class provides parameters for input method events.
+ \inmodule QtGui
\ingroup events
/*!
\class QInputMethodQueryEvent
\since 5.0
+ \inmodule QtGui
\brief This event is sent by the input context to input objects.
/*!
\class QTabletEvent
\brief The QTabletEvent class contains parameters that describe a Tablet event.
+ \inmodule QtGui
\ingroup events
\class QDropEvent
\ingroup events
\ingroup draganddrop
+ \inmodule QtGui
\brief The QDropEvent class provides an event which is sent when a
drag and drop action is completed.
\ingroup events
\ingroup draganddrop
+ \inmodule QtGui
A widget must accept this event in order to receive the \l
{QDragMoveEvent}{drag move events} that are sent while the drag
\ingroup events
\ingroup draganddrop
+ \inmodule QtGui
A widget will receive drag move events repeatedly while the drag
is within its boundaries, if it accepts
\ingroup events
\ingroup draganddrop
+ \inmodule QtGui
This event is always preceded by a QDragEnterEvent and a series
of \l{QDragMoveEvent}s. It is not sent if a QDropEvent is sent
\ingroup events
\ingroup helpsystem
+ \inmodule QtGui
This event can be intercepted in applications to provide tooltips
or "What's This?" help for custom widgets. The type() can be
\ingroup events
\ingroup helpsystem
+ \inmodule QtGui
Status tips can be set on a widget using the
QWidget::setStatusTip() function. They are shown in the status
\ingroup events
\ingroup helpsystem
+ \inmodule QtGui
\sa QWhatsThis, QHelpEvent, QStatusTipEvent
*/
when a QAction is added, removed, or changed.
\ingroup events
+ \inmodule QtGui
Actions can be added to widgets using QWidget::addAction(). This
generates an \l ActionAdded event, which you can handle to provide
\brief The QHideEvent class provides an event which is sent after a widget is hidden.
\ingroup events
+ \inmodule QtGui
This event is sent just before QWidget::hide() returns, and also
when a top-level window has been hidden (iconified) by the user.
\brief The QShowEvent class provides an event that is sent when a widget is shown.
\ingroup events
+ \inmodule QtGui
There are two kinds of show events: show events caused by the
window system (spontaneous), and internal show events. Spontaneous (QEvent::spontaneous())
sent when there is a request to open a file or a URL.
\ingroup events
+ \inmodule QtGui
File open events will be sent to the QApplication::instance()
when the operating system requests that a file or URL should be opened.
sent whenever a the toolbar button is clicked on Mac OS X.
\ingroup events
+ \inmodule QtGui
The QToolBarChangeEvent is sent when the toolbar button is clicked. On Mac
OS X, this is the long oblong button on the right side of the window
the user presses a key combination.
\ingroup events
+ \inmodule QtGui
Normally you don't need to use this class directly; QShortcut
provides a higher-level interface to handle shortcut keys.
/*!
\class QWindowStateChangeEvent
\ingroup events
+ \inmodule QtGui
\brief The QWindowStateChangeEvent class provides the window state before a
window state change.
\since 4.6
\ingroup events
\ingroup touch
+ \inmodule QtGui
\section1 Enabling Touch Events
/*! \class QTouchEvent::TouchPoint
\brief The TouchPoint class provides information about a touch point in a QTouchEvent.
\since 4.6
+ \inmodule QtGui
*/
/*! \enum QTouchEvent::TouchPoint::InfoFlags
\class QScrollPrepareEvent
\since 4.8
\ingroup events
+ \inmodule QtGui
\brief The QScrollPrepareEvent class is send in preparation of a scrolling.
\class QScrollEvent
\since 4.8
\ingroup events
+ \inmodule QtGui
\brief The QScrollEvent class is send when scrolling.
/*!
\class QInputMethod
\brief The QInputMethod class provides access to the active text input method.
+ \inmodule QtGui
QInputMethod is used by the text editors for integrating to the platform text input
methods and more commonly by application views for querying various text input method-related
by shortcuts.
\ingroup shared
+ \inmodule QtGui
In its most common form, a key sequence describes a combination of
/*!
\class QOpenGLContext
+ \inmodule QtGui
\since 5.0
\brief The QOpenGLContext represents a native OpenGL context, enabling
OpenGL rendering on a QSurface.
\since 5.0
\brief The QOpenGLContextGroup represents a group of contexts sharing
OpenGL resources.
+ \inmodule QtGui
QOpenGLContextGroup is automatically created and managed by QOpenGLContext
instances. Its purpose is to identify all the contexts that are sharing
that are shared between OpenGL contexts (like textures, framebuffer
objects, shader programs, etc), and clean them up in a safe way when
they're no longer needed.
+ \inmodule QtGui
The QOpenGLSharedResource instance should never be deleted, instead free()
should be called when it's no longer needed. Thus it will be put on a queue
QOpenGLSharedResource to be used to track a single OpenGL object with a
GLuint identifier. The constructor takes a function pointer to a function
that will be used to free the resource if and when necessary.
+ \inmodule QtGui
+
*/
void QOpenGLSharedResourceGuard::freeResource(QOpenGLContext *context)
{
QOpenGLContext *. To get an instance for a given context one calls
T *QOpenGLMultiGroupSharedResource::value<T>(context), where T is a sub-class
of QOpenGLSharedResource.
+ \inmodule QtGui
You should not call free() on QOpenGLSharedResources owned by a
QOpenGLMultiGroupSharedResource instance.
\brief The QPalette class contains color groups for each widget state.
+ \inmodule QtGui
\ingroup appearance
\ingroup shared
- \ingroup painting
-
A palette consists of three color groups: \e Active, \e Disabled,
and \e Inactive. All widgets in Qt contain a palette and
\class QScreen
\since 5.0
\brief The QScreen class is used to query screen properties.
+ \inmodule QtGui
A note on logical vs physical dots per inch: physical DPI is based on the
actual physical pixel sizes when available, and is useful for print preview
\class QStyleHints
\since 5.0
\brief The QStyleHints contains platform specific hints and settings.
+ \inmodule QtGui
*/
QStyleHints::QStyleHints()
: QObject()
/*!
\class QSurface
+ \inmodule QtGui
\since 5.0
\brief The QSurface class is an abstraction of renderable surfaces in Qt.
\class QSurfaceFormat
\since 5.0
\brief The QSurfaceFormat class represents the format of a QSurface.
+ \inmodule QtGui
The format includes the size of the color buffers, red, green, and blue;
the size of the alpha buffer; the size of the depth and stencil buffers;
\brief The QTouchDevice class describes the device from with touch events originate.
\since 5.0
\ingroup touch
+ \inmodule QtGui
Each QTouchEvent contains a QTouchDevice pointer to allow accessing
device-specific properties like type and capabilities. It is the
/*!
\class QWindow
+ \inmodule QtGui
\since 5.0
\brief The QWindow class represents a window in the underlying windowing system.
\since 4.6
\ingroup painting
\ingroup painting-3D
+ \inmodule QtGui
The QGenericMatrix template has three parameters:
\brief The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
\since 4.6
\ingroup painting-3D
+ \inmodule QtGui
The QMatrix4x4 class in general is treated as a row-major matrix, in that the
constructors and operator() functions take data in row-major format, as is
\brief The QQuaternion class represents a quaternion consisting of a vector and scalar.
\since 4.6
\ingroup painting-3D
+ \inmodule QtGui
Quaternions are used to represent rotations in 3D space, and
consist of a 3D rotation axis specified by the x, y, and z
\since 4.6
\ingroup painting
\ingroup painting-3D
+ \inmodule QtGui
The QVector2D class can also be used to represent vertices in 2D space.
We therefore do not need to provide a separate vertex class.
\brief The QVector3D class represents a vector or vertex in 3D space.
\since 4.6
\ingroup painting-3D
+ \inmodule QtGui
Vectors are one of the main building blocks of 3D representation and
drawing. They consist of three coordinates, traditionally called
\brief The QVector4D class represents a vector or vertex in 4D space.
\since 4.6
\ingroup painting-3D
+ \inmodule QtGui
The QVector4D class can also be used to represent vertices in 4D space.
We therefore do not need to provide a separate vertex class.
\brief The QOpenGLBuffer class provides functions for creating and managing OpenGL buffer objects.
\since 5.0
\ingroup painting-3D
+ \inmodule QtGui
Buffer objects are created in the OpenGL server so that the
client application can avoid uploading vertices, indices,
\class QOpenGLFramebufferObjectFormat
\brief The QOpenGLFramebufferObjectFormat class specifies the format of an OpenGL
framebuffer object.
+ \inmodule QtGui
\since 5.0
\class QOpenGLFramebufferObject
\brief The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object.
\since 5.0
+ \inmodule QtGui
\ingroup painting-3D
\brief The QOpenGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
\since 5.0
\ingroup painting-3D
+ \inmodule QtGui
OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
common across many desktop and embedded OpenGL implementations.
\class QOpenGLPaintDevice
\brief The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.
\since 5.0
+ \inmodule QtGui
\ingroup painting-3D
\brief The QOpenGLShaderProgram class allows OpenGL shader programs to be linked and used.
\since 5.0
\ingroup painting-3D
+ \inmodule QtGui
\section1 Introduction
\brief The QOpenGLShader class allows OpenGL shaders to be compiled.
\since 5.0
\ingroup painting-3D
+ \inmodule QtGui
This class supports shaders written in the OpenGL Shading Language (GLSL)
and in the OpenGL/ES Shading Language (GLSL/ES).
/*!
\class QBackingStore
\since 5.0
+ \inmodule QtGui
\brief The QBackingStore class provides the drawing area for top-level windows.
*/
\class QBrush
\ingroup painting
\ingroup shared
+ \inmodule QtGui
\brief The QBrush class defines the fill pattern of shapes drawn
by QPainter.
\class QGradient
\ingroup painting
\ingroup shared
+ \inmodule QtGui
\brief The QGradient class is used in combination with QBrush to
specify gradient fills.
/*!
\class QLinearGradient
\ingroup painting
+ \inmodule QtGui
\brief The QLinearGradient class is used in combination with QBrush to
specify a linear gradient brush.
/*!
\class QRadialGradient
\ingroup painting
+ \inmodule QtGui
\brief The QRadialGradient class is used in combination with QBrush to
specify a radial gradient brush.
/*!
\class QConicalGradient
\ingroup painting
+ \inmodule QtGui
\brief The QConicalGradient class is used in combination with QBrush to
specify a conical gradient brush.
\ingroup painting
\ingroup appearance
+ \inmodule QtGui
A color is normally specified in terms of RGB (red, green, and
\obsolete
\ingroup painting
+ \inmodule QtGui
A matrix specifies how to translate, scale, shear or rotate the
coordinate system, and is typically used when rendering graphics.
/*!
\class QPagedPaintDevice
+ \inmodule QtGui
\brief The QPagedPaintDevice class is a represents a paintdevice that supports
multiple pages.
/*!
\class QTextItem
+ \inmodule QtGui
\brief The QTextItem class provides all the information required to draw
text in a custom paint engine.
/*!
\class QPaintEngine
\ingroup painting
+ \inmodule QtGui
\brief The QPaintEngine class provides an abstract definition of how
QPainter draws to a given device on a given platform.
\brief The QPainter class performs low-level painting on widgets and
other paint devices.
+ \inmodule QtGui
\ingroup painting
\reentrant
/*!
\class QPaintEngineState
\since 4.1
+ \inmodule QtGui
\brief The QPaintEngineState class provides information about the
active paint engine's current state.
/*!
\since 4.7
\class QPainter::PixmapFragment
+ \inmodule QtGui
\brief This class is used in conjunction with the
QPainter::drawPixmapFragments() function to specify how a pixmap, or
\class QPainterPath
\ingroup painting
\ingroup shared
+ \inmodule QtGui
\brief The QPainterPath class provides a container for painting operations,
enabling graphical shapes to be constructed and reused.
/*!
\class QPainterPath::Element
+ \inmodule QtGui
\brief The QPainterPath::Element class specifies the position and
type of a subpath.
\since 4.1
\class QPainterPathStroker
\ingroup painting
+ \inmodule QtGui
\brief The QPainterPathStroker class is used to generate fillable
outlines for a given painter path.
/*! \class QPdfWriter
+ \inmodule QtGui
\brief The QPdfWriter class is a class to generate PDFs
that can be used as a paint device.
/*!
\class QPen
+ \inmodule QtGui
\ingroup painting
\ingroup shared
\class QPolygon
\brief The QPolygon class provides a vector of points using
integer precision.
+ \inmodule QtGui
\reentrant
\class QPolygonF
\brief The QPolygonF class provides a vector of points using
floating point precision.
+ \inmodule QtGui
\reentrant
\ingroup painting
\class QRegion
\brief The QRegion class specifies a clip region for a painter.
+ \inmodule QtGui
\ingroup painting
\ingroup shared
\brief The QTransform class specifies 2D transformations of a coordinate system.
\since 4.3
\ingroup painting
+ \inmodule QtGui
A transformation specifies how to translate, scale, shear, rotate
or project the coordinate system, and is typically used when
\brief The QAbstractTextDocumentLayout class is an abstract base
class used to implement custom layouts for QTextDocuments.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextObjectInterface class allows drawing of
custom text objects in \l{QTextDocument}s.
\since 4.5
+ \inmodule QtGui
A text object describes the structure of one or more elements in a
text document; for instance, images imported from HTML are
/*!
\class QAbstractTextDocumentLayout::PaintContext
\reentrant
+ \inmodule QtGui
\brief The QAbstractTextDocumentLayout::PaintContext class is a convenience
class defining the parameters used when painting a document's layout.
/*!
\class QAbstractTextDocumentLayout::Selection
\reentrant
+ \inmodule QtGui
\brief The QAbstractTextDocumentLayout::Selection class is a convenience
class defining the parameters of a selection.
\ingroup appearance
\ingroup shared
\ingroup richtext-processing
+ \inmodule QtGui
When you create a QFont object you specify various attributes that
\reentrant
\brief The QFontInfo class provides general information about fonts.
+ \inmodule QtGui
\ingroup appearance
\ingroup shared
/*!
\class QFontDatabase
\threadsafe
+ \inmodule QtGui
\brief The QFontDatabase class provides information about the fonts available in the underlying window system.
/*!
\class QFontMetrics
\reentrant
+ \inmodule QtGui
\brief The QFontMetrics class provides font metrics information.
/*!
\class QFontMetricsF
\reentrant
+ \inmodule QtGui
\brief The QFontMetricsF class provides font metrics information.
\class QGlyphRun
\brief The QGlyphRun class provides direct access to the internal glyphs in a font.
\since 4.8
+ \inmodule QtGui
\ingroup text
\mainclass
\brief The QSupportedWritingSystems class is used when registering fonts with the internal Qt
fontdatabase
\ingroup painting
+ \inmodule QtGui
Its to provide an easy to use interface for indicating what writing systems a specific font
supports.
\class QRawFont
\brief The QRawFont class provides access to a single physical instance of a font.
\since 4.8
+ \inmodule QtGui
\ingroup text
\mainclass
\brief The QStaticText class enables optimized drawing of text when the text and its layout
is updated rarely.
\since 4.7
+ \inmodule QtGui
\ingroup multimedia
\ingroup text
/*!
\class QSyntaxHighlighter
\reentrant
+ \inmodule QtGui
\brief The QSyntaxHighlighter class allows you to define syntax
highlighting rules, and in addition you can use the class to query
/*!
\class QTextCursor
\reentrant
+ \inmodule QtGui
\brief The QTextCursor class offers an API to access and modify QTextDocuments.
/*!
\class QTextDocument
\reentrant
+ \inmodule QtGui
\brief The QTextDocument class holds formatted text that can be
viewed and edited using a QTextEdit.
\class QTextDocumentFragment
\reentrant
+ \inmodule QtGui
\brief The QTextDocumentFragment class represents a piece of formatted text
from a QTextDocument.
\class QTextDocumentWriter
\brief The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to files or other devices.
+ \inmodule QtGui
\ingroup richtext-processing
\ingroup io
\brief The QTextLength class encapsulates the different types of length
used in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextFormat class provides formatting information for a
QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\ingroup shared
\brief The QTextCharFormat class provides formatting information for
characters in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextBlockFormat class provides formatting information for
blocks of text in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextListFormat class provides formatting information for
lists in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextFrameFormat class provides formatting information for
frames in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextTableFormat class provides formatting information for
tables in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextImageFormat class provides formatting information for
images in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextTableCellFormat class provides formatting information for
table cells in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextLayout::FormatRange structure is used to apply extra formatting information
for a specified area in the text layout's content.
+ \inmodule QtGui
\sa QTextLayout::setAdditionalFormats(), QTextLayout::draw()
*/
\brief The QTextInlineObject class represents an inline object in
a QTextLayout.
+ \inmodule QtGui
\ingroup richtext-processing
\reentrant
\brief The QTextLayout class is used to lay out and render text.
+ \inmodule QtGui
\ingroup richtext-processing
\reentrant
\brief The QTextLine class represents a line of text inside a QTextLayout.
+ \inmodule QtGui
\ingroup richtext-processing
\reentrant
\brief The QTextList class provides a decorated list of items in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextObject class is a base class for different kinds
of objects that can group parts of a QTextDocument together.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextBlockGroup class provides a container for text blocks within
a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\reentrant
\brief The QTextFrame class represents a frame in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The iterator class provides an iterator for reading
the contents of a QTextFrame.
+ \inmodule QtGui
\ingroup richtext-processing
A frame consists of an arbitrary sequence of \l{QTextBlock}s and
\reentrant
\brief The QTextBlockUserData class is used to associate custom data with blocks of text.
+ \inmodule QtGui
\since 4.1
\ingroup richtext-processing
\brief The QTextBlock class provides a container for text fragments in a
QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextBlock::iterator class provides an iterator for reading
the contents of a QTextBlock.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextFragment class holds a piece of text in a
QTextDocument with a single QTextCharFormat.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QTextOption class provides a description of general rich text
properties.
+ \inmodule QtGui
\ingroup richtext-processing
/*!
\class QTextOption::Tab
\since 4.4
+ \inmodule QtGui
Each tab definition is represented by this struct.
*/
\brief The QTextTableCell class represents the properties of a
cell in a QTextTable.
+ \inmodule QtGui
\ingroup richtext-processing
\reentrant
\brief The QTextTable class represents a table in a QTextDocument.
+ \inmodule QtGui
\ingroup richtext-processing
\brief The QDesktopServices class provides methods for accessing common desktop services.
\since 4.2
\ingroup desktop
+ \inmodule QtGui
Many desktop environments provide services that can be used by applications to
perform common tasks, such as opening a web page, in a way that is both consistent
/*!
\class QValidator
\brief The QValidator class provides validation of input text.
+ \inmodule QtGui
The class itself is abstract. Two subclasses, \l QIntValidator and
\l QDoubleValidator, provide basic numeric-range checking, and \l
\class QIntValidator
\brief The QIntValidator class provides a validator that ensures
a string contains a valid integer within a specified range.
+ \inmodule QtGui
Example of use:
\brief The QDoubleValidator class provides range checking of
floating-point numbers.
+ \inmodule QtGui
QDoubleValidator provides an upper bound, a lower bound, and a
limit on the number of digits after the decimal point. It does not
\class QRegExpValidator
\brief The QRegExpValidator class is used to check a string
against a regular expression.
+ \inmodule QtGui
QRegExpValidator uses a regular expression (regexp) to
determine whether an input string is \l Acceptable, \l
\ingroup groups
*/
+
/*!
\page printing.html
\title Printing with Qt
\ingroup qt-graphics
- \previouspage Styling
- \contentspage The Paint System
-
\brief A guide to producing printed output with Qt's paint system and widgets.
Qt provides extensive cross-platform support for printing. Using the printing
}
/*!
+ \page qwidget-styling.html
+ \title Styling
+
+ Qt's built-in widgets use the QStyle class to perform nearly all
+ of their drawing. QStyle is an abstract base class that
+ encapsulates the look and feel of a GUI, and can be used to make
+ the widgets look exactly like the equivalent native widgets or to
+ give the widgets a custom look.
+
+ Qt provides a set of QStyle subclasses that emulate the native
+ look of the different platforms supported by Qt (QWindowsStyle,
+ QMacStyle, QMotifStyle, etc.). These styles are built into the
+ QtGui library, other styles can be made available using Qt's
+ plugin mechansim.
+
+ Most functions for drawing style elements take four arguments:
+
+ \list
+ \li an enum value specifying which graphical element to draw
+ \li a QStyleOption object specifying how and where to render that element
+ \li a QPainter object that should be used to draw the element
+ \li a QWidget object on which the drawing is performed (optional)
+ \endlist
+
+ The style gets all the information it needs to render the
+ graphical element from the QStyleOption class. The widget is
+ passed as the last argument in case the style needs it to perform
+ special effects (such as animated default buttons on Mac OS X),
+ but it isn't mandatory. In fact, QStyle can be used to draw on any
+ paint device (not just widgets), in which case the widget argument
+ is a zero pointer.
+
+ \image paintsystem-stylepainter.png
+
+ The paint system also provides the QStylePainter class inheriting
+ from QPainter. QStylePainter is a convenience class for drawing
+ QStyle elements inside a widget, and extends QPainter with a set
+ of high-level drawing functions implemented on top of QStyle's
+ API. The advantage of using QStylePainter is that the parameter
+ lists get considerably shorter.
+
+ \table 100%
+ \row
+ \li \inlineimage paintsystem-icon.png
+ \li \b QIcon
+
+ The QIcon class provides scalable icons in different modes and states.
+
+ QIcon can generate pixmaps reflecting an icon's state, mode and
+ size. These pixmaps are generated from the set of pixmaps
+ made available to the icon, and are used by Qt widgets to show an
+ icon representing a particular action.
+
+ The rendering of a QIcon object is handled by the QIconEngine
+ class. Each icon has a corresponding icon engine that is
+ responsible for drawing the icon with a requested size, mode and
+ state.
+
+ \endtable
+
+ For more information about widget styling and appearance, see the
+ \l{Styles and Style Aware Widgets}.
+*/
+
+
+/*!
\class QStyle
\brief The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
control over size of header items and row and column sizes.
\sa QStyleOption, QStylePainter, {Styles Example},
- {Styles and Style Aware Widgets}, QStyledItemDelegate
+ {Styles and Style Aware Widgets}, QStyledItemDelegate, {Styling}
*/
/*!