source: trunk/doc/src/getting-started/examples.qdoc@ 788

Last change on this file since 788 was 769, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 44.3 KB
RevLine 
[556]1/****************************************************************************
2**
[651]3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
[556]4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the documentation of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*!
43 \page examples-overview.html
44 \raw HTML
45 <script>
46 document.location.href = "examples.html";
47 </script>
48 \endraw
49 Click this \l{Qt Examples}{link} if you don't get redirected.
50*/
51
52/*!
53 \page examples.html
54 \title Qt Examples
55 \brief The example programs provided with Qt.
56
57 \previouspage Tutorials
58 \contentspage How to Learn Qt
59 \nextpage Qt Demonstrations
60
61 Qt is supplied with a variety of examples that cover almost every aspect
62 of development. They are not all designed to be impressive when you run
63 them, but their source code is carefully written to show good Qt
64 programming practices. You can launch any of these programs from the
65 \l{Examples and Demos Launcher} application.
66
67 These examples are ordered by functional area, but many examples often
68 use features from many parts of Qt to highlight one area in particular.
69 If you are new to Qt, you should probably start by going through the
70 \l{Tutorials} before you have a look at the
71 \l{mainwindows/application}{Application} example.
72
73 In addition to the examples and the tutorial, Qt includes a
74 \l{Qt Demonstrations}{selection of demos} that deliberately show off
75 Qt's features. You might want to look at these as well.
76
[651]77 \section1 \l{Widgets Examples}{Widgets}
78 \beginfloatleft
79 \l{Widgets Examples}{\inlineimage widget-examples.png
80 }
81
82 \endfloat
[556]83 Qt comes with a large range of standard widgets that users of modern
84 applications have come to expect. You can also develop your own custom
85 widgets and controls, and use them alongside standard widgets.
86
87 It is even possible to provide custom styles and themes for widgets that can
88 be used to change the appearance of standard widgets and appropriately
89 written custom widgets.
90
[651]91 \clearfloat
92 \section1 \l{Dialog Examples}{Dialogs}
93 \beginfloatleft
94 \l{Dialog Examples}{\inlineimage dialog-examples.png
95 }
96
97 \endfloat
[556]98 Qt includes standard dialogs for many common operations, such as file
99 selection, printing, and color selection.
100
101 Custom dialogs can also be created for specialized modal or modeless
102 interactions with users.
103
[651]104 \clearfloat
105 \section1 \l{Main Window Examples}{Main Windows}
106 \beginfloatleft
107 \l{Main Window Examples}{\inlineimage mainwindow-examples.png
108 }
[556]109
[651]110 \endfloat
111 All the standard features of application main windows are provided by Qt.
[556]112
113 Main windows can have pull down menus, tool bars, and dock windows. These
114 separate forms of user input are unified in an integrated action system that
115 also supports keyboard shortcuts and accelerator keys in menu items.
116
[651]117 \clearfloat
118 \section1 \l{Layout Examples}{Layouts}
119 \beginfloatleft
120 \l{Layout Examples}{\inlineimage layout-examples.png
121 }
122
123 \endfloat
[556]124 Qt uses a layout-based approach to widget management. Widgets are arranged in
125 the optimal positions in windows based on simple layout rules, leading to a
126 consistent look and feel.
127
128 Custom layouts can be used to provide more control over the positions and
129 sizes of child widgets.
130
[651]131 \clearfloat
132 \section1 \l{Item Views Examples}{Item Views}
133 \beginfloatleft
134 \l{Item Views Examples}{\inlineimage itemview-examples.png
135 }
136
137 \endfloat
[556]138 Item views are widgets that typically display data sets. Qt 4's model/view
139 framework lets you handle large data sets by separating the underlying data
140 from the way it is represented to the user, and provides support for
141 customized rendering through the use of delegates.
142
[651]143 \clearfloat
144 \section1 \l{Graphics View Examples}{Graphics View}
145 \beginfloatleft
146 \l{Graphics View Examples}{\inlineimage graphicsview-examples.png
147 }
148
149 \endfloat
[556]150 Qt is provided with a comprehensive canvas through the GraphicsView
151 classes.
152
[651]153 \clearfloat
154 \section1 \l{Painting Examples}{Painting}
155 \beginfloatleft
156 \l{Painting Examples}{\inlineimage painting-examples.png
157 }
158
159 \endfloat
[556]160 Qt's painting system is able to render vector graphics, images, and outline
161 font-based text with sub-pixel accuracy accuracy using anti-aliasing to
162 improve rendering quality.
163
[651]164 \clearfloat
165 \section1 \l{Rich Text Examples}{Rich Text}
166 \beginfloatleft
167 \l{Rich Text Examples}{\inlineimage richtext-examples.png
168 }
169
170 \endfloat
[556]171 Qt provides powerful document-oriented rich text engine that supports Unicode
172 and right-to-left scripts. Documents can be manipulated using a cursor-based
173 API, and their contents can be imported and exported as both HTML and in a
174 custom XML format.
175
[651]176 \clearfloat
177 \section1 \l{Desktop Examples}{Desktop}
178 \beginfloatleft
179 \l{Desktop Examples}{\inlineimage desktop-examples.png
180 }
181
182 \endfloat
[556]183 Qt provides features to enable applications to integrate with the user's
184 preferred desktop environment.
185
186 Features such as system tray icons, access to the desktop widget, and
187 support for desktop services can be used to improve the appearance of
188 applications and take advantage of underlying desktop facilities.
189
[651]190 \clearfloat
191 \section1 \l{Drag and Drop Examples}{Drag and Drop}
192 \beginfloatleft
193 \l{Drag and Drop Examples}{\inlineimage draganddrop-examples.png
194 }
195
196 \endfloat
[556]197 Qt supports native drag and drop on all platforms via an extensible
198 MIME-based system that enables applications to send data to each other in the
199 most appropriate formats.
200
201 Drag and drop can also be implemented for internal use by applications.
202
[651]203 \clearfloat
204 \section1 \l{Threading and Concurrent Programming Examples}{Threading and Concurrent Programming}
205 \beginfloatleft
206 \l{Threading and Concurrent Programming Examples}{\inlineimage thread-examples.png
207 }
208
209 \endfloat
[556]210 Qt 4 makes it easier than ever to write multithreaded applications. More
211 classes have been made usable from non-GUI threads, and the signals and slots
212 mechanism can now be used to communicate between threads.
213
214 The QtConcurrent namespace includes a collection of classes and functions
215 for straightforward concurrent programming.
216
[651]217 \clearfloat
218 \section1 \l{Tools Examples}{Tools}
219 \beginfloatleft
220 \l{Tools Examples}{\inlineimage tool-examples.png
221 }
222
223 \endfloat
[556]224 Qt is equipped with a range of capable tool classes, from containers and
225 iterators to classes for string handling and manipulation.
226
227 Other classes provide application infrastructure support, handling plugin
228 loading and managing configuration files.
229
[651]230 \clearfloat
231 \section1 \l{Network Examples}{Network}
232 \beginfloatleft
233 \l{Network Examples}{\inlineimage network-examples.png
234 }
235
236 \endfloat
[556]237 Qt is provided with an extensive set of network classes to support both
238 client-based and server side network programming.
239
[651]240 \clearfloat
241 \section1 \l{Inter-Process Communication Examples}{Inter-Process Communication}
242 \beginfloatleft
243 \l{Inter-Process Communication Examples}{\inlineimage ipc-examples.png
244 }
[556]245
[651]246 \endfloat
247 Simple, lightweight inter-process communication can be performed using shared
248 memory and local sockets.
249
250 \clearfloat
251 \section1 \l{OpenGL Examples}{OpenGL} and \l{OpenVG Examples}{OpenVG} Examples
252 \beginfloatleft
253 \l{OpenGL Examples}{\inlineimage opengl-examples.png
254 }
255
256 \endfloat
[556]257 Qt provides support for integration with OpenGL implementations on all
258 platforms, giving developers the opportunity to display hardware accelerated
259 3D graphics alongside a more conventional user interface.
260
261 Qt provides support for integration with OpenVG implementations on
262 platforms with suitable drivers.
263
[651]264 \clearfloat
265 \section1 \l{Multimedia Examples}{Multimedia Framework}
266 \beginfloatleft
267 \l{Multimedia Examples}{\inlineimage phonon-examples.png
268 }
269
270 \endfloat
[556]271 Qt provides low-level audio support on linux,windows and mac platforms by default and
272 an audio plugin API to allow developers to implement there own audio support for
273 custom devices and platforms.
274
275 The Phonon Multimedia Framework brings multimedia support to Qt applications.
276
[651]277 \clearfloat
278 \section1 \l{SQL Examples}{SQL}
279 \beginfloatleft
280 \l{SQL Examples}{\inlineimage sql-examples.png
281 }
282
283 \endfloat
[556]284 Qt provides extensive database interoperability, with support for products
285 from both open source and proprietary vendors.
286
287 SQL support is integrated with Qt's model/view architecture, making it easier
288 to provide GUI integration for your database applications.
289
[651]290 \clearfloat
291 \section1 \l{XML Examples}{XML}
292 \beginfloatleft
293 \l{XML Examples}{\inlineimage xml-examples.png
294 }
295
296 \endfloat
[556]297 XML parsing and handling is supported through SAX and DOM compliant APIs
298 as well as streaming classes.
299
300 The XQuery/XPath and XML Schema engines in the QtXmlPatterns modules
301 provide classes for querying XML files and custom data models.
302
[651]303 \clearfloat
304 \section1 \l{Qt Designer Examples}{Qt Designer}
305 \beginfloatleft
306 \l{Qt Designer Examples}{\inlineimage designer-examples.png
307 }
308
309 \endfloat
[556]310 Qt Designer is a capable graphical user interface designer that lets you
311 create and configure forms without writing code. GUIs created with
312 Qt Designer can be compiled into an application or created at run-time.
313
[651]314 \clearfloat
315 \section1 \l{UiTools Examples}{UiTools}
316 \beginfloatleft
317 \l{UiTools Examples}{\inlineimage uitools-examples.png
318 }
[556]319
[651]320 \endfloat
321 User interfaces created with Qt Designer can be loaded and displayed at
322 run-time using the facilities of the QtUiTools module without the need
323 to generate code in advance.
324
325 \clearfloat
326 \section1 \l{Qt Linguist Examples}{Qt Linguist}
327 \beginfloatleft
328 \l{Qt Linguist Examples}{\inlineimage linguist-examples.png
329 }
330
331 \endfloat
[556]332 Internationalization is a core feature of Qt.
333
[651]334 \clearfloat
335 \section1 \l{Qt Script Examples}{Qt Script}
336 \beginfloatleft
337 \l{Qt Script Examples}{\inlineimage qtscript-examples.png
338 }
339
340 \endfloat
[556]341 Qt is provided with a powerful embedded scripting environment through the QtScript
342 classes.
343
[651]344 \clearfloat
345 \section1 \l{WebKit Examples}{WebKit}
346 \beginfloatleft
347 \l{WebKit Examples}{\inlineimage webkit-examples.png
348 }
349
350 \endfloat
[556]351 Qt provides an integrated Web browser component based on WebKit, the popular
352 open source browser engine.
353
[651]354 \clearfloat
355 \section1 \l{Help System Examples}{Help System}
356 \beginfloatleft
357 \l{Help System Examples}{\inlineimage assistant-examples.png
358 }
359
360 \endfloat
[556]361 Support for interactive help is provided by the Qt Assistant application.
362 Developers can take advantages of the facilities it offers to display
363 specially-prepared documentation to users of their applications.
364
[651]365 \clearfloat
366 \section1 \l{State Machine Examples}{State Machine}
367 \beginfloatleft
368 \l{State Machine Examples}{\inlineimage statemachine-examples.png
369 }
370
371 \endfloat
[556]372 Qt provides a powerful hierarchical finite state machine through the Qt State
373 Machine classes.
374
[651]375 \clearfloat
376 \section1 \l{Animation Framework Examples}{Animation Framework}
377 \beginfloatleft
378 \l{Animation Framework Examples}{\inlineimage animation-examples.png
379 }
380
381 \endfloat
[556]382 These examples show to to use the \l{The Animation Framework}{animation framework}
383 to build highly animated, high-performance GUIs.
384
[651]385 \clearfloat
386 \section1 \l{Multi-Touch Examples}{Multi-Touch Framework}
387 \beginfloatleft
388 \l{Multi-Touch Examples}{\inlineimage multitouch-examples.png
389 }
[556]390
[651]391 \endfloat
[556]392 Support for multi-touch input makes it possible for developers to create
393 extensible and intuitive user interfaces.
394
[651]395 \clearfloat
396 \section1 \l{Gestures Examples}{Gestures}
397 \beginfloatleft
398 \l{Gestures Examples}{\inlineimage gestures-examples.png
399 }
400
401 \endfloat
[556]402 Applications can be written to respond to gestures as a natural input method.
403 These examples show how to enable support for standard and custom gestures in
404 applications.
405
[651]406 \clearfloat
407 \section1 \l{D-Bus Examples}{D-Bus}
408 \beginfloatleft
[769]409 \l{D-Bus Examples}{\inlineimage dbus-examples.png
[651]410 }
[556]411
[651]412 \endfloat
[556]413 Systems with limited resources, specialized hardware, and small
414 screens require special attention.
415
[651]416 \clearfloat
417 \section1 \l{Qt for Embedded Linux Examples}{Qt for Embedded Linux}
418 \beginfloatleft
[769]419 \l{Qt for Embedded Linux Examples}{\inlineimage qt-embedded-examples.png
[651]420 }
421
422 \endfloat
[556]423 D-Bus is an inter-process communication protocol for Unix/Linux systems.
424 These examples demonstrate how to write application that communicate with
425 each other.
426
[651]427 \clearfloat
428 \section1 \l{ActiveQt Examples}{ActiveQt}
429 \beginfloatleft
430 \l{ActiveQt Examples}{\inlineimage activeqt-examples.png
431 }
[556]432
[651]433 \endfloat
[556]434 These examples demonstrate how to write ActiveX controls and control servers
435 with Qt, and how to use ActiveX controls and COM objects in a Qt application.
436
[651]437 \clearfloat
438 \section1 \l{Qt Quarterly}{Qt Quarterly}
439 \beginfloatleft
440 \l{Qt Quarterly}{\inlineimage qq-thumbnail.png
441 }
442
443 \endfloat
[556]444 One more valuable source for examples and explanations of Qt
[651]445 features is the archive of \l{Qt Quarterly}, a newsletter for
446 Qt developers.
[556]447
[651]448 \clearfloat
[556]449*/
450
451/*!
452 \page examples-widgets.html
453 \title Widgets Examples
454
455 \contentspage Qt Examples
456 \nextpage Dialog Examples
457
458 \image widget-examples.png
459
460 Qt comes with a large range of standard widgets that users of modern
461 applications have come to expect.
462
463 You can also develop your own custom widgets and controls, and use them
464 alongside standard widgets.
465
466 It is even possible to provide custom styles and themes for widgets that can
467 be used to change the appearance of standard widgets and appropriately
468 written custom widgets.
469
470 \list
471 \o \l{widgets/analogclock}{Analog Clock}\raisedaster
472 \o \l{widgets/calculator}{Calculator}\raisedaster
473 \o \l{widgets/calendarwidget}{Calendar Widget}\raisedaster
474 \o \l{widgets/charactermap}{Character Map}\raisedaster
475 \o \l{widgets/codeeditor}{Code Editor}\raisedaster
476 \o \l{widgets/digitalclock}{Digital Clock}\raisedaster
477 \o \l{widgets/groupbox}{Group Box}\raisedaster
478 \o \l{widgets/icons}{Icons}\raisedaster
479 \o \l{widgets/imageviewer}{Image Viewer}\raisedaster
480 \o \l{widgets/lineedits}{Line Edits}\raisedaster
481 \o \l{widgets/movie}{Movie}
482 \o \l{widgets/scribble}{Scribble}\raisedaster
483 \o \l{widgets/shapedclock}{Shaped Clock}\raisedaster
484 \o \l{widgets/sliders}{Sliders}\raisedaster
[651]485 \o \l{widgets/softkeys}{Soft Keys}
[556]486 \o \l{widgets/spinboxes}{Spin Boxes}\raisedaster
487 \o \l{widgets/styles}{Styles}\raisedaster
488 \o \l{widgets/stylesheet}{Style Sheet}\raisedaster
489 \o \l{widgets/tablet}{Tablet}\raisedaster
490 \o \l{widgets/tetrix}{Tetrix}\raisedaster
491 \o \l{widgets/tooltips}{Tooltips}\raisedaster
[651]492 \o \l{widgets/validators}{Validators}
[556]493 \o \l{widgets/wiggly}{Wiggly}\raisedaster
494 \o \l{widgets/windowflags}{Window Flags}\raisedaster
495 \endlist
496
497 Examples marked with an asterisk (*) are fully documented.
498*/
499
500/*!
501 \page examples-dialogs.html
502 \title Dialog Examples
503
504 \previouspage Widgets Examples
505 \contentspage Qt Examples
506 \nextpage Main Window Examples
507
508 \image dialog-examples.png
509
510 Qt includes standard dialogs for many common operations, such as file
511 selection, printing, and color selection.
512
513 Custom dialogs can also be created for specialized modal or modeless
514 interactions with users.
515
516 \list
517 \o \l{dialogs/classwizard}{Class Wizard}\raisedaster
518 \o \l{dialogs/configdialog}{Config Dialog}
519 \o \l{dialogs/extension}{Extension}\raisedaster
520 \o \l{dialogs/findfiles}{Find Files}\raisedaster
521 \o \l{dialogs/licensewizard}{License Wizard}\raisedaster
522 \o \l{dialogs/standarddialogs}{Standard Dialogs}
523 \o \l{dialogs/tabdialog}{Tab Dialog}\raisedaster
524 \o \l{dialogs/trivialwizard}{Trivial Wizard}
525 \endlist
526
527 Examples marked with an asterisk (*) are fully documented.
528*/
529
530/*!
531 \page examples-mainwindow.html
532 \title Main Window Examples
533
534 \previouspage Dialog Examples
535 \contentspage Qt Examples
536 \nextpage Layout Examples
537
538 \image mainwindow-examples.png
539
540 All the standard features of application main windows are provided by Qt.
541
542 Main windows can have pull down menus, tool bars, and dock windows. These
543 separate forms of user input are unified in an integrated action system that
544 also supports keyboard shortcuts and accelerator keys in menu items.
545
546 \list
547 \o \l{mainwindows/application}{Application}\raisedaster
548 \o \l{mainwindows/dockwidgets}{Dock Widgets}\raisedaster
549 \o \l{mainwindows/mdi}{MDI}
550 \o \l{mainwindows/menus}{Menus}\raisedaster
551 \o \l{mainwindows/recentfiles}{Recent Files}
552 \o \l{mainwindows/sdi}{SDI}
553 \endlist
554
555 Examples marked with an asterisk (*) are fully documented.
556*/
557
558/*!
559 \page examples-layouts.html