| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the documentation of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** 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 are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at qt-sales@nokia.com.
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | /*!
|
|---|
| 43 | \page examples-overview.html
|
|---|
| 44 | \title An Overview of Qt's Examples
|
|---|
| 45 | \brief A short guide to the different categories of examples included with Qt.
|
|---|
| 46 | \ingroup howto
|
|---|
| 47 |
|
|---|
| 48 | Qt is supplied with a variety of examples that cover almost every aspect
|
|---|
| 49 | of development. These examples are ordered by functional area, but many
|
|---|
| 50 | examples often use features from many parts of Qt to highlight one area
|
|---|
| 51 | in particular.
|
|---|
| 52 |
|
|---|
| 53 | This document provides a brief overview of each example category and
|
|---|
| 54 | provides links to the more formal \l{Qt Examples}{list of examples}.
|
|---|
| 55 |
|
|---|
| 56 | \section1 \l{Qt Examples#Widgets}{Widgets}
|
|---|
| 57 |
|
|---|
| 58 | \l{Qt Examples#Widgets}{\inlineimage widget-examples.png
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | Qt comes with a large range of standard widgets that users of modern
|
|---|
| 62 | applications have come to expect.
|
|---|
| 63 |
|
|---|
| 64 | You can also develop your own custom widgets and controls, and use them
|
|---|
| 65 | alongside standard widgets.
|
|---|
| 66 |
|
|---|
| 67 | It is even possible to provide custom styles and themes for widgets that can
|
|---|
| 68 | be used to change the appearance of standard widgets and appropriately
|
|---|
| 69 | written custom widgets.
|
|---|
| 70 |
|
|---|
| 71 | \section1 \l{Qt Examples#Dialogs}{Dialogs}
|
|---|
| 72 |
|
|---|
| 73 | \l{Qt Examples#Dialogs}{\inlineimage dialog-examples.png
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | Qt includes standard dialogs for many common operations, such as file
|
|---|
| 77 | selection, printing, and color selection.
|
|---|
| 78 |
|
|---|
| 79 | Custom dialogs can also be created for specialized modal or modeless
|
|---|
| 80 | interactions with users.
|
|---|
| 81 |
|
|---|
| 82 | \section1 \l{Qt Examples#Main Windows}{Main Windows}
|
|---|
| 83 |
|
|---|
| 84 | \l{Qt Examples#Main Windows}{\inlineimage mainwindow-examples.png
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | All the standard features of application main windows are provided by Qt.
|
|---|
| 88 |
|
|---|
| 89 | Main windows can have pull down menus, tool bars, and dock windows. These
|
|---|
| 90 | separate forms of user input are unified in an integrated action system that
|
|---|
| 91 | also supports keyboard shortcuts and accelerator keys in menu items.
|
|---|
| 92 |
|
|---|
| 93 | \section1 \l{Qt Examples#Layouts}{Layouts}
|
|---|
| 94 |
|
|---|
| 95 | \l{Qt Examples#Layouts}{\inlineimage layout-examples.png
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | Qt uses a layout-based approach to widget management. Widgets are arranged in
|
|---|
| 99 | the optimal positions in windows based on simple layout rules, leading to a
|
|---|
| 100 | consistent look and feel.
|
|---|
| 101 |
|
|---|
| 102 | Custom layouts can be used to provide more control over the positions and
|
|---|
| 103 | sizes of child widgets.
|
|---|
| 104 |
|
|---|
| 105 | \section1 \l{Qt Examples#Painting}{Painting}
|
|---|
| 106 |
|
|---|
| 107 | \l{Qt Examples#Painting}{\inlineimage painting-examples.png
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | Qt's painting system is able to render vector graphics, images, and outline
|
|---|
| 111 | font-based text with sub-pixel accuracy accuracy using anti-aliasing to
|
|---|
| 112 | improve rendering quality.
|
|---|
| 113 |
|
|---|
| 114 | These examples show the most common techniques that are used when painting
|
|---|
| 115 | with Qt, from basic concepts such as drawing simple primitives to the use of
|
|---|
| 116 | transformations.
|
|---|
| 117 |
|
|---|
| 118 | \section1 \l{Qt Examples#Item Views}{Item Views}
|
|---|
| 119 |
|
|---|
| 120 | \l{Qt Examples#Item Views}{\inlineimage itemview-examples.png
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | Item views are widgets that typically display data sets. Qt 4's model/view
|
|---|
| 124 | framework lets you handle large data sets by separating the underlying data
|
|---|
| 125 | from the way it is represented to the user, and provides support for
|
|---|
| 126 | customized rendering through the use of delegates.
|
|---|
| 127 |
|
|---|
| 128 | \section1 \l{Qt Examples#Graphics View}{Graphics View}
|
|---|
| 129 |
|
|---|
| 130 | \l{Qt Examples#Graphics View}{\inlineimage graphicsview-examples.png
|
|---|
| 131 | }
|
|---|
| 132 |
|
|---|
| 133 | Qt is provided with a comprehensive canvas through the GraphicsView
|
|---|
| 134 | classes.
|
|---|
| 135 |
|
|---|
| 136 | These examples demonstrate the fundamental aspects of canvas programming
|
|---|
| 137 | with Qt.
|
|---|
| 138 |
|
|---|
| 139 | \section1 \l{Qt Examples#Rich Text}{Rich Text}
|
|---|
| 140 |
|
|---|
| 141 | \l{Qt Examples#Rich Text}{\inlineimage richtext-examples.png
|
|---|
| 142 | }
|
|---|
| 143 |
|
|---|
| 144 | Qt provides powerful document-oriented rich text engine that supports Unicode
|
|---|
| 145 | and right-to-left scripts. Documents can be manipulated using a cursor-based
|
|---|
| 146 | API, and their contents can be imported and exported as both HTML and in a
|
|---|
| 147 | custom XML format.
|
|---|
| 148 |
|
|---|
| 149 | \section1 \l{Qt Examples#Tools}{Tools}
|
|---|
| 150 |
|
|---|
| 151 | \l{Qt Examples#Tools}{\inlineimage tool-examples.png
|
|---|
| 152 | }
|
|---|
| 153 |
|
|---|
| 154 | Qt is equipped with a range of capable tool classes, from containers and
|
|---|
| 155 | iterators to classes for string handling and manipulation.
|
|---|
| 156 |
|
|---|
| 157 | Other classes provide application infrastructure support, handling plugin
|
|---|
| 158 | loading and managing configuration files.
|
|---|
| 159 |
|
|---|
| 160 | \section1 \l{Qt Examples#Desktop}{Desktop}
|
|---|
| 161 |
|
|---|
| 162 | \l{Qt Examples#Desktop}{\inlineimage desktop-examples.png
|
|---|
| 163 | }
|
|---|
| 164 |
|
|---|
| 165 | Qt provides features to enable applications to integrate with the user's
|
|---|
| 166 | preferred desktop environment.
|
|---|
| 167 |
|
|---|
| 168 | Features such as system tray icons, access to the desktop widget, and
|
|---|
| 169 | support for desktop services can be used to improve the appearance of
|
|---|
| 170 | applications and take advantage of underlying desktop facilities.
|
|---|
| 171 |
|
|---|
| 172 | \section1 \l{Qt Examples#Drag and Drop}{Drag and Drop}
|
|---|
| 173 |
|
|---|
| 174 | \l{Qt Examples#Drag and Drop}{\inlineimage draganddrop-examples.png
|
|---|
| 175 | }
|
|---|
| 176 |
|
|---|
| 177 | Qt supports native drag and drop on all platforms via an extensible
|
|---|
| 178 | MIME-based system that enables applications to send data to each other in the
|
|---|
| 179 | most appropriate formats.
|
|---|
| 180 |
|
|---|
| 181 | Drag and drop can also be implemented for internal use by applications.
|
|---|
| 182 |
|
|---|
| 183 | \section1 \l{Qt Examples#Threads}{Threads}
|
|---|
| 184 |
|
|---|
| 185 | \l{Qt Examples#Threads}{\inlineimage thread-examples.png
|
|---|
| 186 | }
|
|---|
| 187 |
|
|---|
| 188 | Qt 4 makes it easier than ever to write multithreaded applications. More
|
|---|
| 189 | classes have been made usable from non-GUI threads, and the signals and slots
|
|---|
| 190 | mechanism can now be used to communicate between threads.
|
|---|
| 191 |
|
|---|
| 192 | Additionally, it is now possible to move objects between threads.
|
|---|
| 193 |
|
|---|
| 194 | \section1 \l{Qt Examples#Concurrent Programming}{Concurrent Programming}
|
|---|
| 195 |
|
|---|
| 196 | The QtConcurrent namespace includes a collection of classes and functions
|
|---|
| 197 | for straightforward concurrent programming.
|
|---|
| 198 |
|
|---|
| 199 | These examples show how to apply the basic techniques of concurrent
|
|---|
| 200 | programming to simple problems.
|
|---|
| 201 |
|
|---|
| 202 | \section1 \l{Qt Examples#Network}{Network}
|
|---|
| 203 |
|
|---|
| 204 | \l{Qt Examples#Network}{\inlineimage network-examples.png
|
|---|
| 205 | }
|
|---|
| 206 |
|
|---|
| 207 | Qt is provided with an extensive set of network classes to support both
|
|---|
| 208 | client-based and server side network programming.
|
|---|
| 209 |
|
|---|
| 210 | These examples demonstrate the fundamental aspects of network programming
|
|---|
| 211 | with Qt.
|
|---|
| 212 |
|
|---|
| 213 | \section1 \l{Qt Examples#XML}{XML}
|
|---|
| 214 |
|
|---|
| 215 | \l{Qt Examples#XML}{\inlineimage xml-examples.png
|
|---|
| 216 | }
|
|---|
| 217 |
|
|---|
| 218 | XML parsing and handling is supported through SAX and DOM compliant APIs.
|
|---|
| 219 |
|
|---|
| 220 | Qt's SAX compliant classes allow you to parse XML incrementally; the DOM
|
|---|
| 221 | classes enable more complex document-level operations to be performed on
|
|---|
| 222 | XML files.
|
|---|
| 223 |
|
|---|
| 224 | \section1 \l{Qt Examples#XQuery, XPath}{XQuery, XPath}
|
|---|
| 225 |
|
|---|
| 226 | Qt provides an XQuery/XPath engine, QtXmlPatterns, for querying XML
|
|---|
| 227 | files and custom data models, similar to the model/view framework.
|
|---|
| 228 |
|
|---|
| 229 | \section1 \l{Qt Examples#OpenGL}{OpenGL}
|
|---|
| 230 |
|
|---|
| 231 | \l{Qt Examples#OpenGL}{\inlineimage opengl-examples.png
|
|---|
| 232 | }
|
|---|
| 233 |
|
|---|
| 234 | Qt provides support for integration with OpenGL implementations on all
|
|---|
| 235 | platforms, giving developers the opportunity to display hardware accelerated
|
|---|
| 236 | 3D graphics alongside a more conventional user interface.
|
|---|
| 237 |
|
|---|
| 238 | These examples demonstrate the basic techniques used to take advantage of
|
|---|
| 239 | OpenGL in Qt applications.
|
|---|
| 240 |
|
|---|
| 241 | \section1 \l{Qt Examples#SQL}{SQL}
|
|---|
| 242 |
|
|---|
| 243 | \l{Qt Examples#SQL}{\inlineimage sql-examples.png
|
|---|
| 244 | }
|
|---|
| 245 |
|
|---|
| 246 | Qt provides extensive database interoperability, with support for products
|
|---|
| 247 | from both open source and proprietary vendors.
|
|---|
| 248 |
|
|---|
| 249 | SQL support is integrated with Qt's model/view architecture, making it easier
|
|---|
| 250 | to provide GUI integration for your database applications.
|
|---|
| 251 |
|
|---|
| 252 | \section1 \l{Qt Examples#Help System}{Help System}
|
|---|
| 253 |
|
|---|
| 254 | \l{Qt Examples#Help System}{\inlineimage assistant-examples.png
|
|---|
| 255 | }
|
|---|
| 256 |
|
|---|
| 257 | Support for interactive help is provided by the Qt Assistant application.
|
|---|
| 258 | Developers can take advantages of the facilities it offers to display
|
|---|
| 259 | specially-prepared documentation to users of their applications.
|
|---|
| 260 |
|
|---|
| 261 | \section1 \l{Qt Examples#Qt Designer}{Qt Designer}
|
|---|
| 262 |
|
|---|
| 263 | \l{Qt Examples#Qt Designer}{\inlineimage designer-examples.png
|
|---|
| 264 | }
|
|---|
| 265 |
|
|---|
| 266 | Qt Designer is a capable graphical user interface designer that lets you
|
|---|
| 267 | create and configure forms without writing code. GUIs created with
|
|---|
| 268 | Qt Designer can be compiled into an application or created at run-time.
|
|---|
| 269 |
|
|---|
| 270 | \section1 \l{Qt Examples#UiTools}{UiTools}
|
|---|
| 271 |
|
|---|
| 272 | \l{Qt Examples#UiTools}{\inlineimage uitools-examples.png
|
|---|
| 273 | }
|
|---|
| 274 |
|
|---|
| 275 | Qt is equipped with a range of capable tool classes, from containers and
|
|---|
| 276 | iterators to classes for string handling and manipulation.
|
|---|
| 277 |
|
|---|
| 278 | Other classes provide application infrastructure support, handling plugin
|
|---|
| 279 | loading and managing configuration files.
|
|---|
| 280 |
|
|---|
| 281 | \section1 \l{Qt Examples#Qt Linguist}{Qt Linguist}
|
|---|
| 282 |
|
|---|
| 283 | \l{Qt Examples#Qt Linguist}{\inlineimage linguist-examples.png
|
|---|
| 284 | }
|
|---|
| 285 |
|
|---|
| 286 | Internationalization is a core feature of Qt. These examples show how to
|
|---|
| 287 | access translation and localization facilities at run-time.
|
|---|
| 288 |
|
|---|
| 289 | \section1 \l{Qt Examples#Qt Script}{Qt Script}
|
|---|
| 290 |
|
|---|
| 291 | \l{Qt Examples#Qt Script}{\inlineimage qtscript-examples.png
|
|---|
| 292 | }
|
|---|
| 293 |
|
|---|
| 294 | Qt is provided with a powerful embedded scripting environment through the QtScript
|
|---|
| 295 | classes.
|
|---|
| 296 |
|
|---|
| 297 | These examples demonstrate the fundamental aspects of scripting applications
|
|---|
| 298 | with Qt.
|
|---|
| 299 |
|
|---|
| 300 | \section1 \l{Qt Examples#Phonon Multimedia Framework}{Phonon Multimedia Framework}
|
|---|
| 301 |
|
|---|
| 302 | \l{Qt Examples#Phonon Multimedia Framework}{\inlineimage phonon-examples.png
|
|---|
| 303 | }
|
|---|
| 304 |
|
|---|
| 305 | The Phonon Multimedia Framework brings multimedia support to Qt applications.
|
|---|
| 306 |
|
|---|
| 307 | The examples and demonstrations provided show how to play music and movies
|
|---|
| 308 | using the Phonon API.
|
|---|
| 309 |
|
|---|
| 310 | \section1 \l{Qt Examples#WebKit}{WebKit}
|
|---|
| 311 |
|
|---|
| 312 | \l{Qt Examples#WebKit}{\inlineimage webkit-examples.png
|
|---|
| 313 | }
|
|---|
| 314 |
|
|---|
| 315 | Qt provides an integrated Web browser component based on WebKit, the popular
|
|---|
| 316 | open source browser engine.
|
|---|
| 317 |
|
|---|
| 318 | These examples and demonstrations show a range of different uses for WebKit,
|
|---|
| 319 | from displaying Web pages within a Qt user interface to an implementation of
|
|---|
| 320 | a basic function Web browser.
|
|---|
| 321 |
|
|---|
| 322 | \section1 \l{Qt Examples#Qt for Embedded Linux}{Qt for Embedded Linux}
|
|---|
| 323 |
|
|---|
| 324 | \l{Qt Examples#Qt for Embedded Linux}{\inlineimage qt-embedded-examples.png
|
|---|
| 325 | }
|
|---|
| 326 |
|
|---|
| 327 | These examples show how to take advantage of features specifically designed
|
|---|
| 328 | for use on systems with limited resources, specialized hardware, and small
|
|---|
| 329 | screens.
|
|---|
| 330 |
|
|---|
| 331 | \section1 \l{Qt Examples#ActiveQt}{ActiveQt}
|
|---|
| 332 |
|
|---|
| 333 | Qt is supplied with a number of example applications and demonstrations that
|
|---|
| 334 | have been written to provide developers with examples of the Qt API in use,
|
|---|
| 335 | highlight good programming practice, and showcase features found in each of
|
|---|
| 336 | Qt's core technologies.
|
|---|
| 337 |
|
|---|
| 338 | The example and demo launcher can be used to explore the different categories
|
|---|
| 339 | available. It provides an overview of each example, lets you view the
|
|---|
| 340 | documentation in Qt Assistant, and is able to launch examples and demos.
|
|---|
| 341 |
|
|---|
| 342 | \section1 \l{http://doc.trolltech.com/qq}{Another Source of Examples}
|
|---|
| 343 |
|
|---|
| 344 | One more valuable source for examples and explanations of Qt
|
|---|
| 345 | features is the archive of the \l {http://doc.trolltech.com/qq}
|
|---|
| 346 | {Qt Quarterly}.
|
|---|
| 347 |
|
|---|
| 348 | */
|
|---|