1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qdesktopwidget_win.cpp:226 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QDesktopWidget Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDesktopWidget Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QDesktopWidget class provides access to screen information on multi-head systems.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qdesktopwidget-h.html">qdesktopwidget.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
38 | <p><a href="qdesktopwidget-members.html">List of all member functions.</a>
|
---|
39 | <h2>Public Members</h2>
|
---|
40 | <ul>
|
---|
41 | <li class=fn><a href="#QDesktopWidget"><b>QDesktopWidget</b></a> ()</li>
|
---|
42 | <li class=fn><a href="#~QDesktopWidget"><b>~QDesktopWidget</b></a> ()</li>
|
---|
43 | <li class=fn>bool <a href="#isVirtualDesktop"><b>isVirtualDesktop</b></a> () const</li>
|
---|
44 | <li class=fn>int <a href="#numScreens"><b>numScreens</b></a> () const</li>
|
---|
45 | <li class=fn>int <a href="#primaryScreen"><b>primaryScreen</b></a> () const</li>
|
---|
46 | <li class=fn>int <a href="#screenNumber"><b>screenNumber</b></a> ( QWidget * widget = 0 ) const</li>
|
---|
47 | <li class=fn>int <a href="#screenNumber-2"><b>screenNumber</b></a> ( const QPoint & point ) const</li>
|
---|
48 | <li class=fn>QWidget * <a href="#screen"><b>screen</b></a> ( int screen = -1 )</li>
|
---|
49 | <li class=fn>const QRect & <a href="#screenGeometry"><b>screenGeometry</b></a> ( int screen = -1 ) const</li>
|
---|
50 | <li class=fn>const QRect & <a href="#screenGeometry-2"><b>screenGeometry</b></a> ( QWidget * widget ) const</li>
|
---|
51 | <li class=fn>const QRect & <a href="#screenGeometry-3"><b>screenGeometry</b></a> ( const QPoint & p ) const</li>
|
---|
52 | <li class=fn>const QRect & <a href="#availableGeometry"><b>availableGeometry</b></a> ( int screen = -1 ) const</li>
|
---|
53 | <li class=fn>const QRect & <a href="#availableGeometry-2"><b>availableGeometry</b></a> ( QWidget * widget ) const</li>
|
---|
54 | <li class=fn>const QRect & <a href="#availableGeometry-3"><b>availableGeometry</b></a> ( const QPoint & p ) const</li>
|
---|
55 | </ul>
|
---|
56 | <h2>Signals</h2>
|
---|
57 | <ul>
|
---|
58 | <li class=fn>void <a href="#resized"><b>resized</b></a> ( int screen )</li>
|
---|
59 | </ul>
|
---|
60 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
61 |
|
---|
62 |
|
---|
63 | The QDesktopWidget class provides access to screen information on multi-head systems.
|
---|
64 | <p>
|
---|
65 |
|
---|
66 | <p> Systems with more than one graphics card and monitor can manage the
|
---|
67 | physical screen space available either as multiple desktops, or as a
|
---|
68 | large virtual desktop, which usually has the size of the bounding
|
---|
69 | rectangle of all the screens (see <a href="#isVirtualDesktop">isVirtualDesktop</a>()). For an
|
---|
70 | application, one of the available screens is the primary screen, i.e.
|
---|
71 | the screen where the main widget resides (see <a href="#primaryScreen">primaryScreen</a>()). All
|
---|
72 | windows opened in the context of the application must be
|
---|
73 | constrained to the boundaries of the primary screen; for example,
|
---|
74 | it would be inconvenient if a dialog box popped up on a different
|
---|
75 | screen, or split over two screens.
|
---|
76 | <p> The QDesktopWidget provides information about the geometry of the
|
---|
77 | available screens with <a href="#screenGeometry">screenGeometry</a>(). The number of screens
|
---|
78 | available is returned by <a href="#numScreens">numScreens</a>(). The screen number that a
|
---|
79 | particular point or widget is located in is returned by
|
---|
80 | <a href="#screenNumber">screenNumber</a>().
|
---|
81 | <p> Widgets provided by Qt use this class, for example, to place
|
---|
82 | tooltips, menus and dialog boxes according to the parent or
|
---|
83 | application widget.
|
---|
84 | <p> Applications can use this class to save window positions, or to place
|
---|
85 | child widgets on one screen.
|
---|
86 | <p> <center><img src="qdesktopwidget.png" alt="Managing Multiple Screens"></center>
|
---|
87 | <p> In the illustration above, Application One's primary screen is
|
---|
88 | screen 0, and App Two's primary screen is screen 1.
|
---|
89 | <p> <p>See also <a href="advanced.html">Advanced Widgets</a> and <a href="environment.html">Environment Classes</a>.
|
---|
90 |
|
---|
91 | <hr><h2>Member Function Documentation</h2>
|
---|
92 | <h3 class=fn><a name="QDesktopWidget"></a>QDesktopWidget::QDesktopWidget ()
|
---|
93 | </h3>
|
---|
94 | Creates the desktop widget.
|
---|
95 | <p> If the system supports a virtual desktop, this widget will have
|
---|
96 | the size of the virtual desktop; otherwise this widget will have
|
---|
97 | the size of the primary screen.
|
---|
98 | <p> Instead of using QDesktopWidget directly, use
|
---|
99 | <a href="qapplication.html#desktop">QApplication::desktop</a>().
|
---|
100 |
|
---|
101 | <h3 class=fn><a name="~QDesktopWidget"></a>QDesktopWidget::~QDesktopWidget ()
|
---|
102 | </h3>
|
---|
103 | Destroy the object and free allocated resources.
|
---|
104 |
|
---|
105 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="availableGeometry"></a>QDesktopWidget::availableGeometry ( int screen = -1 ) const
|
---|
106 | </h3>
|
---|
107 | Returns the available geometry of the screen with index <em>screen</em>. What
|
---|
108 | is available will be subrect of <a href="#screenGeometry">screenGeometry</a>() based on what the
|
---|
109 | platform decides is available (for example excludes the Dock and Menubar
|
---|
110 | on Mac OS X, or the taskbar on Windows).
|
---|
111 | <p> <p>See also <a href="#screenNumber">screenNumber</a>() and <a href="#screenGeometry">screenGeometry</a>().
|
---|
112 |
|
---|
113 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="availableGeometry-2"></a>QDesktopWidget::availableGeometry ( <a href="qwidget.html">QWidget</a> * widget ) const
|
---|
114 | </h3>
|
---|
115 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
116 | <p> Returns the available geometry of the screen which contains <em>widget</em>.
|
---|
117 | <p> <p>See also <a href="#screenGeometry">screenGeometry</a>().
|
---|
118 |
|
---|
119 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="availableGeometry-3"></a>QDesktopWidget::availableGeometry ( const <a href="qpoint.html">QPoint</a> & p ) const
|
---|
120 | </h3>
|
---|
121 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
122 | <p> Returns the available geometry of the screen which contains <em>p</em>.
|
---|
123 | <p> <p>See also <a href="#screenGeometry">screenGeometry</a>().
|
---|
124 |
|
---|
125 | <h3 class=fn>bool <a name="isVirtualDesktop"></a>QDesktopWidget::isVirtualDesktop () const
|
---|
126 | </h3>
|
---|
127 | Returns TRUE if the system manages the available screens in a
|
---|
128 | virtual desktop; otherwise returns FALSE.
|
---|
129 | <p> For virtual desktops, <a href="#screen">screen</a>() will always return the same widget.
|
---|
130 | The size of the virtual desktop is the size of this desktop
|
---|
131 | widget.
|
---|
132 |
|
---|
133 | <h3 class=fn>int <a name="numScreens"></a>QDesktopWidget::numScreens () const
|
---|
134 | </h3>
|
---|
135 | Returns the number of available screens.
|
---|
136 | <p> <p>See also <a href="#primaryScreen">primaryScreen</a>().
|
---|
137 |
|
---|
138 | <h3 class=fn>int <a name="primaryScreen"></a>QDesktopWidget::primaryScreen () const
|
---|
139 | </h3>
|
---|
140 | Returns the index of the primary screen.
|
---|
141 | <p> <p>See also <a href="#numScreens">numScreens</a>().
|
---|
142 |
|
---|
143 | <h3 class=fn>void <a name="resized"></a>QDesktopWidget::resized ( int screen )<tt> [signal]</tt>
|
---|
144 | </h3>
|
---|
145 | This signal is emitted when the size of <em>screen</em> changes.
|
---|
146 |
|
---|
147 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="screen"></a>QDesktopWidget::screen ( int screen = -1 )
|
---|
148 | </h3>
|
---|
149 | Returns a widget that represents the screen with index <em>screen</em>.
|
---|
150 | This widget can be used to draw directly on the desktop, using an
|
---|
151 | unclipped painter like this:
|
---|
152 | <p> <pre>
|
---|
153 | <a href="qpainter.html">QPainter</a> paint( QApplication::<a href="qapplication.html#desktop">desktop</a>()->screen( 0 ), TRUE );
|
---|
154 | paint.draw...
|
---|
155 | ...
|
---|
156 | paint.<a href="qpainter.html#end">end</a>();
|
---|
157 | </pre>
|
---|
158 |
|
---|
159 | <p> If the system uses a virtual desktop, the returned widget will
|
---|
160 | have the geometry of the entire virtual desktop i.e. bounding
|
---|
161 | every <em>screen</em>.
|
---|
162 | <p> <p>See also <a href="#primaryScreen">primaryScreen</a>(), <a href="#numScreens">numScreens</a>(), and <a href="#isVirtualDesktop">isVirtualDesktop</a>().
|
---|
163 |
|
---|
164 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="screenGeometry"></a>QDesktopWidget::screenGeometry ( int screen = -1 ) const
|
---|
165 | </h3>
|
---|
166 | Returns the geometry of the screen with index <em>screen</em>.
|
---|
167 | <p> <p>See also <a href="#screenNumber">screenNumber</a>().
|
---|
168 |
|
---|
169 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="screenGeometry-2"></a>QDesktopWidget::screenGeometry ( <a href="qwidget.html">QWidget</a> * widget ) const
|
---|
170 | </h3>
|
---|
171 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
172 | <p> Returns the geometry of the screen which contains <em>widget</em>.
|
---|
173 |
|
---|
174 | <h3 class=fn>const <a href="qrect.html">QRect</a> & <a name="screenGeometry-3"></a>QDesktopWidget::screenGeometry ( const <a href="qpoint.html">QPoint</a> & p ) const
|
---|
175 | </h3>
|
---|
176 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
177 | <p> Returns the geometry of the screen which contains <em>p</em>.
|
---|
178 |
|
---|
179 | <h3 class=fn>int <a name="screenNumber"></a>QDesktopWidget::screenNumber ( <a href="qwidget.html">QWidget</a> * widget = 0 ) const
|
---|
180 | </h3>
|
---|
181 | Returns the index of the screen that contains the largest
|
---|
182 | part of <em>widget</em>, or -1 if the widget not on a screen.
|
---|
183 | <p> <p>See also <a href="#primaryScreen">primaryScreen</a>().
|
---|
184 |
|
---|
185 | <h3 class=fn>int <a name="screenNumber-2"></a>QDesktopWidget::screenNumber ( const <a href="qpoint.html">QPoint</a> & point ) const
|
---|
186 | </h3>
|
---|
187 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
188 | <p> Returns the index of the screen that contains <em>point</em>, or -1 if
|
---|
189 | no screen contains the point.
|
---|
190 | <p> <p>See also <a href="#primaryScreen">primaryScreen</a>().
|
---|
191 |
|
---|
192 | <!-- eof -->
|
---|
193 | <hr><p>
|
---|
194 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
195 | Copyright © 1995-2007
|
---|
196 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
197 | <table width=100% cellspacing=0 border=0><tr>
|
---|
198 | <td>Copyright © 2007
|
---|
199 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
200 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
201 | </table></div></address></body>
|
---|
202 | </html>
|
---|