The QDesktopWidget class provides access to screen information on multi-head systems.
.PP
Systems with more than one graphics card and monitor can manage the physical screen space available either as multiple desktops, or as a large virtual desktop, which usually has the size of the bounding rectangle of all the screens (see isVirtualDesktop()). For an application, one of the available screens is the primary screen, i.e. the screen where the main widget resides (see primaryScreen()). All windows opened in the context of the application must be constrained to the boundaries of the primary screen; for example, it would be inconvenient if a dialog box popped up on a different screen, or split over two screens.
.PP
The QDesktopWidget provides information about the geometry of the available screens with screenGeometry(). The number of screens available is returned by numScreens(). The screen number that a particular point or widget is located in is returned by screenNumber().
Applications can use this class to save window positions, or to place child widgets on one screen.
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
In the illustration above, Application One's primary screen is screen 0, and App Two's primary screen is screen 1.
.PP
See also Advanced Widgets and Environment Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QDesktopWidget::QDesktopWidget ()"
Creates the desktop widget.
.PP
If the system supports a virtual desktop, this widget will have the size of the virtual desktop; otherwise this widget will have the size of the primary screen.
.PP
Instead of using QDesktopWidget directly, use QApplication::desktop().
Returns the available geometry of the screen with index \fIscreen\fR. What is available will be subrect of screenGeometry() based on what the platform decides is available (for example excludes the Dock and Menubar on Mac OS X, or the taskbar on Windows).
Returns TRUE if the system manages the available screens in a virtual desktop; otherwise returns FALSE.
.PP
For virtual desktops, screen() will always return the same widget. The size of the virtual desktop is the size of this desktop widget.
.SH "int QDesktopWidget::numScreens () const"
Returns the number of available screens.
.PP
See also primaryScreen().
.SH "int QDesktopWidget::primaryScreen () const"
Returns the index of the primary screen.
.PP
See also numScreens().
.SH "void QDesktopWidget::resized ( int screen )\fC [signal]\fR"
This signal is emitted when the size of \fIscreen\fR changes.
.SH "QWidget * QDesktopWidget::screen ( int screen = -1 )"
Returns a widget that represents the screen with index \fIscreen\fR. This widget can be used to draw directly on the desktop, using an unclipped painter like this: