|  | Home · Overviews · Examples |

# QDesktopWidget Class Reference
[com.trolltech.qt.gui module]

The `QDesktopWidget` class provides access to screen information on multi-head systems. More...

Inherits `QWidget`.

## Detailed Description

The `QDesktopWidget` class provides access to screen information on multi-head systems.

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 should 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.

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`.

Widgets provided by Qt use this class, for example, to place tooltips, menus and dialog boxes according to the parent or application widget.

Applications can use this class to save window positions, or to place child widgets on one screen.

In the illustration above, Application One's primary screen is screen 0, and App Two's primary screen is screen 1.

See also `QApplication` and `QX11Info::appRootWindow`.