File: qglwidget.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (376 lines) | stat: -rw-r--r-- 23,528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QGLWidget Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QGLWidget Class Reference<br><small>[ <a href="opengl.html">OpenGL module</a> ]</small></h1><br clear="all">
<p>
The QGLWidget class is a widget for rendering OpenGL graphics.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qgl-h.html">qgl.h</a>&gt;</code>
<p>
Inherits <a href="qgl.html">QGL</a> and <a href="qwidget.html">QWidget</a>.
<p><a href="qglwidget-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#e29806"><b>QGLWidget</b></a>(QWidget*parent=0, constchar*name=0, constQGLWidget*shareWidget=0, WFlagsf=0)</div>
<li><div class="fn"><a href="#b3cf86"><b>QGLWidget</b></a>(constQGLFormat&amp;format, QWidget*parent=0, constchar*name=0, constQGLWidget*shareWidget=0, WFlagsf=0)</div>
<li><div class="fn"><a href="#a90e89"><b>~QGLWidget</b></a>()</div>
<li><div class="fn">void<a href="#f60400"><b>qglColor</b></a>(constQColor&amp;c)const</div>
<li><div class="fn">void<a href="#83fed2"><b>qglClearColor</b></a>(constQColor&amp;c)const</div>
<li><div class="fn">bool<a href="#af9038"><b>isValid</b></a>()const</div>
<li><div class="fn">bool<a href="#d11d34"><b>isSharing</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#7ca88b"><b>makeCurrent</b></a>()</div>
<li><div class="fn">bool<a href="#5052a3"><b>doubleBuffer</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#a0d069"><b>swapBuffers</b></a>()</div>
<li><div class="fn">QGLFormat<a href="#8ff6a1"><b>format</b></a>()const</div>
<li><div class="fn">constQGLContext*<a href="#e635da"><b>context</b></a>()const</div>
<li><div class="fn">virtualQPixmap<a href="#3f69d5"><b>renderPixmap</b></a>(intw=0, inth=0, booluseContext=FALSE)</div>
<li><div class="fn">virtualvoid<a href="#b1cf9a"><b>makeOverlayCurrent</b></a>()</div>
<li><div class="fn">constQGLContext*<a href="#9080cb"><b>overlayContext</b></a>()const</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#61d153"><b>updateGL</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#c0d439"><b>updateOverlayGL</b></a>()</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">QImage<a href="#d97f30"><b>convertToGLFormat</b></a>(constQImage&amp;img)</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#97a643"><b>initializeGL</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#cb5446"><b>resizeGL</b></a>(intw, inth)</div>
<li><div class="fn">virtualvoid<a href="#d4df00"><b>paintGL</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#aaf3a4"><b>initializeOverlayGL</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#ec2423"><b>resizeOverlayGL</b></a>(intw, inth)</div>
<li><div class="fn">virtualvoid<a href="#812634"><b>paintOverlayGL</b></a>()</div>
<li><div class="fn">void<a href="#27c712"><b>setAutoBufferSwap</b></a>(boolon)</div>
<li><div class="fn">bool<a href="#4ade53"><b>autoBufferSwap</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#660c7a"><b>paintEvent</b></a>(QPaintEvent*)</div>
<li><div class="fn">virtualvoid<a href="#d2994f"><b>resizeEvent</b></a>(QResizeEvent*)</div>
<li><div class="fn">virtualvoid<a href="#3329d9"><b>glInit</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#3f1977"><b>glDraw</b></a>()</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QGLWidget class is a widget for rendering OpenGL graphics.
<p>
QGLWidget provides functionality for displaying OpenGL graphics
integrated in a Qt application. It is very simple to use: you
inherit from it and use the subclass like any other <a href="qwidget.html">QWidget</a>, only
that instead of drawing the widget's contents using <a href="qpainter.html">QPainter</a> & al.,
you use the standard OpenGL rendering commands.
<p>QGLWidget provides three convenient virtual functions that you can
reimplement in your subclass to perform the typical OpenGL tasks:
<p><ul>
<li> <a href="#d4df00">paintGL</a>() - Render the OpenGL scene. Gets called whenever the widget
needs to be updated.
<li> <a href="#cb5446">resizeGL</a>() - Set up OpenGL viewport, projection etc. Gets called
whenever the the widget has been resized (and also when it shown
for the first time, since all newly created widgets get a resize
event automatically).
<li> <a href="#97a643">initializeGL</a>() - Set up the OpenGL rendering context, define display
lists etc. Gets called once before the first time resizeGL() or
paintGL() is called.
</ul>
<p>Here is a rough outline of how your QGLWidget subclass may look:
<p><pre>    class MyGLDrawer : public QGLWidget
    {
        Q_OBJECT        // must include this if you use Qt signals/slots

    public:
        MyGLDrawer( <a href="qwidget.html">QWidget</a> *parent, const char *name )
            : <a href="qglwidget.html">QGLWidget</a>(parent,name) {}

    protected:

        void initializeGL()
        {
          // Set up the rendering context, define display lists etc.:
          ...
          glClearColor( 0.0, 0.0, 0.0, 0.0 );
          glEnable(GL_DEPTH_TEST);
          ...
        }

        void resizeGL( int w, int h )
        {
          // setup viewport, projection etc.:
          glViewport( 0, 0, (GLint)w, (GLint)h );
          ...
          glFrustum( ... );
          ...
        }

        void paintGL()
        {
          // draw the scene:
          ...
          glRotatef( ... );
          glMaterialfv( ... );
          glBegin( GL_QUADS );
          glVertex3f( ... );
          glVertex3f( ... );
          ...
          glEnd();
          ...
        }

    };
</pre>
<p>If you need to trigger a repaint from other places than paintGL() (a
typical example is when using <a href="qtimer.html">timers</a> to animate
scenes), you should call the widget's <a href="#61d153">updateGL</a>() function.
<p>When paintGL(), resizeGL() or initializeGL() is called, your
widget's OpenGL rendering context has been made current.  If you
need to call the standard OpenGL API functions from other places
(e.g. in your widget's constructor), you must call <a href="#7ca88b">makeCurrent</a>()
first.
<p>QGLWidget provides advanced functions for requesting a new display
<a href="qglformat.html">format</a>, and you can even set a new rendering
<a href="qglcontext.html">context</a>.
<p>You can achieve sharing of OpenGL display lists between QGLWidgets,
see the documentation of the QGLWidget constructors for details.
<p><b>About Overlays:</b> The QGLWidget can create a GL overlay context
in addition to the normal context, if overlays are supported by the
underlying system.
<p>If you want to use overlays, you specify it in the <a href="qglformat.html">format</a>. (Note: Overlay must be requested in the format
passed to the QGLWidget constructor). Your GL widget should also
implement some or all of these virtual methods:
<p><ul>
<li> <a href="#812634">paintOverlayGL</a>()
<li> <a href="#ec2423">resizeOverlayGL</a>()
<li> <a href="#aaf3a4">initializeOverlayGL</a>()
</ul>
<p>These methods work in the same way as the normal paintGL() &
al. functions, only that they will be called when with the overlay
context made current. You can explicitly make the overlay context
current by using <a href="#b1cf9a">makeOverlayCurrent</a>(), and you can access the
overlay context directly (e.g. to ask for its transparent color) by
calling <a href="#9080cb">overlayContext</a>().
<p>Note: QGLWidget overlay support is currently implemented only for
the X11 window system. The Windows implementation is experimental.
<p>Note: On X servers where the default visual is in an overlay plane,
non-GL Qt windows can also be used for overlays; see the "overlay_x11"
example program for details.
<p>Note: Reparenting QGLWidgets under Windows does not work. This will
be improved in Qt 3.0. If you really need to change the widget
hierarchy after widget creation, simply destroy the old instance and
create a new one with the new parent.

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="e29806"></a>QGLWidget::QGLWidget(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, constQGLWidget*shareWidget=0, WFlagsf=0)</h3>
<p>Constructs an OpenGL widget with a <em>parent</em> widget and a <em>name.</em>
<p>The <a href="qglformat.html#8f6f62">default format</a> is
used. The widget will be <a href="#af9038">invalid</a> if the
system has no <a href="qglformat.html#59330f">OpenGL support</a>.
<p>The <em>parent, name</em> and <em>f</em> arguments are passed to the <a href="qwidget.html">QWidget</a>
constructor.
<p>If the <em>shareWidget</em> parameter points to a valid QGLWidget, this
widget will share OpenGL display lists with <em>shareWidget.</em> Note: If
this widget and <em>shareWidget</em> has different <a href="#8ff6a1">formats</a>, display list sharing may fail. You can check
whether display list sharing succeeded by using the <a href="#d11d34">isSharing</a>()
method.
<p>Note: Initialization of OpenGL rendering state etc. should be done
by overriding the <a href="#97a643">initializeGL</a>() function, not in the constructor of
your QGLWidget subclass.
<p>See also  <a href="qglformat.html#8f6f62">QGLFormat::defaultFormat</a>().
<h3 class="fn"><a name="b3cf86"></a>QGLWidget::QGLWidget(const<a href="qglformat.html">QGLFormat</a>&amp;format, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, constQGLWidget*shareWidget=0, WFlagsf=0)</h3>
<p>Constructs an OpenGL widget with a <em>parent</em> widget and a <em>name.</em>
<p>The <em>format</em> argument specifies the desired <a href="qglformat.html">rendering options</a>. If the underlying OpenGL/Window system
cannot satisfy all the features requested in <em>format,</em> the nearest
subset of features will be used. After creation, the <a href="#8ff6a1">format</a>() method
will return the actual format obtained.
<p>The widget will be <a href="#af9038">invalid</a> if the
system has no <a href="qglformat.html#59330f">OpenGL support</a>.
<p>The <em>parent, name</em> and <em>f</em> arguments are passed to the <a href="qwidget.html">QWidget</a>
constructor.
<p>If the <em>shareWidget</em> parameter points to a valid QGLWidget, this
widget will share OpenGL display lists with <em>shareWidget.</em> Note: If
this widget and <em>shareWidget</em> has different <a href="#8ff6a1">formats</a>, display list sharing may fail. You can check
whether display list sharing succeeded by using the <a href="#d11d34">isSharing</a>()
method.
<p>Note: Initialization of OpenGL rendering state etc. should be done
by overriding the <a href="#97a643">initializeGL</a>() function, not in the constructor of
your QGLWidget subclass.
<p>See also  <a href="qglformat.html#8f6f62">QGLFormat::defaultFormat</a>() and <a href="#af9038">isValid</a>().
<h3 class="fn"><a name="a90e89"></a>QGLWidget::~QGLWidget()</h3>
<p>Destroys the widget.
<h3 class="fn">bool<a name="4ade53"></a>QGLWidget::autoBufferSwap()const <code>[protected]</code></h3>
<p>Returns TRUE if the widget is doing automatic GL buffer swapping.
<p>See also  <a href="#27c712">setAutoBufferSwap</a>().
<h3 class="fn">const<a href="qglcontext.html">QGLContext</a>*<a name="e635da"></a>QGLWidget::context()const</h3>
<p>Returns the context of this widget.
<h3 class="fn"><a href="qimage.html">QImage</a><a name="d97f30"></a>QGLWidget::convertToGLFormat(const<a href="qimage.html">QImage</a>&amp;img) <code>[static]</code></h3>
<p>Convenience function for converting a <a href="qimage.html">QImage</a> into the format expected by
OpenGL's texture functions.
<h3 class="fn">bool<a name="5052a3"></a>QGLWidget::doubleBuffer()const</h3>
<p>Returns TRUE if the contained GL rendering context has double buffering.
<p>See also  <a href="qglformat.html#d90b73">QGLFormat::doubleBuffer</a>().
<h3 class="fn"><a href="qglformat.html">QGLFormat</a><a name="8ff6a1"></a>QGLWidget::format()const</h3>
<p>Returns the format of the contained GL rendering context.
<h3 class="fn">void<a name="3f1977"></a>QGLWidget::glDraw() <code>[virtualprotected]</code></h3>
<p>Executes the virtual function <a href="#d4df00">paintGL</a>(), initializing first as necessary.
<h3 class="fn">void<a name="3329d9"></a>QGLWidget::glInit() <code>[virtualprotected]</code></h3>
<p>Initializes OpenGL for this widget's context. Calls the virtual
function <a href="#97a643">initializeGL</a>().
<h3 class="fn">void<a name="97a643"></a>QGLWidget::initializeGL() <code>[virtualprotected]</code></h3>
<p>This virtual function is called one time before the first call to
<a href="#d4df00">paintGL</a>() or <a href="#cb5446">resizeGL</a>(), and then one time whenever the widget has
been assigned a new <a href="qglcontext.html">QGLContext</a>.  Reimplement it in a subclass.
<p>This function should take care of setting any required OpenGL
context rendering flags, defining display lists, etc.
<p>There is no need to call <a href="#7ca88b">makeCurrent</a>() because this has already been
done when this function is called.
<h3 class="fn">void<a name="aaf3a4"></a>QGLWidget::initializeOverlayGL() <code>[virtualprotected]</code></h3>
<p>This virtual function is used in the same manner as <a href="#97a643">initializeGL</a>(),
only for the widget's overlay context instead of the widget's main
context. That is, initializeOverlayGL() is called one time before
the first call to <a href="#812634">paintOverlayGL</a>() or <a href="#ec2423">resizeOverlayGL</a>(). Reimplement
it in a subclass.
<p>This function should take care of setting any required OpenGL
context rendering flags, defining display lists, etc., for the
overlay context.
<p>There is no need to call <a href="#b1cf9a">makeOverlayCurrent</a>() because this has already
been done when this function is called.
<h3 class="fn">bool<a name="d11d34"></a>QGLWidget::isSharing()const</h3>
<p>Returns TRUE if display list sharing with another QGLWidget was
requested in the constructor, and the GL system was able to provide
it. The GL system may fail to provide display list sharing if the
two QGLWidgets use different formats.
<p>See also  <a href="#8ff6a1">format</a>().
<h3 class="fn">bool<a name="af9038"></a>QGLWidget::isValid()const</h3>
<p>Returns TRUE if the widget has a valid GL rendering context. A
widget will be invalid if the system has no <a href="qglformat.html#59330f">OpenGL support</a>
<h3 class="fn">void<a name="7ca88b"></a>QGLWidget::makeCurrent() <code>[virtual]</code></h3>
<p>Makes this widget the current widget for OpenGL
operations. I.e. makes this widget's rendering context the current
OpenGL rendering context.
<h3 class="fn">void<a name="b1cf9a"></a>QGLWidget::makeOverlayCurrent() <code>[virtual]</code></h3>
<p>Makes the overlay context of this widget current. Use this if you
need to issue OpenGL commands to the overlay context outside of
<a href="#aaf3a4">initializeOverlayGL</a>(), <a href="#ec2423">resizeOverlayGL</a>() and <a href="#812634">paintOverlayGL</a>().
<p>Does nothing if this widget has no overlay.
<p>See also  <a href="#7ca88b">makeCurrent</a>().
<h3 class="fn">const<a href="qglcontext.html">QGLContext</a>*<a name="9080cb"></a>QGLWidget::overlayContext()const</h3>
<p>Returns the overlay context of this widget, or 0 if this widget has
no overlay.
<p>See also  <a href="#e635da">context</a>().
<h3 class="fn">void<a name="660c7a"></a>QGLWidget::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Handles paint events. Will cause the virtual <a href="#d4df00">paintGL</a>() function to
be called, initializing first as necessary.
<p>Reimplemented from <a href="qwidget.html#e3d821">QWidget.</a>
<h3 class="fn">void<a name="d4df00"></a>QGLWidget::paintGL() <code>[virtualprotected]</code></h3>
<p>This virtual function is called whenever the widget needs to be painted.
Reimplement it in a subclass.
<p>There is no need to call <a href="#7ca88b">makeCurrent</a>() because this has already been
done when this function is called.
<h3 class="fn">void<a name="812634"></a>QGLWidget::paintOverlayGL() <code>[virtualprotected]</code></h3>
<p>This virtual function is used in the same manner as <a href="#d4df00">paintGL</a>(), only
for the widget's overlay context instead of the widget's main
context. That is, paintOverlayGL() is called whenever the widget's
overlay needs to be painted.  Reimplement it in a subclass.
<p>There is no need to call <a href="#b1cf9a">makeOverlayCurrent</a>() because this
has already been done when this function is called.
<h3 class="fn">void<a name="83fed2"></a>QGLWidget::qglClearColor(const<a href="qcolor.html">QColor</a>&amp;c)const</h3>
<p>Convenience function for specifying the clearing color to
OpenGL. Calls glClearColor (in RGBA mode) or glClearIndex (in
color-index mode) with the color <em>c.</em> Applies to the current GL
context.
<p>See also  <a href="#f60400">qglColor</a>(), <a href="qglcontext.html#8859cd">QGLContext::currentContext</a>() and <a href="qcolor.html">QColor</a>.
<h3 class="fn">void<a name="f60400"></a>QGLWidget::qglColor(const<a href="qcolor.html">QColor</a>&amp;c)const</h3>
<p>Convenience function for specifying a drawing color to OpenGL. Calls
glColor3 (in RGBA mode) or glIndex (in color-index mode) with the
color <em>c.</em> Applies to the current GL context.
<p>See also  <a href="#83fed2">qglClearColor</a>(), <a href="qglcontext.html#8859cd">QGLContext::currentContext</a>() and <a href="qcolor.html">QColor</a>.
<h3 class="fn"><a href="qpixmap.html">QPixmap</a><a name="3f69d5"></a>QGLWidget::renderPixmap(intw=0, inth=0, booluseContext=FALSE) <code>[virtual]</code></h3>
<p>Renders the current scene on a pixmap and returns it.
<p>You may use this method on both visible and invisible QGLWidgets.
<p>This method will create a pixmap and a temporary <a href="qglcontext.html">QGLContext</a> to
render on it. Then, <a href="#97a643">initializeGL</a>(), <a href="#cb5446">resizeGL</a>(), and <a href="#d4df00">paintGL</a>() are
called on this context. Finally, the widget's original GL context is
restored.
<p>The size of the pixmap will be width <em>w</em> and height <em>h.</em> If any of
those are 0 (the default), the pixmap will have the same size as the
widget.
<p>If <em>useContext</em> is TRUE, this method will try to be more efficient
by using the existing GL context to render the pixmap. The default
is FALSE. Use only if you know what you are doing.
<p>Any overlay is not rendered to the pixmap.
<p>Bugs and limitations:
<ul>
<li>May give unexpected results if the depth of the GL rendering
context is different from the depth of the desktop.
</ul>
<h3 class="fn">void<a name="d2994f"></a>QGLWidget::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Handles resize events. Calls the virtual function <a href="#cb5446">resizeGL</a>().
<p>Reimplemented from <a href="qwidget.html#7d375f">QWidget.</a>
<h3 class="fn">void<a name="cb5446"></a>QGLWidget::resizeGL(intwidth, intheight) <code>[virtualprotected]</code></h3>
<p>This virtual function is called whenever the widget has been resized.
Reimplement it in a subclass.
<p>There is no need to call <a href="#7ca88b">makeCurrent</a>() because this has already been
done when this function is called.
<h3 class="fn">void<a name="ec2423"></a>QGLWidget::resizeOverlayGL(int, int) <code>[virtualprotected]</code></h3>
<p>This virtual function is used in the same manner as <a href="#d4df00">paintGL</a>(), only
for the widget's overlay context instead of the widget's main
context. That is, resizeOverlayGL() is called whenever the widget
has been resized. Reimplement it in a subclass.
<p>There is no need to call <a href="#b1cf9a">makeOverlayCurrent</a>() because
this has already been done when this function is called.
<h3 class="fn">void<a name="27c712"></a>QGLWidget::setAutoBufferSwap(boolon) <code>[protected]</code></h3>
<p>Turns on or off the automatic GL buffer swapping. If on, and the
widget is using a double-buffered format, the background and
foreground GL buffers will automatically be swapped after each time
the <a href="#d4df00">paintGL</a>() function has been called.
<p>The buffer auto-swapping is on by default.
<p>See also  <a href="#4ade53">autoBufferSwap</a>(), <a href="#5052a3">doubleBuffer</a>() and <a href="#a0d069">swapBuffers</a>().
<h3 class="fn">void<a name="5a8a07"></a>QGLWidget::setMouseTracking(boolenable) <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#36406c">QWidget.</a>
<h3 class="fn">void<a name="a0d069"></a>QGLWidget::swapBuffers() <code>[virtual]</code></h3>
<p>Swaps the screen contents with an off-screen buffer. Works only if
the widget's format specifies double buffer mode.
<p>Normally, there is no need to explicitly call this function, because
it is done automatically after each widget repaint, i.e. after each
time <a href="#d4df00">paintGL</a>() has been executed.
<p>See also  <a href="#5052a3">doubleBuffer</a>(), <a href="#27c712">setAutoBufferSwap</a>() and <a href="qglformat.html#38644f">QGLFormat::setDoubleBuffer</a>().
<h3 class="fn">void<a name="61d153"></a>QGLWidget::updateGL() <code>[virtualslot]</code></h3>
<p>Updates the widget by calling <a href="#3f1977">glDraw</a>().
<h3 class="fn">void<a name="c0d439"></a>QGLWidget::updateOverlayGL() <code>[virtualslot]</code></h3>
<p>Updates the widget's overlay (if any). Will cause the virtual
function <a href="#812634">paintOverlayGL</a>() to be executed, initializing first as
necessary.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>