1QDesktopWidget(3qt)                                        QDesktopWidget(3qt)
2
3
4

NAME

6       QDesktopWidget - Access to screen information on multi-head systems
7

SYNOPSIS

9       #include <qdesktopwidget.h>
10
11       Inherits QWidget.
12
13   Public Members
14       QDesktopWidget ()
15       ~QDesktopWidget ()
16       bool isVirtualDesktop () const
17       int numScreens () const
18       int primaryScreen () const
19       int screenNumber ( QWidget * widget = 0 ) const
20       int screenNumber ( const QPoint & point ) const
21       QWidget * screen ( int screen = -1 )
22       const QRect & screenGeometry ( int screen = -1 ) const
23       const QRect & screenGeometry ( QWidget * widget ) const
24       const QRect & screenGeometry ( const QPoint & p ) const
25       const QRect & availableGeometry ( int screen = -1 ) const
26       const QRect & availableGeometry ( QWidget * widget ) const
27       const QRect & availableGeometry ( const QPoint & p ) const
28
29   Signals
30       void resized ( int screen )
31

DESCRIPTION

33       The QDesktopWidget class provides access to screen information on
34       multi-head systems.
35
36       Systems with more than one graphics card and monitor can manage the
37       physical screen space available either as multiple desktops, or as a
38       large virtual desktop, which usually has the size of the bounding
39       rectangle of all the screens (see isVirtualDesktop()). For an
40       application, one of the available screens is the primary screen, i.e.
41       the screen where the main widget resides (see primaryScreen()). All
42       windows opened in the context of the application must be constrained to
43       the boundaries of the primary screen; for example, it would be
44       inconvenient if a dialog box popped up on a different screen, or split
45       over two screens.
46
47       The QDesktopWidget provides information about the geometry of the
48       available screens with screenGeometry(). The number of screens
49       available is returned by numScreens(). The screen number that a
50       particular point or widget is located in is returned by screenNumber().
51
52       Widgets provided by Qt use this class, for example, to place tooltips,
53       menus and dialog boxes according to the parent or application widget.
54
55       Applications can use this class to save window positions, or to place
56       child widgets on one screen.
57
58       <center>
59                                   [Image Omitted]
60
61       </center>
62
63       In the illustration above, Application One's primary screen is screen
64       0, and App Two's primary screen is screen 1.
65
66       See also Advanced Widgets and Environment Classes.
67

MEMBER FUNCTION DOCUMENTATION

QDesktopWidget::QDesktopWidget ()

70       Creates the desktop widget.
71
72       If the system supports a virtual desktop, this widget will have the
73       size of the virtual desktop; otherwise this widget will have the size
74       of the primary screen.
75
76       Instead of using QDesktopWidget directly, use QApplication::desktop().
77

QDesktopWidget::~QDesktopWidget ()

79       Destroy the object and free allocated resources.
80

const QRect & QDesktopWidget::availableGeometry ( int screen = -1 ) const

82       Returns the available geometry of the screen with index screen. What is
83       available will be subrect of screenGeometry() based on what the
84       platform decides is available (for example excludes the Dock and
85       Menubar on Mac OS X, or the taskbar on Windows).
86
87       See also screenNumber() and screenGeometry().
88

const QRect & QDesktopWidget::availableGeometry ( QWidget * widget ) const

90       This is an overloaded member function, provided for convenience. It
91       behaves essentially like the above function.
92
93       Returns the available geometry of the screen which contains widget.
94
95       See also screenGeometry().
96

const QRect & QDesktopWidget::availableGeometry ( const QPoint & p ) const

98       This is an overloaded member function, provided for convenience. It
99       behaves essentially like the above function.
100
101       Returns the available geometry of the screen which contains p.
102
103       See also screenGeometry().
104

bool QDesktopWidget::isVirtualDesktop () const

106       Returns TRUE if the system manages the available screens in a virtual
107       desktop; otherwise returns FALSE.
108
109       For virtual desktops, screen() will always return the same widget. The
110       size of the virtual desktop is the size of this desktop widget.
111

int QDesktopWidget::numScreens () const

113       Returns the number of available screens.
114
115       See also primaryScreen().
116

int QDesktopWidget::primaryScreen () const

118       Returns the index of the primary screen.
119
120       See also numScreens().
121

void QDesktopWidget::resized ( int screen ) [signal]

123       This signal is emitted when the size of screen changes.
124

QWidget * QDesktopWidget::screen ( int screen = -1 )

126       Returns a widget that represents the screen with index screen. This
127       widget can be used to draw directly on the desktop, using an unclipped
128       painter like this:
129
130           QPainter paint( QApplication::desktop()->screen( 0 ), TRUE );
131           paint.draw...
132           ...
133           paint.end();
134
135       If the system uses a virtual desktop, the returned widget will have the
136       geometry of the entire virtual desktop i.e. bounding every screen.
137
138       See also primaryScreen(), numScreens(), and isVirtualDesktop().
139

const QRect & QDesktopWidget::screenGeometry ( int screen = -1 ) const

141       Returns the geometry of the screen with index screen.
142
143       See also screenNumber().
144

const QRect & QDesktopWidget::screenGeometry ( QWidget * widget ) const

146       This is an overloaded member function, provided for convenience. It
147       behaves essentially like the above function.
148
149       Returns the geometry of the screen which contains widget.
150

const QRect & QDesktopWidget::screenGeometry ( const QPoint & p ) const

152       This is an overloaded member function, provided for convenience. It
153       behaves essentially like the above function.
154
155       Returns the geometry of the screen which contains p.
156

int QDesktopWidget::screenNumber ( QWidget * widget = 0 ) const

158       Returns the index of the screen that contains the largest part of
159       widget, or -1 if the widget not on a screen.
160
161       See also primaryScreen().
162

int QDesktopWidget::screenNumber ( const QPoint & point ) const

164       This is an overloaded member function, provided for convenience. It
165       behaves essentially like the above function.
166
167       Returns the index of the screen that contains point, or -1 if no screen
168       contains the point.
169
170       See also primaryScreen().
171
172

SEE ALSO

174       http://doc.trolltech.com/qdesktopwidget.html
175       http://www.trolltech.com/faq/tech.html
176
178       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
179       license file included in the distribution for a complete license
180       statement.
181

AUTHOR

183       Generated automatically from the source code.
184

BUGS

186       If you find a bug in Qt, please report it as described in
187       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
188       help you. Thank you.
189
190       The definitive Qt documentation is provided in HTML format; it is
191       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
192       web browser. This man page is provided as a convenience for those users
193       who prefer man pages, although this format is not officially supported
194       by Trolltech.
195
196       If you find errors in this manual page, please report them to qt-
197       bugs@trolltech.com.  Please include the name of the manual page
198       (qdesktopwidget.3qt) and the Qt version (3.3.8).
199
200
201
202Trolltech AS                    2 February 2007            QDesktopWidget(3qt)
Impressum