|
|
Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QDesktopWidget class provides access to screen information on multi-head systems. More...
#include <qdesktopwidget.h>
Inherits QWidget.
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.
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 Advanced Widgets and Environment Classes.
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.
Instead of using QDesktopWidget directly, use QApplication::desktop().
See also screenNumber() and screenGeometry().
Returns the available geometry of the screen which contains widget.
See also screenGeometry().
Returns the available geometry of the screen which contains p.
See also screenGeometry().
For virtual desktops, screen() will always return the same widget. The size of the virtual desktop is the size of this desktop widget.
See also primaryScreen().
See also numScreens().
QPainter paint( QApplication::desktop()->screen( 0 ), TRUE ); paint.draw... ... paint.end();
If the system uses a virtual desktop, the returned widget will have the geometry of the entire virtual desktop i.e. bounding every screen.
See also primaryScreen(), numScreens(), and isVirtualDesktop().
See also screenNumber().
Returns the geometry of the screen which contains widget.
Returns the geometry of the screen which contains p.
See also primaryScreen().
Returns the index of the screen that contains point, or -1 if no screen contains the point.
See also primaryScreen().
This file is part of the Qt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.
Copyright © 2007 Trolltech | Trademarks | Qt 3.3.8
|