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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
This examples directory contains lots of TQt examples. And there are
additional examples in ../tools/designer/examples/ and in the
extensions subdirectories. The documentation contains two detailed Qt
tutorials and additional tutorials for TQt Designer. The examples here
are useful for learning particular TQt classes and techniques, but to
learn TQt itself we recommend starting with the documentation's short
"How to Learn Qt" document.
It is best to run each example from its own directory since some of
them assume they are run from there.
aclock
This example displays an analog clock widget.
It shows how to create a custom widget (TQWidget subclass) and how
to create a timer using TQTimer.
action
A single document interface application example with a menu bar,
tool bar and status bar that provides simple text editing.
It shows how to implement a typical modern application, how to
create a TQMainWindow subclass, and how to create actions that can
be assigned to menus (TQPopupMenu) and toolbars (TQToolBar) using
TQAction. It also shows how to print using TQSimpleRichText.
addressbook [obsolete]
application [obsolete; see the action example instead]
biff [Unix-specific]
Biff is a simple graphical program to indicate whether there is
new mail; it looks like xbiff but is much shorter.
buttongroups
This examples shows different types of group boxes (TQButtonGroup,
and TQGroupBox), and different kinds of buttons (TQCheckBox,
TQRadioButton, and TQPushButton). It also shows how to add a
TQPopupMenu to a button.
canvas
This examples demonstrates many of TQCanvasView's facilities, but
by no means all of them. It uses TQCanvasItem, TQCanvasLine,
TQCanvasRectangle, TQCanvasEllipse, TQCanvasSprite, and of course
TQCanvas.
chart
An application for maintaining simple numeric data and visualising
the data using pie and bar charts.
Tutorial #2 explains this application in detail.
checklists
Shows two list views with check box and radio button items. (These
kinds of lists are often used with setup programs.)
Shows the use of TQListView, TQListViewItem, TQCheckListItem,
TQListViewItemIterator, and TQValueList.
cursor
This example shows how to set the mouse cursor for a widget. Shows
Qt's cursors and a custom cursor using TQLabel and QCursor.
customlayout
This examples demonstrates how to write a customized layout
(geometry) manager, like a Card-Layout, Border-Layout and
Flow-Layout.
dclock
This example displays a digital LCD clock and can switch between
time and date.
It uses the TQLCDNumber widget and a couple of TQTimers.
demo
Run this to see almost all of Qt's widgets in action, including
drag and drop, 2D graphics, etc.
desktop
The desktop demo contains three routines, each of which draws
something on the desktop. It does some nice stuff with TQPainter,
and also demonstrates how one can treat the desktop as a widget
like any other.
dirview
This example program demonstrates how to use a TQListView and
TQListViewItems to build a multi-column hierarchical, memory- and
CPU-efficient directory browser. It also demonstrates how to use
Drag'n'Drop in a TQListview. (See also the fileiconview example.)
distributor
This is a utility program that can be used to modify the paths
used in the TQt library binary to make the binary suitable for
distribution. For experts only.
dragdrop
Demonstrates image and text drag and drop.
drawdemo
Draws a color wheel, text and shapes. This example demonstrates
several drawing functions and printer output using TQPainter,
TQWMatrix, TQFont, TQFontMetrics, TQColor, TQBrush, and TQPrinter. You
can easily add you own drawing functions. See "ourDrawFunctions".
drawlines
This example shows very simple mouse-based user interaction and
painting without any world transform matrix or other advanced
features. Run the program, click the button, move the mouse,
release the button, and watch the lines get drawn.
extension
An extension dialog with simple and advanced appearances
controlled by a toggle button.
fileiconview
This example partially implements a very basic file manager using
a widget derived from TQIconView to display the current directory.
It uses the DirectoryView widget from the dirview example to
display the directory tree.
It also shows how to add a TQComboBox to a TQToolBar and how to
implement a context menu using TQPopupMenu.
fonts [obsolete; see the qfd example instead]
forever
WARNING: this program has a strobe effect.
See how fast TQt can draw colored rectangles. This example
continuously draws rectangles in a window and has another widget
that counts the number of rectangles that are drawn per second.
gridview
A TQGridView with 100x100 cells.
hello
Hello world with colored animated wavy text.
helpdemo
Shows how to use TQt Assistant as an application's online help
tool. (See also the helpsystem example.)
helpsystem
This example shows how to implement context-sensitive help in
various ways in a TQt application using TQToolTip, TQWhatsThis, and
QAssistantClient to control TQt Assistant.
helpviewer
The HelpViewer example implements a simple HTML help browser using
Qt's richtext capabilities.
i18n
This example shows how to internationalize applications. Start it with
./i18n en
to run the application in English, and with
./i18n de
to run it in German. Other languages are also available including,
Arabic (ar), French (fr), Italian (it), Japanese (jp), Korean
(ko), Norwegian (no), and Russian (ru). Some languages depend on
the availability of suitable fonts.
iconview
This example implements a flexible icon view which can store lots
of icon items. It supports Drag'n'Drop and different selection
modes using TQIconView.
layout [obsolete]
This example shows simple and intermediate use of Qt's layout
classes, TQGridLaout, TQBoxLayout etc.
life
An implementation of the life game with a Unix-flavor GUI.
lineedits
This example shows how to use various properties of TQLineEdit
including echo modes, input masks, and validators.
listbox
Shows TQListBox options.
listboxcombo
This example shows how to use TQListBox (with single selection and
multi selection) and TQComboBox (editable and non-editable).
listviews
This examples shows how to work with TQListView (a tree view
widget)
mdi
Similar to the action example, but this time using MDI (Multiple
Document Interface). It subclasses TQMainWindow and uses the
TQWorkspace class to provide MDI and shows how to implement an MDI
Window menu.
menu
This example demonstrates the simple use of menus (a menu bar and
pull-down menus), and a context menu. (See also the popup
example.)
movies
The Movies example displays animated GIF files using the TQMovie
and TQLabel classes.
network/archivesearch
Shows how to use TQHttp to request and receive data from a web
site.
network/clientserver
Provides a client application and a server application that
communicate using TQSocket and TQServerSocket.
network/ftpclient
A simple FTP client that uses TQFtp to retrieve directory listings
and to download and upload files.
network/httpd
An extremely simple HTTP daemon built using TQServerSocket.
network/infoprotocol
A more complex client/server example.
network/mail
A simple mail client that can send email using the TQSocket class.
network/networkprotocol
A simple implementation of a subset of the NNTP protocol. This
shows how to implement your own network protocols by subclassing
TQNetworkProtocol.
network/remotecontrol
Controlling one application from another using TQSocket-based IPC.
opengl/box
Shows how to use OpenGL in TQt using TQGLWidget.
opengl/gear
Shows how to build OpenGL display lists.
opengl/glpixmap
This is based on the box example. It shows how to render an OpenGL
scene into a TQPixmap.
opengl/overlay
Demonstrates the use of OpenGL overlays (where supported).
opengl/sharedbox
Demonstrates how to share OpenGL display lists with TQGLWidgets.
opengl/texture
Shows how to use OpenGL textures.
picture
This example shows how to make, store to file, and read back, a
picture as a set of vector drawing commands.
popup
This examples shows how to implement popup widgets.
process
Shows how to execute a non-GUI application in a separate process
with I/O redirection.
progress
WARNING: this program has a strobe effect.
This example presents a long-running process (drawing lots of
rectangles) and a TQProgressDialog. Two types of progress dialog
are offered, one that simply shows text, and a custom one that
shows an animation using a TQLabel and a TQTimer.
progressbar
Shows how to use a TQProgressBar.
tqdir
Shows how to use and customize TQFileDialog. Run
tqdir --help
for details. Also shows TQFileInfo.
qfd
This example program displays all the characters of a selected
font. It shows the use of TQFontDialog, TQFontMetrics and TQFontInfo,
and a TQTable subclass.
qmag
This is a simple magnifier-type program. It shows how one can do
some quite low-level operations portably using Qt.
qwerty
Simple text editor for testing different character encodings.
rangecontrols
This examples shows how to use TQSpinBox and TQSlider.
regexptester
This little application is useful for testing regular expressions.
richtext
This example shows the use of TQTextView (a read/only TQTextEdit
subclass).
rot13
A simple implementation of the rot13 algorithm.
scribble
An implementation of the well known scribble program. You can draw
with different pen colors and widths and save the result as a
pixmap in various formats. It shows how to do drawing using a
TQWidget subclass (rather than a TQCanvas for example). It also
shows how to add a TQSpinBox to a TQToolBar and how to implement a
button that pops up a menu (using TQPushButton and TQPopupMenu), and
also how to use the TQColorDialog.
scrollview
This example shows one way of using a TQScrollview. This widget is
highly optimized for showing very large contents including child
widgets.
showimg
This example reads and displays an image in any supported image
format (GIF, BMP, PPM, XMP, etc.)
sound
Shows how to play sounds from a TQt application (and how to see if
sound is supported) using QSound.
splitter
This example shows how to use QSplitter to give the user control
over how much vertical or horizontal space is given to child
widgets.
sql/blob
Shows how to connect to a database and how to write to and read
BLOB fields (for those databases that support BLOBs).
sql/overview [to be withdrawn]
This is just a series of tiny examples used by the SQL module
overview (sql.html).
sql/sqltable
A very simple example that shows how to relate a database table to
a TQDataTable.
tabdialog
This example shows how to use a dialog with multiple tabs (pages).
It shows the use of TQTabDialog and TQFileInfo.
table/bigtable
This shows how to create a sparse very large (1M x 1M cells)
TQTable by avoiding the use of table items.
table/small-table-demo
A small, simple TQTable example that uses TQTableItems to show text
and pixmaps, and TQComboTableItems and TQCheckTableItems to show how
they work.
table/statistics
A TQTable example that shows how to subclass TQTableItem.
tablet
This shows how to interact with a tablet device. It will only run
if a compatible tablet is installed.
tetrix
This is the TQt implementation of the well known game Tetris, but
with an unusual twist, not to mention a comment that's almost a
work of art.
textedit
A simple text editor based on TQTextEdit.
themes
This examples demonstrates how to draw widgets in different styles
(themes). Example themes looking like wood and metal are
implemented. You can switch between the different styles at
runtime using the menu. Shows how to create a TQStyle subclass. Not
for the faint-hearted.
tictac
This is an implementation of the Tic-Tac-Toe game.
tooltip
This example widget demonstrates how to use tool tips for static
and dynamic regions within a widget using a TQToolTip subclass.
toplevel
This program allows you to set all the flags for a widget and then
displays the widget using the flags.
trayicon [work in progress]
tux
Shows how to create a non-rectangular window.
widgets
Shows many TQt widgets (See also the demo example).
wizard
This example shows how to use TQWizard.
xform
Demonstrates how to arbitrarily rotate, shear and scale text and
graphics using TQWMatrix.
xml/outliner
Shows how to read in an XML file using Qt's DOM classes and
display the data in a list view.
xml/tagreader
Shows how to read an XML file using Qt's SAX classes.
xml/tagreader-with-features
Shows how to read an XML file using Qt's SAX classes, and displays
the data showing the effects of different feature settings.
|