diff options
Diffstat (limited to 'doc/src/examples')
265 files changed, 2233 insertions, 371 deletions
diff --git a/doc/src/examples/2dpainting.qdoc b/doc/src/examples/2dpainting.qdoc index c4a2695..bce9958 100644 --- a/doc/src/examples/2dpainting.qdoc +++ b/doc/src/examples/2dpainting.qdoc @@ -29,7 +29,7 @@ \example opengl/2dpainting \title 2D Painting Example - The 2D Painting example shows how QPainter and QGLWidget can be used + \brief The 2D Painting example shows how QPainter and QGLWidget can be used together to display accelerated 2D graphics on supported hardware. \image 2dpainting-example.png diff --git a/doc/src/examples/activeqt/comapp.qdoc b/doc/src/examples/activeqt/comapp.qdoc index 22cec65..3c74b60 100644 --- a/doc/src/examples/activeqt/comapp.qdoc +++ b/doc/src/examples/activeqt/comapp.qdoc @@ -29,10 +29,12 @@ \example activeqt/comapp \title COM App Example (ActiveQt) - The COM App example shows how to use ActiveQt to develop a Qt - application that can be automated via COM. Different QObject - based classes are exposed as COM objects that communicate with the - GUI of the running Qt application. The APIs of those COM objects + \brief The COM App example shows how to use ActiveQt to develop a Qt + application that can be automated via COM. + + Different QObject based classes are exposed as COM objects that + communicate with the GUI of the running Qt application. + The APIs of those COM objects has been designed to resemble the APIs of standard COM applications; i.e. those from Microsoft Office. diff --git a/doc/src/examples/activeqt/dotnet.qdoc b/doc/src/examples/activeqt/dotnet.qdoc index af62b8d..31ca490 100644 --- a/doc/src/examples/activeqt/dotnet.qdoc +++ b/doc/src/examples/activeqt/dotnet.qdoc @@ -29,7 +29,7 @@ \page activeqt-dotnet.html \title Dot Net Example (ActiveQt) - The Dot Net example demonstrates how Qt objects can be used in a + \brief The Dot Net example demonstrates how Qt objects can be used in a .NET environment, and how .NET objects can be used in a Qt environment. @@ -314,7 +314,7 @@ \l{http://qt.nokia.com/products/qsa/}{QSA}, the cross platform scripting solution for Qt applications, and to COM clients in general. - When using the "IJW" method, in priciple the only limitation is the + When using the "IJW" method, in principle the only limitation is the time required to write the wrapper classes and data type conversion functions. diff --git a/doc/src/examples/activeqt/hierarchy.qdoc b/doc/src/examples/activeqt/hierarchy.qdoc index 50fb025..e4fa60f 100644 --- a/doc/src/examples/activeqt/hierarchy.qdoc +++ b/doc/src/examples/activeqt/hierarchy.qdoc @@ -36,7 +36,7 @@ \example activeqt/hierarchy \title Hierarchy Example (ActiveQt) - The Hierarchy example is shows how to write an in-process ActiveX + \brief The Hierarchy example is shows how to write an in-process ActiveX control. The control is a QWidget subclass with child widgets that are accessible as sub-types. diff --git a/doc/src/examples/activeqt/multiple.qdoc b/doc/src/examples/activeqt/multiple.qdoc index 96bb6f5..fb069a9 100644 --- a/doc/src/examples/activeqt/multiple.qdoc +++ b/doc/src/examples/activeqt/multiple.qdoc @@ -36,9 +36,10 @@ \example activeqt/multiple \title Multiple Example (ActiveQt) - The Multiple example demonstrates the implementation of a + \brief The Multiple example demonstrates the implementation of a QAxFactory to provide multiple ActiveX controls in a single in process ActiveX server using the \c QAXFACTORY_EXPORT() macro. + The ActiveX controls in this example are simple QWidget subclasses that reimplement QWidget::paintEvent(). diff --git a/doc/src/examples/activeqt/qutlook.qdoc b/doc/src/examples/activeqt/qutlook.qdoc index fe77fd5..82e3424 100644 --- a/doc/src/examples/activeqt/qutlook.qdoc +++ b/doc/src/examples/activeqt/qutlook.qdoc @@ -29,7 +29,7 @@ \example activeqt/qutlook \title Qutlook Example (ActiveQt) - The Qutlook example demonstrates the use of ActiveQt to automate + \brief The Qutlook example demonstrates the use of ActiveQt to automate Outlook. The example makes use of the \l dumpcpp tool to generate a C++ namespace for the type library describing the Outlook Object Model. diff --git a/doc/src/examples/activeqt/webbrowser.qdoc b/doc/src/examples/activeqt/webbrowser.qdoc index 7eca270..35e4524 100644 --- a/doc/src/examples/activeqt/webbrowser.qdoc +++ b/doc/src/examples/activeqt/webbrowser.qdoc @@ -29,7 +29,7 @@ \example activeqt/webbrowser \title Web Browser Example (ActiveQt) - The Web Browser example uses the Microsoft Web Browser + \brief The Web Browser example uses the Microsoft Web Browser ActiveX control to implement a fully functional Web Browser application. The user interface has been developed using the Qt Designer integration of the QAxWidget class. diff --git a/doc/src/examples/activeqt/wrapper.qdoc b/doc/src/examples/activeqt/wrapper.qdoc index caecae9..8c7755e 100644 --- a/doc/src/examples/activeqt/wrapper.qdoc +++ b/doc/src/examples/activeqt/wrapper.qdoc @@ -37,9 +37,11 @@ \example activeqt/wrapper \title Wrapper Example (ActiveQt) - The Wrapper example demonstrates how to export existing QWidget + \brief The Wrapper example demonstrates how to export existing QWidget classes as ActiveX controls, and the use of QAxFactory together - with the \c QAXFACTORY_EXPORT() macro. ActiveX controls in this + with the \c QAXFACTORY_EXPORT() macro. + + ActiveX controls in this example are the standard button classes QPushButton, QCheckBox and QRadioButton as provided by Qt. diff --git a/doc/src/examples/addressbook.qdoc b/doc/src/examples/addressbook.qdoc index 114c22b..f19582d 100644 --- a/doc/src/examples/addressbook.qdoc +++ b/doc/src/examples/addressbook.qdoc @@ -29,7 +29,7 @@ \example itemviews/addressbook \title Address Book Example - The address book example shows how to use proxy models to display + \brief The address book example shows how to use proxy models to display different views onto data from a single model. \image addressbook-example.png Screenshot of the Address Book example diff --git a/doc/src/examples/analogclock.qdoc b/doc/src/examples/analogclock.qdoc index 18dc479..3b12ebe 100644 --- a/doc/src/examples/analogclock.qdoc +++ b/doc/src/examples/analogclock.qdoc @@ -29,7 +29,7 @@ \example widgets/analogclock \title Analog Clock Example - The Analog Clock example shows how to draw the contents of a custom + \brief The Analog Clock example shows how to draw the contents of a custom widget. \image analogclock-example.png Screenshot of the Analog Clock example diff --git a/doc/src/examples/animatedtiles.qdoc b/doc/src/examples/animatedtiles.qdoc index f562829..8155c4a 100644 --- a/doc/src/examples/animatedtiles.qdoc +++ b/doc/src/examples/animatedtiles.qdoc @@ -29,7 +29,7 @@ \example animation/animatedtiles \title Animated Tiles Example - The Animated Tiles example animates items in a graphics scene. + \brief The Animated Tiles example animates items in a graphics scene. \image animatedtiles-example.png */ diff --git a/doc/src/examples/appchooser.qdoc b/doc/src/examples/appchooser.qdoc index 63cbb0e..64c5144 100644 --- a/doc/src/examples/appchooser.qdoc +++ b/doc/src/examples/appchooser.qdoc @@ -29,7 +29,7 @@ \example animation/appchooser \title Application Chooser Example - The Application Chooser example shows how to use the Qt state + \brief The Application Chooser example shows how to use the Qt state machine and the animation framework to select between applications. diff --git a/doc/src/examples/application.qdoc b/doc/src/examples/application.qdoc index 9e03bc4..5f7b9fe 100644 --- a/doc/src/examples/application.qdoc +++ b/doc/src/examples/application.qdoc @@ -29,7 +29,7 @@ \example mainwindows/application \title Application Example - The Application example shows how to implement a standard GUI + \brief The Application example shows how to implement a standard GUI application with menus, toolbars, and a status bar. The example itself is a simple text editor program built around QPlainTextEdit. diff --git a/doc/src/examples/applicationicon.qdoc b/doc/src/examples/applicationicon.qdoc new file mode 100644 index 0000000..f3f222e --- /dev/null +++ b/doc/src/examples/applicationicon.qdoc @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/applicationicon + \group all-examples + \title Application Icon Example + + \brief The Application Icon example shows how to add an application icon to a + mobile application. + + \image appicon_screenshot.png The icon on a Nokia XPressMusic 5800 + + \section1 Creating an icon for Maemo + + Maemo expects the icon of an application to be a 64x64 PNG image file. The + file name of the icon should be the same as the executable with a \c .png + extension. You also need a \c .desktop file that gives the window manager + hints about the application, such as name, type and icon. + + \quotefile examples/widgets/applicationicon/applicationicon.desktop + + The \c Icon field should also contain the name of the executable. On the + device, application icons are stored in the + \c /usr/share/icons/hicolor/64x64/apps directory + and desktop files in the \c /usr/share/applications/hildon directory. + + \section1 Creating an icon for Symbian + + Symbian uses Scalable Vector Graphics (SVG Tiny 1.1+) to render + application icons in the application menu. Therefore icons could be + created manually with a text editor, since SVG files are plain text with + XML syntax, but usually you would use a vector graphics program that is + able to output SVG files. Popular graphics programs such as Adobe + Illustrator or Inkscape are able to do so. + + For best results, the icon should be created on a 44x44 pixel canvas. + Otherwise the image might be scaled in unexpected ways. + + Once you have created your icon, make sure that it is stored according to + the SVG-Tiny 1.1+ standard. Inkscape, for instance, is not able to save + images that way, but there are tools that can convert general SVG files + into the Tiny format. For instance, the svg2svgt tool that is bundled with + Symbian 3rd and 5th editon SDKs under the folder s60tools can do this + conversion to some extent. Another tool to convert SVG to SVG Tiny is SVG + Pony. + + \section1 Adding the icons to the project + + Edit the .pro file and specify the ICON variable for the symbian target. + For Maemo, we need to add that the \c .desktop and icon file should be + installed. + + \quotefile examples/widgets/applicationicon/applicationicon.pro + + Currently, Qt Creator doesn't include the icon and desktop files in the + application package for Maemo, merely the executable file is included. As a + workaround for this, the files can be added manually in the Projects tab. + In the "Create Package" build step for the Maemo target, the \c .desktop + file and icon can be added to be a part of the package contents. + Unfortunately, these additions are only stored as a part of the + \c .pro.user file. This issue will be resolved in a future release of + Qt Creator. + + \image appicon_packagecontents.png Manual addition of files to the "Create Package" build step +*/ diff --git a/doc/src/examples/arrowpad.qdoc b/doc/src/examples/arrowpad.qdoc index f3ba332..ef0bd27 100644 --- a/doc/src/examples/arrowpad.qdoc +++ b/doc/src/examples/arrowpad.qdoc @@ -29,7 +29,7 @@ \example linguist/arrowpad \title Arrow Pad Example - This example is a slightly more involved and introduces a key \e + \brief ThArrow Pad Linguist example is a slightly more involved and introduces a key \e {Qt Linguist} concept: "contexts". It also shows how to use two or more languages. diff --git a/doc/src/examples/audiodevices.qdoc b/doc/src/examples/audiodevices.qdoc index 7c95678..1690f34 100644 --- a/doc/src/examples/audiodevices.qdoc +++ b/doc/src/examples/audiodevices.qdoc @@ -29,7 +29,7 @@ \example multimedia/audiodevices \title Audio Devices Example - The Audio Devices example demonstrates the basic use of QAudioDeviceInfo class + \brief The Audio Devices example demonstrates the basic use of QAudioDeviceInfo class provided with Qt. \image audiodevices-example.png diff --git a/doc/src/examples/audioinput.qdoc b/doc/src/examples/audioinput.qdoc index 1b6d461..d5af63f 100644 --- a/doc/src/examples/audioinput.qdoc +++ b/doc/src/examples/audioinput.qdoc @@ -29,7 +29,7 @@ \example multimedia/audioinput \title AudioInput Example - The Audio Input example demonstrates the basic use of QAudioInput class + \brief The Audio Input example demonstrates the basic use of QAudioInput class provided with Qt. \image audioinput-example.png diff --git a/doc/src/examples/audiooutput.qdoc b/doc/src/examples/audiooutput.qdoc index 47a09fa..9362029 100644 --- a/doc/src/examples/audiooutput.qdoc +++ b/doc/src/examples/audiooutput.qdoc @@ -29,7 +29,7 @@ \example multimedia/audiooutput \title Audio Output Example - The Audio Output example demonstrates the basic use of the QAudioOutput class + \brief The Audio Output example demonstrates the basic use of the QAudioOutput class provided with Qt. \image audiooutput-example.png diff --git a/doc/src/examples/basicdrawing.qdoc b/doc/src/examples/basicdrawing.qdoc index fbc34e6..f18907c 100644 --- a/doc/src/examples/basicdrawing.qdoc +++ b/doc/src/examples/basicdrawing.qdoc @@ -29,7 +29,7 @@ \example painting/basicdrawing \title Basic Drawing Example - The Basic Drawing example shows how to display basic graphics + \brief The Basic Drawing example shows how to display basic graphics primitives in a variety of styles using the QPainter class. QPainter performs low-level painting on widgets and other paint diff --git a/doc/src/examples/basicgraphicslayouts.qdoc b/doc/src/examples/basicgraphicslayouts.qdoc index 2742870..27c9cb6 100644 --- a/doc/src/examples/basicgraphicslayouts.qdoc +++ b/doc/src/examples/basicgraphicslayouts.qdoc @@ -29,7 +29,7 @@ \example graphicsview/basicgraphicslayouts \title Basic Graphics Layouts Example - The Basic Graphics Layouts example shows how to use the layout classes + \brief The Basic Graphics Layouts example shows how to use the layout classes in QGraphicsView: QGraphicsLinearLayout and QGraphicsGridLayout. In addition to that it shows how to write your own custom layout item. @@ -161,4 +161,4 @@ \snippet examples/graphicsview/basicgraphicslayouts/layoutitem.cpp 5 -*/
\ No newline at end of file +*/ diff --git a/doc/src/examples/basiclayouts.qdoc b/doc/src/examples/basiclayouts.qdoc index a8c64f0..ade0b08 100644 --- a/doc/src/examples/basiclayouts.qdoc +++ b/doc/src/examples/basiclayouts.qdoc @@ -29,7 +29,7 @@ \example layouts/basiclayouts \title Basic Layouts Example - The Basic Layouts example shows how to use the standard layout + \brief The Basic Layouts example shows how to use the standard layout managers that are available in Qt: QBoxLayout, QGridLayout and QFormLayout. diff --git a/doc/src/examples/basicsortfiltermodel.qdoc b/doc/src/examples/basicsortfiltermodel.qdoc index dbe9f02..92c000e 100644 --- a/doc/src/examples/basicsortfiltermodel.qdoc +++ b/doc/src/examples/basicsortfiltermodel.qdoc @@ -29,7 +29,7 @@ \example itemviews/basicsortfiltermodel \title Basic Sort/Filter Model Example - The Basic Sort/Filter Model example illustrates how to use + \brief The Basic Sort/Filter Model example illustrates how to use QSortFilterProxyModel to perform basic sorting and filtering. \image basicsortfiltermodel-example.png Screenshot of the Basic Sort/Filter Model Example diff --git a/doc/src/examples/bearercloud.qdoc b/doc/src/examples/bearercloud.qdoc index 18a4ddf..f549eb4 100644 --- a/doc/src/examples/bearercloud.qdoc +++ b/doc/src/examples/bearercloud.qdoc @@ -29,7 +29,7 @@ \example network/bearercloud \title Bearer Cloud Example - The Bearer Cloud example shows how to use the Bearer Management API to monitor the + \brief The Bearer Cloud example shows how to use the Bearer Management API to monitor the connectivity state of the local device. \image bearercloud-example.png Screenshot of the Bearer Cloud example diff --git a/doc/src/examples/bearermonitor.qdoc b/doc/src/examples/bearermonitor.qdoc index a638d12..ec5d091 100644 --- a/doc/src/examples/bearermonitor.qdoc +++ b/doc/src/examples/bearermonitor.qdoc @@ -29,7 +29,7 @@ \example network/bearermonitor \title Bearer Monitor Example - The Bearer Monitor example shows how to use the Bearer Management API. + \brief The Bearer Monitor example shows how to use the Bearer Management API. \image bearermonitor-example.png Screenshot of the Bearer Monitor example */ diff --git a/doc/src/examples/blockingfortuneclient.qdoc b/doc/src/examples/blockingfortuneclient.qdoc index d35ed4c..5549ebb 100644 --- a/doc/src/examples/blockingfortuneclient.qdoc +++ b/doc/src/examples/blockingfortuneclient.qdoc @@ -29,7 +29,7 @@ \example network/blockingfortuneclient \title Blocking Fortune Client Example - The Blocking Fortune Client example shows how to create a client for a + \brief The Blocking Fortune Client example shows how to create a client for a network service using QTcpSocket's synchronous API in a non-GUI thread. \image blockingfortuneclient-example.png diff --git a/doc/src/examples/blurpicker.qdoc b/doc/src/examples/blurpicker.qdoc index 3a6d433..00c822d 100644 --- a/doc/src/examples/blurpicker.qdoc +++ b/doc/src/examples/blurpicker.qdoc @@ -29,5 +29,7 @@ \example effects/blurpicker \title Blur Picker Effect Example + \brief The Blur Picker Example shows the QGraphicsBlurEffect in action. + \image blurpickereffect-example.png */ diff --git a/doc/src/examples/borderlayout.qdoc b/doc/src/examples/borderlayout.qdoc index 94cd3d9..cf8a4fc 100644 --- a/doc/src/examples/borderlayout.qdoc +++ b/doc/src/examples/borderlayout.qdoc @@ -29,7 +29,7 @@ \example layouts/borderlayout \title Border Layout Example - The Border Layout example shows how to create a custom layout that arranges + \brief The Border Layout example shows how to create a custom layout that arranges child widgets according to a simple set of rules. \image borderlayout-example.png diff --git a/doc/src/examples/broadcastreceiver.qdoc b/doc/src/examples/broadcastreceiver.qdoc index e5d4ae0..e716a74 100644 --- a/doc/src/examples/broadcastreceiver.qdoc +++ b/doc/src/examples/broadcastreceiver.qdoc @@ -29,7 +29,7 @@ \example network/broadcastreceiver \title Broadcast Receiver Example - The Broadcast Receiever example shows how to receive information that is broadcasted + \brief The Broadcast Receiver example shows how to receive information that is broadcasted over a local network. \image broadcastreceiver-example.png diff --git a/doc/src/examples/broadcastsender.qdoc b/doc/src/examples/broadcastsender.qdoc index 2cb0a13..a272e88 100644 --- a/doc/src/examples/broadcastsender.qdoc +++ b/doc/src/examples/broadcastsender.qdoc @@ -29,7 +29,7 @@ \example network/broadcastsender \title Broadcast Sender Example - The Broadcast Sender example shows how to broadcast information to multiple clients + \brief The Broadcast Sender example shows how to broadcast information to multiple clients on a local network. \image broadcastsender-example.png diff --git a/doc/src/examples/cachedtable.qdoc b/doc/src/examples/cachedtable.qdoc index 5a20329..7660dbf 100644 --- a/doc/src/examples/cachedtable.qdoc +++ b/doc/src/examples/cachedtable.qdoc @@ -29,7 +29,7 @@ \example sql/cachedtable \title Cached Table Example - The Cached Table example shows how a table view can be used to access a database, + \brief The Cached Table example shows how a table view can be used to access a database, caching any changes to the data until the user explicitly submits them using a push button. diff --git a/doc/src/examples/calculator.qdoc b/doc/src/examples/calculator.qdoc index c7dc013..7941698 100644 --- a/doc/src/examples/calculator.qdoc +++ b/doc/src/examples/calculator.qdoc @@ -29,7 +29,7 @@ \example widgets/calculator \title Calculator Example - The example shows how to use signals and slots to implement the + \brief The example shows how to use signals and slots to implement the functionality of a calculator widget, and how to use QGridLayout to place child widgets in a grid. diff --git a/doc/src/examples/calculatorbuilder.qdoc b/doc/src/examples/calculatorbuilder.qdoc index ac9db9f..97f6f06 100644 --- a/doc/src/examples/calculatorbuilder.qdoc +++ b/doc/src/examples/calculatorbuilder.qdoc @@ -29,7 +29,7 @@ \example designer/calculatorbuilder \title Calculator Builder Example - The Calculator Builder example shows how to create a user interface from + \brief The Calculator Builder example shows how to create a user interface from a \QD form at run-time, using the QUiLoader class. \image calculatorbuilder-example.png diff --git a/doc/src/examples/calculatorform.qdoc b/doc/src/examples/calculatorform.qdoc index e1025b6..945659f 100644 --- a/doc/src/examples/calculatorform.qdoc +++ b/doc/src/examples/calculatorform.qdoc @@ -29,9 +29,11 @@ \example designer/calculatorform \title Calculator Form Example - The Calculator Form Example shows how to use a form created with + \brief The Calculator Form Example shows how to use a form created with \QD in an application by using the user interface information from - a QWidget subclass. We use \l{Using a Designer UI File in Your Application} + a QWidget subclass. + + We use \l{Using a Designer UI File in Your Application} {uic's auto-connection} feature to automatically connect signals from widgets on the form to slots in our code. diff --git a/doc/src/examples/calendar.qdoc b/doc/src/examples/calendar.qdoc index 32bc547..2221e1f 100644 --- a/doc/src/examples/calendar.qdoc +++ b/doc/src/examples/calendar.qdoc @@ -29,7 +29,7 @@ \example richtext/calendar \title Calendar Example - The Calendar example shows how to create rich text content and display it using + \brief The Calendar example shows how to create rich text content and display it using a rich text editor. \image calendar-example.png diff --git a/doc/src/examples/calendarwidget.qdoc b/doc/src/examples/calendarwidget.qdoc index f72082a..ed3cd32 100644 --- a/doc/src/examples/calendarwidget.qdoc +++ b/doc/src/examples/calendarwidget.qdoc @@ -29,7 +29,7 @@ \title Calendar Widget Example \example widgets/calendarwidget - The Calendar Widget example shows use of \c QCalendarWidget. + \brief The Calendar Widget example shows use of \c QCalendarWidget. \image calendarwidgetexample.png diff --git a/doc/src/examples/capabilitiesexample.qdoc b/doc/src/examples/capabilitiesexample.qdoc index 636044b..c0c4f93 100644 --- a/doc/src/examples/capabilitiesexample.qdoc +++ b/doc/src/examples/capabilitiesexample.qdoc @@ -29,7 +29,7 @@ \example phonon/capabilities \title Capabilities Example - The Backend Capabilities example shows how to check which MIME + \brief The Backend Capabilities example shows how to check which MIME types, audio devices, and audio effects are available. \image capabilitiesexample.png diff --git a/doc/src/examples/charactermap.qdoc b/doc/src/examples/charactermap.qdoc index 285d6a4..fa82d7e 100644 --- a/doc/src/examples/charactermap.qdoc +++ b/doc/src/examples/charactermap.qdoc @@ -29,7 +29,7 @@ \example widgets/charactermap \title Character Map Example -The Character Map example shows how to create a custom widget that can +\brief The Character Map example shows how to create a custom widget that can both display its own content and respond to user input. The example displays an array of characters which the user can click on diff --git a/doc/src/examples/chart.qdoc b/doc/src/examples/chart.qdoc index af82f1b..d18a8fa 100644 --- a/doc/src/examples/chart.qdoc +++ b/doc/src/examples/chart.qdoc @@ -29,7 +29,7 @@ \example itemviews/chart \title Chart Example - The Chart example shows how to create a custom view for the model/view framework. + \brief The Chart example shows how to create a custom view for the model/view framework. \image chart-example.png diff --git a/doc/src/examples/classwizard.qdoc b/doc/src/examples/classwizard.qdoc index 53d0936..d29b956 100644 --- a/doc/src/examples/classwizard.qdoc +++ b/doc/src/examples/classwizard.qdoc @@ -29,7 +29,7 @@ \example dialogs/classwizard \title Class Wizard Example - The License Wizard example shows how to implement linear + \brief The License Wizard example shows how to implement linear wizards using QWizard. \image classwizard.png Screenshot of the Class Wizard example diff --git a/doc/src/examples/codecs.qdoc b/doc/src/examples/codecs.qdoc index 91fb6a2..02248e9 100644 --- a/doc/src/examples/codecs.qdoc +++ b/doc/src/examples/codecs.qdoc @@ -29,7 +29,7 @@ \example tools/codecs \title Codecs Example - The Codecs example demonstrates the principles behind importing and exporting text + \brief The Codecs example demonstrates the principles behind importing and exporting text using codecs to ensure that characters are encoded properly, avoiding loss of data and retaining the correct symbols used in various scripts. diff --git a/doc/src/examples/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc index 2b0b6fa..9935e88 100644 --- a/doc/src/examples/codeeditor.qdoc +++ b/doc/src/examples/codeeditor.qdoc @@ -29,7 +29,7 @@ \example widgets/codeeditor \title Code Editor Example - The Code Editor example shows how to create a simple editor that + \brief The Code Editor example shows how to create a simple editor that has line numbers and that highlights the current line. \image codeeditor-example.png @@ -190,6 +190,34 @@ used to implement parenthesis matching. In the \c highlightCurrentLine(), the data of the currentBlock() can be fetched with QTextBlock::userData(). Matching parentheses can be - highlighted with an extra selection. - + highlighted with an extra selection. The "Matching Parentheses + with QSyntaxHighlighter" article in Qt Quarterly 31 implements + this. You find it here: \l{http://doc.qt.nokia.com/qq/}. + + The line number area is now painted every time the cursor blinks + (because we connect \l{QPlainTextEdit::}{updateRequest()} to + \c updateLineNumberArea()). We can avoid this by introducing a new + member variable to CodeEditor that keeps track of when the update + request comes from a cursor blink (in which case we do not + repaint). The code below requires the \c m_countCache variable, + which is a QPair<int, int> initialized with \c -1 for both + \l{QPair::}{first} and \l{QPair::}{second}. + + \code + void CodeEditor::updateLineNumberArea(const QRect &rect, int dy) + { + if (dy) { + lineNumberArea->scroll(0, dy); + } else if (m_countCache.first != blockCount() + || m_countCache.second != textCursor().block().lineCount()) { + lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height()); + m_countCache.first = blockCount(); + m_countCache.second = textCursor().block().lineCount(); + } + + if (rect.contains(viewport()->rect())) + updateLineNumberAreaWidth(0); + } + \endcode */ + diff --git a/doc/src/examples/collidingmice-example.qdoc b/doc/src/examples/collidingmice-example.qdoc index 4bdd79d..e7c475a 100644 --- a/doc/src/examples/collidingmice-example.qdoc +++ b/doc/src/examples/collidingmice-example.qdoc @@ -29,7 +29,7 @@ \example graphicsview/collidingmice \title Colliding Mice Example - The Colliding Mice example shows how to use the Graphics View + \brief The Colliding Mice example shows how to use the Graphics View framework to implement animated items and detect collision between items. @@ -265,4 +265,4 @@ Doing the animation with a single timer connect to advance the scene ensures that all the mice are moved at one point and, more importantly, only one update is sent to the screen after all the mice have moved. -*/
\ No newline at end of file +*/ diff --git a/doc/src/examples/coloreditorfactory.qdoc b/doc/src/examples/coloreditorfactory.qdoc index 34060bd..e7c6e7d 100644 --- a/doc/src/examples/coloreditorfactory.qdoc +++ b/doc/src/examples/coloreditorfactory.qdoc @@ -29,8 +29,8 @@ \example itemviews/coloreditorfactory \title Color Editor Factory Example - This example shows how to create an editor that can be used by - a QItemDelegate. + \brief The Color Editor Factory example shows how to create an editor that + can be used by a QItemDelegate. \image coloreditorfactoryimage.png diff --git a/doc/src/examples/combowidgetmapper.qdoc b/doc/src/examples/combowidgetmapper.qdoc index efd06f6..61d69c1 100644 --- a/doc/src/examples/combowidgetmapper.qdoc +++ b/doc/src/examples/combowidgetmapper.qdoc @@ -29,7 +29,7 @@ \example itemviews/combowidgetmapper \title Combo Widget Mapper Example - The Delegate Widget Mapper example shows how to use a custom delegate to + \brief The Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form. \image combowidgetmapper-example.png diff --git a/doc/src/examples/completer.qdoc b/doc/src/examples/completer.qdoc index 408de6b..298bbc4 100644 --- a/doc/src/examples/completer.qdoc +++ b/doc/src/examples/completer.qdoc @@ -29,7 +29,7 @@ \example tools/completer \title Completer Example - The Completer example shows how to provide string-completion facilities + \brief The Completer example shows how to provide string-completion facilities for an input widget based on data provided by a model. \image completer-example.png diff --git a/doc/src/examples/complexpingpong.qdoc b/doc/src/examples/complexpingpong.qdoc index 677353b..2013744 100644 --- a/doc/src/examples/complexpingpong.qdoc +++ b/doc/src/examples/complexpingpong.qdoc @@ -29,7 +29,7 @@ \example dbus/complexpingpong \title Complex Ping Pong Example - The Complex Ping Pong example improves on the \l{D-Bus Ping Pong Example} by providing + \brief The Complex Ping Pong example improves on the \l{D-Bus Ping Pong Example} by providing a more useful demonstration of D-Bus interfaces. \quotefile doc/src/snippets/complexpingpong-example.txt diff --git a/doc/src/examples/concentriccircles.qdoc b/doc/src/examples/concentriccircles.qdoc index 37c8f83..bfa24d9 100644 --- a/doc/src/examples/concentriccircles.qdoc +++ b/doc/src/examples/concentriccircles.qdoc @@ -29,7 +29,7 @@ \example painting/concentriccircles \title Concentric Circles Example - The Concentric Circles example shows the improved rendering + \brief The Concentric Circles example shows the improved rendering quality that can be obtained using floating point precision and anti-aliasing when drawing custom widgets. The example also shows how to do simple animations. diff --git a/doc/src/examples/configdialog.qdoc b/doc/src/examples/configdialog.qdoc index 166b25a..d83dbdb 100644 --- a/doc/src/examples/configdialog.qdoc +++ b/doc/src/examples/configdialog.qdoc @@ -29,7 +29,7 @@ \example dialogs/configdialog \title Config Dialog Example - The Config Dialog examples shows how a configuration dialog can be created by + \brief The Config Dialog examples shows how a configuration dialog can be created by using an icon view with a stacked widget. \image configdialog-example.png diff --git a/doc/src/examples/containerextension.qdoc b/doc/src/examples/containerextension.qdoc index ca7ef13..606da2d 100644 --- a/doc/src/examples/containerextension.qdoc +++ b/doc/src/examples/containerextension.qdoc @@ -29,7 +29,7 @@ \example designer/containerextension \title Container Extension Example - The Container Extension example shows how to create a custom + \brief The Container Extension example shows how to create a custom multi-page plugin for Qt Designer using the QDesignerContainerExtension class. diff --git a/doc/src/examples/context2d.qdoc b/doc/src/examples/context2d.qdoc index 729e56b..9d9d0c6 100644 --- a/doc/src/examples/context2d.qdoc +++ b/doc/src/examples/context2d.qdoc @@ -29,7 +29,7 @@ \example script/context2d \title Context2D Example - This Qt Script example is an implementation of the Context2D API. + \brief This Qt Script example is an implementation of the Context2D API. \image context2d-example.png diff --git a/doc/src/examples/contextsensitivehelp.qdoc b/doc/src/examples/contextsensitivehelp.qdoc index 42e4a11..32b59bc 100644 --- a/doc/src/examples/contextsensitivehelp.qdoc +++ b/doc/src/examples/contextsensitivehelp.qdoc @@ -29,5 +29,5 @@ \example help/contextsensitivehelp \title Context-Sensitive Help Example - This example shows how to use the services of the QHelpEngineCore class. + \brief The Context Sensitive Help example shows how to use the services of the QHelpEngineCore class. */ diff --git a/doc/src/examples/contiguouscache.qdoc b/doc/src/examples/contiguouscache.qdoc index d0b39e6..52e8b15 100644 --- a/doc/src/examples/contiguouscache.qdoc +++ b/doc/src/examples/contiguouscache.qdoc @@ -29,8 +29,10 @@ \example tools/contiguouscache \title Contiguous Cache Example - The Contiguous Cache example shows how to use QContiguousCache to manage memory usage for - very large models. In some environments memory is limited and, even when it + \brief The Contiguous Cache example shows how to use QContiguousCache to manage memory usage for + very large models. + + In some environments memory is limited and, even when it isn't, users still dislike an application using excessive memory. Using QContiguousCache to manage a list, rather than loading the entire list into memory, allows the application to limit the amount diff --git a/doc/src/examples/cube.qdoc b/doc/src/examples/cube.qdoc new file mode 100644 index 0000000..e28d4b2 --- /dev/null +++ b/doc/src/examples/cube.qdoc @@ -0,0 +1,180 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example opengl/cube + \group all-examples + \title Cube OpenGL ES 2.0 example + + \brief The Cube OpenGL ES 2.0 example shows how to write mouse rotateable + textured 3D cube using OpenGL ES 2.0 with Qt. + + It shows how to handle + polygon geometries efficiently and how to write simple vertex and + fragment shader for programmable graphics pipeline. In addition it + shows how to use quaternions for representing 3D object orientation. + + This example has been written for OpenGL ES 2.0 but it works also on + desktop OpenGL because this example is simple enough and for the + most parts desktop OpenGL API is same. It compiles also without OpenGL + support but then it just shows a label stating that OpenGL support is + required. + + \image cube.png Screenshot of the Cube example running on N900 + + The example consist of two classes: + + \list + \o \c MainWidget extends QGLWidget and contains OpenGL ES 2.0 + initialization and drawing and mouse and timer event handling + \o \c GeometryEngine handles polygon geometries. Transfers polygon geometry + to vertex buffer objects and draws geometries from vertex buffer objects. + \endlist + + We'll start by initializing OpenGL ES 2.0 in \c MainWidget. + + \tableofcontents + + \section1 Initializing OpenGL ES 2.0 + + Since OpenGL ES 2.0 doesn't support fixed graphics pipeline anymore it has to + be implemented by ourselves. This makes graphics pipeline very flexible but + in the same time it becomes more difficult because user has to implement graphics + pipeline to get even the simplest example running. It also makes graphics pipeline + more efficient because user can decide what kind of pipeline is needed for the + application. + + First we have to implement vertex shader. It gets vertex data and + model-view-projection matrix (MVP) as parameters. It transforms vertex position + using MVP matrix to screen space and passes texture coordinate to + fragment shader. Texture coordinate will be automatically interpolated on polygon + faces. + + \snippet examples/opengl/cube/vshader.glsl 0 + + After that we need to implement second part of the graphics pipeline - fragment + shader. For this exercise we need to implement fragment shader that handles + texturing. It gets interpolated texture coordinate as a parameter and looks up + fragment color from the given texture. + + \snippet examples/opengl/cube/fshader.glsl 0 + + Using \c QGLShaderProgram we can compile, link and bind shader code to + graphics pipeline. This code uses Qt Resource files to access shader source code. + + \snippet examples/opengl/cube/mainwidget.cpp 3 + + The following code enables depth buffering and back face culling. + + \snippet examples/opengl/cube/mainwidget.cpp 2 + + \section1 Loading textures from Qt Resource files + + \c QGLWidget interface implements methods for loading textures from QImage to GL + texture memory. We still need to use OpenGL provided functions for specifying + the GL texture unit and configuring texture filtering options. + + \snippet examples/opengl/cube/mainwidget.cpp 4 + + \section1 Cube Geometry + + There are many ways to render polygons in OpenGL but the most efficient way is + to use only triangle strip primitives and render vertices from graphics hardware + memory. OpenGL has a mechanism to create buffer objects to this memory area and + transfer vertex data to these buffers. In OpenGL terminology these are referred + as Vertex Buffer Objects (VBO). + + \image cube_faces.png Cube faces and vertices + + This is how cube faces break down to triangles. Vertices are ordered this way + to get vertex ordering correct using triangle strips. OpenGL determines triangle + front and back face based on vertex ordering. By default OpenGL uses + counter-clockwise order for front faces. This information is used by back face + culling which improves rendering performance by not rendering back faces of the + triangles. This way graphics pipeline can omit rendering sides of the triangle that + aren't facing towards screen. + + Creating vertex buffer objects and transferring data to them is quite simple using + OpenGL provided functions. + + \snippet examples/opengl/cube/geometryengine.cpp 0 + + \snippet examples/opengl/cube/geometryengine.cpp 1 + + Drawing primitives from VBOs and telling programmable graphics pipeline how to + locate vertex data requires few steps. First we need to bind VBOs to be used. + After that we bind shader program attribute names and configure what + kind of data it has in the bound VBO. Finally we'll draw triangle + strip primitives using indices from the other VBO. + + \snippet examples/opengl/cube/geometryengine.cpp 2 + + \section1 Perspective projection + + Using \c QMatrix4x4 helper methods it's really easy to calculate perpective + projection matrix. This matrix is used to project vertices to screen space. + + \snippet examples/opengl/cube/mainwidget.cpp 5 + + \section1 Orientation of the 3D object + + Quaternions are handy way to represent orientation of the 3D object. Quaternions + involve quite complex mathematics but fortunately all the necessary mathematics + behind quaternions is implemented in \c QQuaternion. That allows us to store + cube orientation in quaternion and rotating cube around given axis is quite + simple. + + The following code calculates rotation axis and angular speed based on mouse events. + + \snippet examples/opengl/cube/mainwidget.cpp 0 + + \c QBasicTimer is used to animate scene and update cube orientation. Rotations + can be concatenated simply by multiplying quaternions. + + \snippet examples/opengl/cube/mainwidget.cpp 1 + + Model-view matrix is calculated using the quaternion and by moving world by Z axis. + This matrix is multiplied with the projection matrix to get MVP matrix for shader + program. + + \snippet examples/opengl/cube/mainwidget.cpp 6 + +*/ diff --git a/doc/src/examples/customcompleter.qdoc b/doc/src/examples/customcompleter.qdoc index f0d5698..27e2ea7 100644 --- a/doc/src/examples/customcompleter.qdoc +++ b/doc/src/examples/customcompleter.qdoc @@ -29,9 +29,9 @@ \example tools/customcompleter \title Custom Completer Example - The Custom Completer example shows how to provide string-completion - facilities for an input widget based on data provided by a model. The - completer pops up suggestions for possible words based on the first three + \brief The Custom Completer example shows how to provide string-completion + facilities for an input widget based on data provided by a model. + The completer pops up suggestions for possible words based on the first three characters input by the user and the user's choice of word is inserted into the \c TextEdit using QTextCursor. diff --git a/doc/src/examples/customsortfiltermodel.qdoc b/doc/src/examples/customsortfiltermodel.qdoc index e145e82..41f8b04 100644 --- a/doc/src/examples/customsortfiltermodel.qdoc +++ b/doc/src/examples/customsortfiltermodel.qdoc @@ -29,7 +29,7 @@ \example itemviews/customsortfiltermodel \title Custom Sort/Filter Model Example - The Custom Sort/Filter Model example illustrates how to subclass + \brief The Custom Sort/Filter Model example illustrates how to subclass QSortFilterProxyModel to perform advanced sorting and filtering. \image customsortfiltermodel-example.png Screenshot of the Custom Sort/Filter Model Example diff --git a/doc/src/examples/customtype.qdoc b/doc/src/examples/customtype.qdoc index d98225a..8ff97f3 100644 --- a/doc/src/examples/customtype.qdoc +++ b/doc/src/examples/customtype.qdoc @@ -29,7 +29,7 @@ \example tools/customtype \title Custom Type Example - The Custom Type example shows how to integrate a custom type into Qt's + \brief The Custom Type example shows how to integrate a custom type into Qt's meta-object system. Contents: @@ -117,7 +117,7 @@ \snippet examples/tools/customtype/main.cpp storing a custom value - Alternatively, the qVariantFromValue() and qVariantSetValue() functions + Alternatively, the QVariant::fromValue() and qVariantSetValue() functions can be used if you are using a compiler without support for member template functions. diff --git a/doc/src/examples/customtypesending.qdoc b/doc/src/examples/customtypesending.qdoc index fc6b793..4ffb40e 100644 --- a/doc/src/examples/customtypesending.qdoc +++ b/doc/src/examples/customtypesending.qdoc @@ -29,7 +29,7 @@ \example tools/customtypesending \title Custom Type Sending Example - The Custom Type Sending example shows how to use a custom type with signals + \brief The Custom Type Sending example shows how to use a custom type with signals and slots. \image customtypesending-example.png diff --git a/doc/src/examples/customwidgetplugin.qdoc b/doc/src/examples/customwidgetplugin.qdoc index dadfbaf..81277ce 100644 --- a/doc/src/examples/customwidgetplugin.qdoc +++ b/doc/src/examples/customwidgetplugin.qdoc @@ -29,7 +29,7 @@ \example designer/customwidgetplugin \title Custom Widget Plugin Example - The Custom Widget example shows how to create a custom widget plugin for \QD. + \brief The Custom Widget example shows how to create a custom widget plugin for \QD. \image customwidgetplugin-example.png diff --git a/doc/src/examples/dbscreen.qdoc b/doc/src/examples/dbscreen.qdoc index 7f6bb18..c2b88cd 100644 --- a/doc/src/examples/dbscreen.qdoc +++ b/doc/src/examples/dbscreen.qdoc @@ -29,7 +29,7 @@ \example qws/dbscreen \title Double Buffered Graphics Driver Example - The Double Buffered Graphics Driver example shows how to write your own + \brief The Double Buffered Graphics Driver example shows how to write your own double buffered graphics driver and add it to Qt for Embedded Linux. Similar to the \l{Accelerated Graphics Driver Example}, there are three steps diff --git a/doc/src/examples/dbus-chat.qdoc b/doc/src/examples/dbus-chat.qdoc index a435cc9..c00166d 100644 --- a/doc/src/examples/dbus-chat.qdoc +++ b/doc/src/examples/dbus-chat.qdoc @@ -29,7 +29,7 @@ \example dbus/dbus-chat \title D-Bus Chat Example - The D-Bus Chat example shows how to use D-Bus to communicate between two + \brief The D-Bus Chat example shows how to use D-Bus to communicate between two applications. \image dbus-chat-example.png diff --git a/doc/src/examples/dbus-listnames.qdoc b/doc/src/examples/dbus-listnames.qdoc index 3d359f7..9807c30 100644 --- a/doc/src/examples/dbus-listnames.qdoc +++ b/doc/src/examples/dbus-listnames.qdoc @@ -29,5 +29,5 @@ \example dbus/listnames \title D-Bus List Names Example - The D-Bus List Names examples shows how to query D-Bus for a list of service names. + \brief The D-Bus List Names examples shows how to query D-Bus for a list of service names. */ diff --git a/doc/src/examples/dbus-pingpong.qdoc b/doc/src/examples/dbus-pingpong.qdoc index dc0f50b..2463877 100644 --- a/doc/src/examples/dbus-pingpong.qdoc +++ b/doc/src/examples/dbus-pingpong.qdoc @@ -29,7 +29,7 @@ \example dbus/pingpong \title D-Bus Ping Pong Example - The D-Bus Ping Pong example provides a basic demonstration of D-Bus + \brief The D-Bus Ping Pong example provides a basic demonstration of D-Bus interfaces. \quotefile doc/src/snippets/dbus-pingpong-example.txt diff --git a/doc/src/examples/dbus-remotecontrolledcar.qdoc b/doc/src/examples/dbus-remotecontrolledcar.qdoc index 3f0af9a..7152e21 100644 --- a/doc/src/examples/dbus-remotecontrolledcar.qdoc +++ b/doc/src/examples/dbus-remotecontrolledcar.qdoc @@ -29,7 +29,7 @@ \example dbus/remotecontrolledcar \title D-Bus Remote Controlled Car Example - The Remote Controlled Car example shows how to use D-Bus to control one + \brief The Remote Controlled Car example shows how to use D-Bus to control one application using another. \image remotecontrolledcar-car-example.png diff --git a/doc/src/examples/defaultprototypes.qdoc b/doc/src/examples/defaultprototypes.qdoc index a6c79f0..493a3bb 100644 --- a/doc/src/examples/defaultprototypes.qdoc +++ b/doc/src/examples/defaultprototypes.qdoc @@ -29,7 +29,7 @@ \example script/defaultprototypes \title Default Prototypes Example - This Qt Script example shows how to use default prototypes + \brief The Default Prototypes QtScript example shows how to use default prototypes to make a non-QObject-based type scriptable. \image defaultprototypes-example.png diff --git a/doc/src/examples/delayedencoding.qdoc b/doc/src/examples/delayedencoding.qdoc index 8ac2c7f..d94b589 100644 --- a/doc/src/examples/delayedencoding.qdoc +++ b/doc/src/examples/delayedencoding.qdoc @@ -29,7 +29,7 @@ \example draganddrop/delayedencoding \title Delayed Encoding Example - The Delayed Encoding example shows how to delay preparing of data + \brief The Delayed Encoding example shows how to delay preparing of data for drag and drop operations until a drop target is found. \image delayedecoding-example.png diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc index 7d3c0e6..c7b4bfe 100644 --- a/doc/src/examples/diagramscene.qdoc +++ b/doc/src/examples/diagramscene.qdoc @@ -29,12 +29,12 @@ \example graphicsview/diagramscene \title Diagram Scene Example - This example shows use of Qt's graphics framework. + \brief The Diagram Scene example is an application in which you can + create a flowchart diagram using the graphics view framework. \image diagramscene.png - The Diagram Scene example is an application in which you can - create a flowchart diagram. It is possible to add flowchart shapes + In this example it is possible to add flowchart shapes and text and connect the shapes by arrows as shown in the image above. The shapes, arrows, and text can be given different colors, and it is possible to change the font, style, and diff --git a/doc/src/examples/digitalclock.qdoc b/doc/src/examples/digitalclock.qdoc index acee4d6..90ee710 100644 --- a/doc/src/examples/digitalclock.qdoc +++ b/doc/src/examples/digitalclock.qdoc @@ -29,7 +29,7 @@ \example widgets/digitalclock \title Digital Clock Example - The Digital Clock example shows how to use QLCDNumber to display a + \brief The Digital Clock example shows how to use QLCDNumber to display a number with LCD-like digits. \image digitalclock-example.png Screenshot of the Digital Clock example diff --git a/doc/src/examples/dirview.qdoc b/doc/src/examples/dirview.qdoc index 6d2ce7a..6a45d9a 100644 --- a/doc/src/examples/dirview.qdoc +++ b/doc/src/examples/dirview.qdoc @@ -29,7 +29,7 @@ \example itemviews/dirview \title Dir View Example - The Dir View example shows a tree view onto the local filing system. It uses the + \brief The Dir View example shows a tree view onto the local filing system. It uses the QDirModel class to provide supply file and directory information. \image dirview-example.png diff --git a/doc/src/examples/dockwidgets.qdoc b/doc/src/examples/dockwidgets.qdoc index b46a286..c6cebcc 100644 --- a/doc/src/examples/dockwidgets.qdoc +++ b/doc/src/examples/dockwidgets.qdoc @@ -29,7 +29,7 @@ \example mainwindows/dockwidgets \title Dock Widgets Example - The Dock Widgets example shows how to add dock windows to an + \brief The Dock Widgets example shows how to add dock windows to an application. It also shows how to use Qt's rich text engine. \image dockwidgets-example.png Screenshot of the Dock Widgets example diff --git a/doc/src/examples/dombookmarks.qdoc b/doc/src/examples/dombookmarks.qdoc index 03e3ec6..e25766a 100644 --- a/doc/src/examples/dombookmarks.qdoc +++ b/doc/src/examples/dombookmarks.qdoc @@ -29,9 +29,10 @@ \example xml/dombookmarks \title DOM Bookmarks Example - The DOM Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) - files that uses Qt's DOM-based XML API to read and parse the files. The SAX Bookmarks - example provides an alternative way to read this type of file. + \brief The DOM Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) + files that uses Qt's DOM-based XML API to read and parse the files. + + The SAX Bookmarks example provides an alternative way to read this type of file. \image dombookmarks-example.png diff --git a/doc/src/examples/domtraversal.qdoc b/doc/src/examples/domtraversal.qdoc index d0456c4..657b0dd 100644 --- a/doc/src/examples/domtraversal.qdoc +++ b/doc/src/examples/domtraversal.qdoc @@ -29,7 +29,7 @@ \example webkit/domtraversal \title DOM Traversal Example - The DOM Traversal example shows how to use the QWebElement class to access + \brief The DOM Traversal example shows how to use the QWebElement class to access the structure of a Web page. \image webkit-domtraversal.png diff --git a/doc/src/examples/draganddroppuzzle.qdoc b/doc/src/examples/draganddroppuzzle.qdoc index e89c8fc..4bb1ccb 100644 --- a/doc/src/examples/draganddroppuzzle.qdoc +++ b/doc/src/examples/draganddroppuzzle.qdoc @@ -29,7 +29,7 @@ \example draganddrop/puzzle \title Drag and Drop Puzzle Example - The Drag and Drop Puzzle example demonstrates a way of using the drag and drop system with + \brief The Drag and Drop Puzzle example demonstrates a way of using the drag and drop system with item view widgets. \image draganddroppuzzle-example.png diff --git a/doc/src/examples/dragdroprobot.qdoc b/doc/src/examples/dragdroprobot.qdoc index 1e3b434..aba30ad 100644 --- a/doc/src/examples/dragdroprobot.qdoc +++ b/doc/src/examples/dragdroprobot.qdoc @@ -29,7 +29,7 @@ \example graphicsview/dragdroprobot \title Drag and Drop Robot Example - This GraphicsView example shows how to implement Drag and Drop in a + \brief The Drag and Drop Robot example shows how to implement Drag and Drop in a QGraphicsItem subclass, as well as how to animate items using Qt's \l{Animation Framework}. diff --git a/doc/src/examples/draggableicons.qdoc b/doc/src/examples/draggableicons.qdoc index 0337431..1484a60 100644 --- a/doc/src/examples/draggableicons.qdoc +++ b/doc/src/examples/draggableicons.qdoc @@ -29,7 +29,7 @@ \example draganddrop/draggableicons \title Draggable Icons Example - The Draggable Icons example shows how to drag and drop image data between widgets + \brief The Draggable Icons example shows how to drag and drop image data between widgets in the same application, and between different applications. \image draggableicons-example.png diff --git a/doc/src/examples/draggabletext.qdoc b/doc/src/examples/draggabletext.qdoc index 14d07b6..ae9cfb9 100644 --- a/doc/src/examples/draggabletext.qdoc +++ b/doc/src/examples/draggabletext.qdoc @@ -29,7 +29,7 @@ \example draganddrop/draggabletext \title Draggable Text Example - The Draggable Text example shows how to drag and drop textual data between widgets + \brief The Draggable Text example shows how to drag and drop textual data between widgets in the same application, and between different applications. \image draggabletext-example.png diff --git a/doc/src/examples/drilldown.qdoc b/doc/src/examples/drilldown.qdoc index 1903df6..d11a71f 100644 --- a/doc/src/examples/drilldown.qdoc +++ b/doc/src/examples/drilldown.qdoc @@ -29,7 +29,7 @@ \example sql/drilldown \title Drill Down Example - The Drill Down example shows how to read data from a database as + \brief The Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and QDataWidgetMapper classes. diff --git a/doc/src/examples/dropsite.qdoc b/doc/src/examples/dropsite.qdoc index bf17427..815618a 100644 --- a/doc/src/examples/dropsite.qdoc +++ b/doc/src/examples/dropsite.qdoc @@ -29,7 +29,7 @@ \example draganddrop/dropsite \title Drop Site Example - The example shows how to distinguish the various MIME formats available + \brief The Drop Site example shows how to distinguish the various MIME formats available in a drag and drop operation. \image dropsite-example.png Screenshot of the Drop Site example diff --git a/doc/src/examples/dynamiclayouts.qdoc b/doc/src/examples/dynamiclayouts.qdoc index b8314e3..c93fc74 100644 --- a/doc/src/examples/dynamiclayouts.qdoc +++ b/doc/src/examples/dynamiclayouts.qdoc @@ -29,6 +29,6 @@ \example layouts/dynamiclayouts \title Dynamic Layouts Example - The Dynamic Layouts example shows how to move widgets around in + \brief The Dynamic Layouts example shows how to move widgets around in existing layouts. */ diff --git a/doc/src/examples/easing.qdoc b/doc/src/examples/easing.qdoc index 1a7657d..42f00f1 100644 --- a/doc/src/examples/easing.qdoc +++ b/doc/src/examples/easing.qdoc @@ -29,7 +29,7 @@ \example animation/easing \title Easing Curves Example - The Easing Curves example shows how to use easing curves to + \brief The Easing Curves example shows how to use easing curves to control the speed of an animation. \image easing-example.png diff --git a/doc/src/examples/echoplugin.qdoc b/doc/src/examples/echoplugin.qdoc index cadd485..c920c2b 100644 --- a/doc/src/examples/echoplugin.qdoc +++ b/doc/src/examples/echoplugin.qdoc @@ -29,7 +29,7 @@ \example tools/echoplugin \title Echo Plugin Example - This example shows how to create a Qt plugin. + \brief The Echo Plugin example shows how to create a Qt plugin. \image echopluginexample.png diff --git a/doc/src/examples/editabletreemodel.qdoc b/doc/src/examples/editabletreemodel.qdoc index 8be3037..00f20f6 100644 --- a/doc/src/examples/editabletreemodel.qdoc +++ b/doc/src/examples/editabletreemodel.qdoc @@ -29,8 +29,8 @@ \example itemviews/editabletreemodel \title Editable Tree Model Example - This example shows how to implement a simple item-based tree model that can - be used with other classes the model/view framework. + \brief The Editable Tree Model example shows how to implement a simple item-based tree model that can + be used with other classes in the model/view framework. \image itemviews-editabletreemodel.png diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc index 6a16cee..30ebc6f 100644 --- a/doc/src/examples/elasticnodes.qdoc +++ b/doc/src/examples/elasticnodes.qdoc @@ -29,8 +29,10 @@ \example graphicsview/elasticnodes \title Elastic Nodes Example - This GraphicsView example shows how to implement edges between nodes in a - graph, with basic interaction. You can click to drag a node around, and + \brief The Elastic Nodes example shows how to implement edges between nodes in a + graph, with basic interaction. + + You can click to drag a node around, and zoom in and out using the mouse wheel or the keyboard. Hitting the space bar will randomize the nodes. The example is also resolution independent; as you zoom in, the graphics remain crisp. diff --git a/doc/src/examples/elidedlabel.qdoc b/doc/src/examples/elidedlabel.qdoc new file mode 100644 index 0000000..9a5b476 --- /dev/null +++ b/doc/src/examples/elidedlabel.qdoc @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example widgets/elidedlabel + \group all-examples + \title Elided Label Example + + \brief The Elided Label example creates a widget similar to QLabel, that elides the last + visible line, if the text is too long to fit the widget's geometry. + + \image elidedlabel-example.png Elided Label example on XPressMusic 5800 + + When text of varying length has to be displayed in a uniformly sized + area, for instance within a list or grid view where all list items have the + same size, it can be useful to give the user a visual clue when not all + text is visible. QLabel can elide text that doesn't fit within it, but only + in one line. The \c ElidedLabel widget shown in this example word wraps its + text by its width, and elides the last visible line if some text is left + out. \c TestWidget gives control to the features of \c ElidedWidget and + forms the example application. + + + \section1 ElidedLabel Class Definition + + Like QLabel, \c ElidedLabel inherits from QFrame. Here's the definition of + the \c ElidedLabel class: + + + \snippet examples/widgets/elidedlabel/elidedlabel.h 0 + + The \c isElided property depends the font, text content and geometry of the + widget. Whenever any of these change, the \c elisionChanged() signal might + trigger. We cache the current elision value in \c elided, so that it + doesn't have to be recomputed every time it's asked for. + + + \section1 ElidedLabel Class Implementation + + Except for initializing the member variables, the constructor sets the size + policy to be horizontally expanding, since it's meant to fill the width of + its container and grow vertically. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 0 + + Changing the \c content require a repaint of the widget. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 1 + + QTextLayout is used in the \c paintEvent() to divide the \c content into + lines, that wrap on word boundaries. Each line, except the last visible + one, is drawn \c lineSpacing pixels below the previous one. The \c draw() + method of QTextLine will draw the line using the coordinate point as the + top left corner. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 2 + + Unfortunately, QTextLayout does not elide text, so the last visible line + has to be treated differently. This last line is elided if it is too wide. + The \c drawText() method of QPainter draws the text starting from the base + line, which is \c ascecnt() pixels below the last drawn line. + + Finally, one more line is created to see if everything fit on this line. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 3 + + If the text was elided and wasn't before or vice versa, cache it in + \c elided and emit the change. + + \snippet examples/widgets/elidedlabel/elidedlabel.cpp 4 + + + \section1 TestWidget Class Definition + + \c TestWidget is a QWidget and is the main window of the example. It + contains an \c ElidedLabel which can be resized with two QSlider widgets. + + \snippet examples/widgets/elidedlabel/testwidget.h 0 + + \section1 TestWidget Class Implementation + + The constructor initializes the whole widget. Strings of different length + are stored in \c textSamples. The user is able to switch between these. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 0 + + An \c ElidedLabel is created to contain the first of the sample strings. + The frame is made visible to make it easier to see the actual size of the + widget. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 1 + + The buttons and the elision label are created. By connecting the + \c elisionChanged() signal to the \c setVisible() slot of the \c label, + it will act as an indicator to when the text is elided or not. This signal + could, for instance, be used to make a "More" button visible, or similar. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 2 + + The \c widthSlider and \c heightSlider specify the size of the + \c elidedText. Since the y-axis is inverted, the \c heightSlider has to be + inverted to act appropriately. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 3 + + The components are all stored in a QGridLayout, which is made the layout of + the \c TestWidget. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 4 + + On the Maemo platform, windows are stuck in landscape mode by default. With + this attribute set, the window manager is aware that this window can be + rotated. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 5 + + The \c widthSlider and \c heightSlider have the exact same length as the + dimensions of the \c elidedText. The maximum value for both of them is + thus their lengths, and each tick indicates one pixel. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 6 + + The \c switchText() slot simply cycles through all the available sample + texts. + + \snippet examples/widgets/elidedlabel/testwidget.cpp 7 + + These slots set the width and height of the \c elided text, in response to + changes in the sliders. + + \section1 The \c main() Function + + The \c main() function creates an instance of \c TestWidget fullscreen and + enters the message loop. + + \snippet examples/widgets/elidedlabel/main.cpp 0 +*/ + diff --git a/doc/src/examples/eventtransitions.qdoc b/doc/src/examples/eventtransitions.qdoc index c66e9c1..bc0503c 100644 --- a/doc/src/examples/eventtransitions.qdoc +++ b/doc/src/examples/eventtransitions.qdoc @@ -29,7 +29,7 @@ \example statemachine/eventtransitions \title Event Transitions Example - The Event Transitions example shows how to use event transitions, a + \brief The Event Transitions example shows how to use event transitions, a feature of \l{The State Machine Framework}. \snippet examples/statemachine/eventtransitions/main.cpp 0 diff --git a/doc/src/examples/extension.qdoc b/doc/src/examples/extension.qdoc index 41fddbb..69604ba 100644 --- a/doc/src/examples/extension.qdoc +++ b/doc/src/examples/extension.qdoc @@ -29,7 +29,7 @@ \example dialogs/extension \title Extension Example - The Extension example shows how to add an extension to a QDialog + \brief The Extension example shows how to add an extension to a QDialog using the QAbstractButton::toggled() signal and the QWidget::setVisible() slot. diff --git a/doc/src/examples/factorial.qdoc b/doc/src/examples/factorial.qdoc index a317189..483cd46 100644 --- a/doc/src/examples/factorial.qdoc +++ b/doc/src/examples/factorial.qdoc @@ -29,7 +29,7 @@ \example statemachine/factorial \title Factorial States Example - The Factorial States example shows how to use \l{The State Machine + \brief The Factorial States example shows how to use \l{The State Machine Framework} to calculate the factorial of an integer. The statechart for calculating the factorial looks as follows: diff --git a/doc/src/examples/fademessage.qdoc b/doc/src/examples/fademessage.qdoc index 7e07324..5abc19a 100644 --- a/doc/src/examples/fademessage.qdoc +++ b/doc/src/examples/fademessage.qdoc @@ -29,9 +29,8 @@ \example effects/fademessage \title Fade Message Effect Example - \div { style="text-align: center"} - \inlineimage fademessageeffect-example.png - \inlineimage fademessageeffect-example-faded.png - \enddiv - + \brief The Fade Message Example shows the QGraphicsColorizeEffect in action. + + \image fademessageeffect-example.png + \image fademessageeffect-example-faded.png */ diff --git a/doc/src/examples/fancybrowser.qdoc b/doc/src/examples/fancybrowser.qdoc index 327dfbd..8cae77e 100644 --- a/doc/src/examples/fancybrowser.qdoc +++ b/doc/src/examples/fancybrowser.qdoc @@ -29,7 +29,7 @@ \example webkit/fancybrowser \title Fancy Browser Example - The Fancy Browser example shows how to use jQuery with QtWebKit to + \brief The Fancy Browser example shows how to use jQuery with QtWebKit to create a web browser with special effects and content manipulation. diff --git a/doc/src/examples/fetchmore.qdoc b/doc/src/examples/fetchmore.qdoc index 9e64b0a..8774543 100644 --- a/doc/src/examples/fetchmore.qdoc +++ b/doc/src/examples/fetchmore.qdoc @@ -29,7 +29,7 @@ \example itemviews/fetchmore \title Fetch More Example - The Fetch More example shows how two add items to an item view + \brief The Fetch More example shows how two add items to an item view model on demand. \image fetchmore-example.png diff --git a/doc/src/examples/filetree.qdoc b/doc/src/examples/filetree.qdoc index ae691d8..5b1019a 100644 --- a/doc/src/examples/filetree.qdoc +++ b/doc/src/examples/filetree.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/filetree \title File System Example - This example shows how to use QtXmlPatterns for querying non-XML + \brief The File Tree example shows how to use QtXmlPatterns for querying non-XML data that is modeled to look like XML. \tableofcontents diff --git a/doc/src/examples/findfiles.qdoc b/doc/src/examples/findfiles.qdoc index 026d61f..df591b6 100644 --- a/doc/src/examples/findfiles.qdoc +++ b/doc/src/examples/findfiles.qdoc @@ -29,8 +29,10 @@ \example dialogs/findfiles \title Find Files Example - The Find Files example shows how to use QProgressDialog to provide - feedback on the progress of a slow operation. The example also + \brief The Find Files example shows how to use QProgressDialog to provide + feedback on the progress of a slow operation. + + The example also shows how to use QFileDialog to facilitate browsing, how to use QTextStream's streaming operators to read a file, and how to use QTableWidget to provide standard table display facilities for diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc index 5aef64c..659784c 100644 --- a/doc/src/examples/fingerpaint.qdoc +++ b/doc/src/examples/fingerpaint.qdoc @@ -29,8 +29,12 @@ \example touch/fingerpaint \title Finger Paint Example - The Finger Paint example shows the use of touch with a custom widget + \brief The Finger Paint example shows the use of a touchscreen with a custom widget to create a simple painting application. \image touch-fingerpaint-example.png + + This example was specifically designed to work with a touchscreen, using + QTouchEvent instead of QMouseEvent to handle user input over the custom + widget. As a result, it is not possible to draw with the mouse cursor. */ diff --git a/doc/src/examples/flowlayout.qdoc b/doc/src/examples/flowlayout.qdoc index 194a733..7b35b67 100644 --- a/doc/src/examples/flowlayout.qdoc +++ b/doc/src/examples/flowlayout.qdoc @@ -29,7 +29,7 @@ \example layouts/flowlayout \title Flow Layout Example - The Flow Layout example demonstrates a custom layout that arranges child + \brief The Flow Layout example demonstrates a custom layout that arranges child widgets from left to right and top to bottom in a top-level widget. \image flowlayout-example.png Screenshot of the Flow Layout example diff --git a/doc/src/examples/fontsampler.qdoc b/doc/src/examples/fontsampler.qdoc index b3caa9f..6ebeab9 100644 --- a/doc/src/examples/fontsampler.qdoc +++ b/doc/src/examples/fontsampler.qdoc @@ -29,7 +29,7 @@ \example painting/fontsampler \title Font Sampler Example - The Font Sampler example shows how to preview and print multi-page documents. + \brief The Font Sampler example shows how to preview and print multi-page documents. \image fontsampler-example.png */ diff --git a/doc/src/examples/formextractor.qdoc b/doc/src/examples/formextractor.qdoc index 79f6d19..de050c5 100644 --- a/doc/src/examples/formextractor.qdoc +++ b/doc/src/examples/formextractor.qdoc @@ -29,7 +29,7 @@ \example webkit/formextractor \title Form Extractor Example - The Form Extractor example shows how to use QWebFrame with JavaScript to + \brief The Form Extractor example shows how to use QWebFrame with JavaScript to extract form data. \image formextractor-example.png diff --git a/doc/src/examples/fortuneclient.qdoc b/doc/src/examples/fortuneclient.qdoc index 0c74143..7837ee2 100644 --- a/doc/src/examples/fortuneclient.qdoc +++ b/doc/src/examples/fortuneclient.qdoc @@ -29,8 +29,10 @@ \example network/fortuneclient \title Fortune Client Example - The Fortune Client example shows how to create a client for a simple - network service using QTcpSocket. It is intended to be run alongside the + \brief The Fortune Client example shows how to create a client for a simple + network service using QTcpSocket. + + The example is intended to be run alongside the \l{network/fortuneserver}{Fortune Server} example or the \l{network/threadedfortuneserver}{Threaded Fortune Server} example. diff --git a/doc/src/examples/fortuneserver.qdoc b/doc/src/examples/fortuneserver.qdoc index 2fb7f25..5042479 100644 --- a/doc/src/examples/fortuneserver.qdoc +++ b/doc/src/examples/fortuneserver.qdoc @@ -29,8 +29,10 @@ \example network/fortuneserver \title Fortune Server Example - The Fortune Server example shows how to create a server for a simple - network service. It is intended to be run alongside the + \brief The Fortune Server example shows how to create a server for a simple + network service. + + The example is intended to be run alongside the \l{network/fortuneclient}{Fortune Client} example or the \l{network/blockingfortuneclient}{Blocking Fortune Client} example. diff --git a/doc/src/examples/framebufferobject.qdoc b/doc/src/examples/framebufferobject.qdoc index 12b1d5f..539b751 100644 --- a/doc/src/examples/framebufferobject.qdoc +++ b/doc/src/examples/framebufferobject.qdoc @@ -29,7 +29,7 @@ \example opengl/framebufferobject \title Framebuffer Object Example - The Framebuffer Object example demonstrates how to use the + \brief The Framebuffer Object example demonstrates how to use the QGLFramebufferObject class to render into an off-screen buffer and use the contents as a texture in a QGLWidget. diff --git a/doc/src/examples/framebufferobject2.qdoc b/doc/src/examples/framebufferobject2.qdoc index cbe8f3f..b77b495 100644 --- a/doc/src/examples/framebufferobject2.qdoc +++ b/doc/src/examples/framebufferobject2.qdoc @@ -29,7 +29,7 @@ \example opengl/framebufferobject2 \title Framebuffer Object 2 Example - The Framebuffer Object 2 example demonstrates how to use the + \brief The Framebuffer Object 2 example demonstrates how to use the QGLFramebufferObject class to render into an off-screen buffer and use the contents as a texture in a QGLWidget. diff --git a/doc/src/examples/fridgemagnets.qdoc b/doc/src/examples/fridgemagnets.qdoc index 8490801..689ed1f 100644 --- a/doc/src/examples/fridgemagnets.qdoc +++ b/doc/src/examples/fridgemagnets.qdoc @@ -29,7 +29,7 @@ \example draganddrop/fridgemagnets \title Fridge Magnets Example - The Fridge Magnets example shows how to supply more than one type + \brief The Fridge Magnets example shows how to supply more than one type of MIME-encoded data with a drag and drop operation. \image fridgemagnets-example.png diff --git a/doc/src/examples/frozencolumn.qdoc b/doc/src/examples/frozencolumn.qdoc index a21926b..9d0d938 100644 --- a/doc/src/examples/frozencolumn.qdoc +++ b/doc/src/examples/frozencolumn.qdoc @@ -29,7 +29,7 @@ \example itemviews/frozencolumn \title Frozen Column Example - This example demonstrates how to freeze a column within a QTableView. + \brief The Frozen Column example demonstrates how to freeze a column within a QTableView. \image frozencolumn-example.png "Screenshot of the example" diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index f0d64ef..57796f8 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -29,7 +29,7 @@ \example network/qftp \title FTP Example - The FTP example demonstrates a simple FTP client that can be used + \brief The FTP example demonstrates a simple FTP client that can be used to list the available files on an FTP server and download them. \image ftp-example.png diff --git a/doc/src/examples/globalVariables.qdoc b/doc/src/examples/globalVariables.qdoc index 70147d2..b03440d 100644 --- a/doc/src/examples/globalVariables.qdoc +++ b/doc/src/examples/globalVariables.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/xquery/globalVariables \title C++ Source Code Analyzer Example - This example uses XQuery and the \c xmlpatterns command line utility to + \brief The Global Variables example uses XQuery and the \c xmlpatterns command line utility to query C++ source code. \tableofcontents diff --git a/doc/src/examples/googlechat.qdoc b/doc/src/examples/googlechat.qdoc index e9118f1..34dbbf6 100644 --- a/doc/src/examples/googlechat.qdoc +++ b/doc/src/examples/googlechat.qdoc @@ -29,7 +29,7 @@ \example webkit/googlechat \title Google Chat Example - The Google Chat example shows how to use implement a simple Google Chat + \brief The Google Chat example shows how to use implement a simple Google Chat client with QtWebKit. \image googlechat-example.png diff --git a/doc/src/examples/googlesuggest.qdoc b/doc/src/examples/googlesuggest.qdoc index 743a624..8e5c1ca 100644 --- a/doc/src/examples/googlesuggest.qdoc +++ b/doc/src/examples/googlesuggest.qdoc @@ -29,7 +29,7 @@ \example network/googlesuggest \title Google Suggest Example - The Google Suggest example demonstrates how to use the QNetworkAccessManager + \brief The Google Suggest example demonstrates how to use the QNetworkAccessManager class to obtain a list of suggestions from the Google search engine as the user types into a QLineEdit. diff --git a/doc/src/examples/grabber.qdoc b/doc/src/examples/grabber.qdoc index 4b65848..27a89b9 100644 --- a/doc/src/examples/grabber.qdoc +++ b/doc/src/examples/grabber.qdoc @@ -29,7 +29,7 @@ \example opengl/grabber \title Grabber Example - The Grabber examples shows how to retrieve the contents of an OpenGL framebuffer. + \brief The Grabber examples shows how to retrieve the contents of an OpenGL framebuffer. \image grabber-example.png */ diff --git a/doc/src/examples/graphicsview-anchorlayout.qdoc b/doc/src/examples/graphicsview-anchorlayout.qdoc index 156cdb4..68c144a 100644 --- a/doc/src/examples/graphicsview-anchorlayout.qdoc +++ b/doc/src/examples/graphicsview-anchorlayout.qdoc @@ -29,6 +29,6 @@ \example graphicsview/anchorlayout \title Anchor Layout Example - The Anchor Layout example demonstrates the use of the QGraphicsAnchorLayout + \brief The Anchor Layout example demonstrates the use of the QGraphicsAnchorLayout class. */ diff --git a/doc/src/examples/graphicsview-flowlayout.qdoc b/doc/src/examples/graphicsview-flowlayout.qdoc index b0c04b8..42ea65f 100644 --- a/doc/src/examples/graphicsview-flowlayout.qdoc +++ b/doc/src/examples/graphicsview-flowlayout.qdoc @@ -29,7 +29,7 @@ \example graphicsview/flowlayout \title Graphics View Flow Layout Example - The Graphics View Flow Layout example shows the use of a flow layout + \brief The Graphics View Flow Layout example shows the use of a flow layout in a Graphics View widget. See the \l{Flow Layout Example} for a corresponding widget-based example. diff --git a/doc/src/examples/graphicsview-simpleanchorlayout.qdoc b/doc/src/examples/graphicsview-simpleanchorlayout.qdoc index 6f6ba5b..603ea50 100644 --- a/doc/src/examples/graphicsview-simpleanchorlayout.qdoc +++ b/doc/src/examples/graphicsview-simpleanchorlayout.qdoc @@ -29,6 +29,6 @@ \example graphicsview/simpleanchorlayout \title Simple Anchor Layout Example - The Simple Anchor Layout example shows the basic use of the + \brief The Simple Anchor Layout example shows the basic use of the QGraphicsAnchorLayout class. */ diff --git a/doc/src/examples/graphicsview-weatheranchorlayout.qdoc b/doc/src/examples/graphicsview-weatheranchorlayout.qdoc index 20173af..da2ee76 100644 --- a/doc/src/examples/graphicsview-weatheranchorlayout.qdoc +++ b/doc/src/examples/graphicsview-weatheranchorlayout.qdoc @@ -29,6 +29,6 @@ \example graphicsview/weatheranchorlayout \title Weather Anchor Layout Example - The Weather Anchor Layout example shows more complex use of the + \brief The Weather Anchor Layout example shows more complex use of the QGraphicsAnchorLayout class to create a real-world window layout. */ diff --git a/doc/src/examples/groupbox.qdoc b/doc/src/examples/groupbox.qdoc index a042437..02e8a9c 100644 --- a/doc/src/examples/groupbox.qdoc +++ b/doc/src/examples/groupbox.qdoc @@ -29,7 +29,7 @@ \example widgets/groupbox \title Group Box Example - The Group Box example shows how to use the different kinds of group + \brief The Group Box example shows how to use the different kinds of group boxes in Qt. Group boxes are container widgets that organize buttons into groups, diff --git a/doc/src/examples/hellogl.qdoc b/doc/src/examples/hellogl.qdoc index dbd672e..641a777 100644 --- a/doc/src/examples/hellogl.qdoc +++ b/doc/src/examples/hellogl.qdoc @@ -29,7 +29,7 @@ \example opengl/hellogl \title Hello GL Example - The Hello GL example demonstrates the basic use of the OpenGL-related classes + \brief The Hello GL example demonstrates the basic use of the OpenGL-related classes provided with Qt. \image hellogl-example.png diff --git a/doc/src/examples/hellogl_es.qdoc b/doc/src/examples/hellogl_es.qdoc index fdc7ab5..d57bb1d 100644 --- a/doc/src/examples/hellogl_es.qdoc +++ b/doc/src/examples/hellogl_es.qdoc @@ -29,7 +29,7 @@ \example opengl/hellogl_es \title Hello GL ES Example - The Hello GL ES example is the \l{Hello GL Example} ported to OpenGL ES. + \brief The Hello GL ES example is the \l{Hello GL Example} ported to OpenGL ES. It also included some effects from the OpenGL \l{Overpainting Example}. \image hellogl-es-example.png diff --git a/doc/src/examples/helloscript.qdoc b/doc/src/examples/helloscript.qdoc index 1c6ea85..745a327 100644 --- a/doc/src/examples/helloscript.qdoc +++ b/doc/src/examples/helloscript.qdoc @@ -29,9 +29,11 @@ \example script/helloscript \title Hello Script Example - The Hello Script example shows the basic use of Qt Script: How to embed + \brief The Hello Script example shows the basic use of Qt Script: How to embed a script engine into the application, how to evaluate a script, and how - to process the result of the evaluation. The example also shows how to + to process the result of the evaluation. + + The example also shows how to apply internationalization to scripts. \snippet examples/script/helloscript/main.cpp 0 diff --git a/doc/src/examples/hellotr.qdoc b/doc/src/examples/hellotr.qdoc index 4b7c4b7..c85a2ad 100644 --- a/doc/src/examples/hellotr.qdoc +++ b/doc/src/examples/hellotr.qdoc @@ -29,8 +29,9 @@ \example linguist/hellotr \title Hello tr() Example - This example is a small Hello World program with a Latin translation. The - screenshot below shows the English version. + \brief The Hello tr() example is a small Hello World program with a Latin translation. + + The screenshot below shows the English version. \image linguist-hellotr_en.png diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc index 23365f1..e21e8b0 100644 --- a/doc/src/examples/htmlinfo.qdoc +++ b/doc/src/examples/htmlinfo.qdoc @@ -29,7 +29,7 @@ \example xml/htmlinfo \title XML HTML Info Example - The XML HTML Info example provides a simple command line utility that + \brief The XML HTML Info example provides a simple command line utility that scans the current directory for HTML files and prints statistics about them to standard out. diff --git a/doc/src/examples/http.qdoc b/doc/src/examples/http.qdoc index ab03683..4704be0 100644 --- a/doc/src/examples/http.qdoc +++ b/doc/src/examples/http.qdoc @@ -29,7 +29,7 @@ \example network/http \title HTTP Example - The HTTP example demonstrates a simple HTTP client that shows how to fetch files + \brief The HTTP example demonstrates a simple HTTP client that shows how to fetch files specified by URLs from remote hosts. \image http-example.png diff --git a/doc/src/examples/i18n.qdoc b/doc/src/examples/i18n.qdoc index 2ce47e1..392d2e2 100644 --- a/doc/src/examples/i18n.qdoc +++ b/doc/src/examples/i18n.qdoc @@ -29,8 +29,10 @@ \example tools/i18n \title I18N Example - The Internationalization (I18N) example demonstrates Qt's support for translated - text. Developers can write the initial application text in one language, and + \brief The Internationalization (I18N) example demonstrates Qt's support for translated + text. + + Developers can write the initial application text in one language, and translations can be provided later without any modifications to the code. \image i18n-example.png diff --git a/doc/src/examples/icons.qdoc b/doc/src/examples/icons.qdoc index 82ff994..3fa9952 100644 --- a/doc/src/examples/icons.qdoc +++ b/doc/src/examples/icons.qdoc @@ -29,8 +29,10 @@ \example widgets/icons \title Icons Example - The Icons example shows how QIcon can generate pixmaps reflecting - an icon's state, mode and size. These pixmaps are generated from + \brief The Icons example shows how QIcon can generate pixmaps reflecting + an icon's state, mode and size. + + These pixmaps are generated from the set of pixmaps made available to the icon, and are used by Qt widgets to show an icon representing a particular action. diff --git a/doc/src/examples/imagecomposition.qdoc b/doc/src/examples/imagecomposition.qdoc index cd08de4..8b95ded 100644 --- a/doc/src/examples/imagecomposition.qdoc +++ b/doc/src/examples/imagecomposition.qdoc @@ -29,7 +29,7 @@ \example painting/imagecomposition \title Image Composition Example - The Image Composition example lets the user combine images + \brief The Image Composition example lets the user combine images together using any composition mode supported by QPainter, described in detail in \l{QPainter#Composition Modes}{Composition Modes}. diff --git a/doc/src/examples/imagegestures.qdoc b/doc/src/examples/imagegestures.qdoc index 24a1276..2a8a282 100644 --- a/doc/src/examples/imagegestures.qdoc +++ b/doc/src/examples/imagegestures.qdoc @@ -29,7 +29,7 @@ \example gestures/imagegestures \title Image Gestures Example - This example shows how to enable gestures for a widget and use gesture input + \brief The Image Gestures example shows how to enable gestures for a widget and use gesture input to perform actions. We use two classes to create the user interface for the application: \c MainWidget diff --git a/doc/src/examples/imageviewer.qdoc b/doc/src/examples/imageviewer.qdoc index 49b3111..e915ef8 100644 --- a/doc/src/examples/imageviewer.qdoc +++ b/doc/src/examples/imageviewer.qdoc @@ -29,8 +29,10 @@ \example widgets/imageviewer \title Image Viewer Example - The example shows how to combine QLabel and QScrollArea to - display an image. QLabel is typically used for displaying text, + \brief The Image Viewer example shows how to combine QLabel and QScrollArea to + display an image. + + QLabel is typically used for displaying text, but it can also display an image. QScrollArea provides a scrolling view around another widget. If the child widget exceeds the size of the frame, QScrollArea automatically provides scroll diff --git a/doc/src/examples/inputpanel.qdoc b/doc/src/examples/inputpanel.qdoc index 54920f0..f001aee 100644 --- a/doc/src/examples/inputpanel.qdoc +++ b/doc/src/examples/inputpanel.qdoc @@ -29,7 +29,7 @@ \example tools/inputpanel \title Input Panel Example - The Input Panel example shows how to create an input panel that + \brief The Input Panel example shows how to create an input panel that can be used to input text into widgets using only the pointer and no keyboard. diff --git a/doc/src/examples/itemviewspuzzle.qdoc b/doc/src/examples/itemviewspuzzle.qdoc index 72e543b..22826ec 100644 --- a/doc/src/examples/itemviewspuzzle.qdoc +++ b/doc/src/examples/itemviewspuzzle.qdoc @@ -29,7 +29,7 @@ \example itemviews/puzzle \title Item Views Puzzle Example - The Puzzle example shows how to enable drag and drop with a custom model + \brief The Puzzle example shows how to enable drag and drop with a custom model to allow items to be transferred between a view and another widget. \image itemviewspuzzle-example.png diff --git a/doc/src/examples/licensewizard.qdoc b/doc/src/examples/licensewizard.qdoc index a58e029..e46ea32 100644 --- a/doc/src/examples/licensewizard.qdoc +++ b/doc/src/examples/licensewizard.qdoc @@ -29,7 +29,7 @@ \example dialogs/licensewizard \title License Wizard Example - The License Wizard example shows how to implement complex wizards in + \brief The License Wizard example shows how to implement complex wizards in Qt. \image licensewizard-example.png Screenshot of the License Wizard example diff --git a/doc/src/examples/lighting.qdoc b/doc/src/examples/lighting.qdoc index 815a42a..05c1e79 100644 --- a/doc/src/examples/lighting.qdoc +++ b/doc/src/examples/lighting.qdoc @@ -29,5 +29,7 @@ \example effects/lighting \title Lighting Effect Example + \brief The Lighting Effect Example shows the QGraphicsDropShadowEffect in action. + \image lightingeffect-example.png */ diff --git a/doc/src/examples/lineedits.qdoc b/doc/src/examples/lineedits.qdoc index 03b4f27..c187dfd 100644 --- a/doc/src/examples/lineedits.qdoc +++ b/doc/src/examples/lineedits.qdoc @@ -29,7 +29,7 @@ \example widgets/lineedits \title Line Edits Example - The Line Edits example demonstrates the many ways that QLineEdit can be used, and + \brief The Line Edits example demonstrates the many ways that QLineEdit can be used, and shows the effects of various properties and validators on the input and output supplied by the user. diff --git a/doc/src/examples/localfortuneclient.qdoc b/doc/src/examples/localfortuneclient.qdoc index 56ead19..b7ea65a 100644 --- a/doc/src/examples/localfortuneclient.qdoc +++ b/doc/src/examples/localfortuneclient.qdoc @@ -29,8 +29,10 @@ \example ipc/localfortuneclient \title Local Fortune Client Example - The Local Fortune Client example shows how to create a client for a simple - local service using QLocalSocket. It is intended to be run alongside the + \brief The Local Fortune Client example shows how to create a client for a simple + local service using QLocalSocket. + + The example is intended to be run alongside the \l{ipc/localfortuneserver}{Local Fortune Server} example. \image localfortuneclient-example.png Screenshot of the Local Fortune Client example diff --git a/doc/src/examples/localfortuneserver.qdoc b/doc/src/examples/localfortuneserver.qdoc index 7a26ff8..21c5feb 100644 --- a/doc/src/examples/localfortuneserver.qdoc +++ b/doc/src/examples/localfortuneserver.qdoc @@ -29,8 +29,10 @@ \example ipc/localfortuneserver \title Local Fortune Server Example - The Local Fortune Server example shows how to create a server for a simple - local service. It is intended to be run alongside the + \brief The Local Fortune Server example shows how to create a server for a simple + local service. + + The example is intended to be run alongside the \l{ipc/localfortuneclient}{Local Fortune Client} example \image localfortuneserver-example.png Screenshot of the Local Fortune Server example diff --git a/doc/src/examples/loopback.qdoc b/doc/src/examples/loopback.qdoc index a5d810a..9e87ace 100644 --- a/doc/src/examples/loopback.qdoc +++ b/doc/src/examples/loopback.qdoc @@ -29,7 +29,7 @@ \example network/loopback \title Loopback Example - The Loopback example shows how to communicate between simple clients and servers on a local + \brief The Loopback example shows how to communicate between simple clients and servers on a local host. \image loopback-example.png diff --git a/doc/src/examples/maemovibration.qdoc b/doc/src/examples/maemovibration.qdoc new file mode 100644 index 0000000..58a8837 --- /dev/null +++ b/doc/src/examples/maemovibration.qdoc @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example widgets/maemovibration + \group all-examples + \title Maemo Vibration Example + + \brief The Maemo Vibration example shows how to tell the Maemo Mode Control Entity + (MCE) to vibrate a maemo device. + + The MCE is a system service on Maemo that, among other things, provides an + D-Bus interface to trigger vibrations. The vibrations are specified as + patterns and are defined in a system configuration file. + + The example program reads the configuration file to look for possible + vibration patterns and display a button for each. Pressing a button will + make the device vibrate accordingly, until the application closes, or + another pattern is started. + + \image maemovibration-example.png Screenshot of the Maemo Vibration Example + + The code makes use of two classes: + + \list + \o \c MceVibrator connects to the MCE service and can start a certain + vibrator pattern. It also is responsible to parse the configuration + file. + + \o \c ButtonWidget provides a button for each pattern. Pressing the button + activates the pattern in question. + \endlist + + + \section1 MceVibrator Class Definition + + \snippet examples/widgets/maemovibration/mcevibrator.h 0 + + The \c MceVibrator class inherits from QObject and provides a specialized + and Qt friendly interface to the MCE vibration facilty. The slot \c vibrate() + can be called to make the device vibrate according to a specific pattern + name. We will connect it to a signal of a \c ButtonWidget object later. The + static method \c ParsePatternNames() can be called to find out which patterns + are available to us. + + \list + \o \c mceInterface is our D-Bus handle to the MCE service. We use it to + invoke methods on the MCE request object. + + \o \c lastPatternName contains the pattern that was activated last time. We + have to keep track of this, because the last pattern has to be + deactivated before activating a new pattern. + \endlist + + + \section1 MceVibrator Class Implementation + + To connect to the service, we initialize the D-Bus interface handle. The + system header \c "mce/dbus-names.h" contains definitions of the D-Bus + service name and request object path and interface. These are passed to the + constructor of the handle, and Qt will automatically establish a connection + to it, if it is possible. + + The MCE expects us to first enable the vibrator before we can use it. This + is done with the call to the \c MCE_ENABLE_VIBRATOR D-Bus method. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 0 + + From now on we can activate vibration patterns. Each time a vibration + pattern is activated, the last pattern has to be deactivated first. In the + vibrate slot we use the MCE interface to call the activation method. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 1 + + The calls to the private method deactivate simply makes sure to deactivate + the last pattern used, if there was one. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 2 + + Calling either the activate or deactivate MCE D-Bus method with invalid + pattern names are ignored. + + Finally, the destructor disables the vibrator. When the destructor of the + MCE interface handle is called, the connection is also closed. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 3 + + The MCE configuration file contains options for many different things. We + are only interested in one line that contains the vibration patterns. It + has the following format: + + + \code + VibratorPatterns=semicolon;separated;list;of;values + \endcode + + The static method \c ParsePatternNames looks for this line and returns a + QStringList containing the values, which are the pattern names we can use. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 4 + + The helper function \c checkError() saves us some code duplication. None of the + called methods return anything of use to us, so we're only interested in + getting error messages for debugging. + + \snippet examples/widgets/maemovibration/mcevibrator.cpp 5 + + + \section1 ButtonWidget Class Definition + + \snippet examples/widgets/maemovibration/buttonwidget.h 0 + + The \c ButtonWidget class inherits from QWidget and provides the main user + interface for the application. It creates a grid of buttons, one for each + string in the stringlist passed to the constructor. Pressing a button emits + the \c clicked() signal, where the string is the text of the button that + was pressed. + + This class is taken from the QSignalMapper documentation. The only change + is the number of columns in the grid from three to two, to make the button + labels fit. + + + \section1 ButtonWidget Class Implementation + + \snippet examples/widgets/maemovibration/buttonwidget.cpp 0 + + + \section1 \c main() Function + + The main function begins with looking up the patterns available to us. + + \snippet examples/widgets/maemovibration/main.cpp 0 + + Then we create one instance of both classes, and connects the + \c ButtonWidget's clicked signal to the \c MceVibrator's \c vibrate() slot. + This works, since the button texts are the same as the pattern names. + + \snippet examples/widgets/maemovibration/main.cpp 1 +*/ diff --git a/doc/src/examples/mandelbrot.qdoc b/doc/src/examples/mandelbrot.qdoc index eb53e95..3e516e9 100644 --- a/doc/src/examples/mandelbrot.qdoc +++ b/doc/src/examples/mandelbrot.qdoc @@ -29,7 +29,7 @@ \example threads/mandelbrot \title Mandelbrot Example - The Mandelbrot example shows how to use a worker thread to + \brief The Mandelbrot example shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop. diff --git a/doc/src/examples/masterdetail.qdoc b/doc/src/examples/masterdetail.qdoc index 16ddb3e..06bf228 100644 --- a/doc/src/examples/masterdetail.qdoc +++ b/doc/src/examples/masterdetail.qdoc @@ -29,8 +29,10 @@ \example sql/masterdetail \title Master Detail Example - The Master Detail Example shows how to present data from different - data sources in the same application. The album titles, and the + \brief The Master Detail Example shows how to present data from different + data sources in the same application. + + The album titles, and the corresponding artists and release dates, are kept in a database, while each album's tracks are stored in an XML file. diff --git a/doc/src/examples/mdi.qdoc b/doc/src/examples/mdi.qdoc index 4f64fa1..317a251 100644 --- a/doc/src/examples/mdi.qdoc +++ b/doc/src/examples/mdi.qdoc @@ -29,7 +29,7 @@ \example mainwindows/mdi \title MDI Example - The MDI example shows how to implement a Multiple Document Interface using Qt's + \brief The MDI example shows how to implement a Multiple Document Interface using Qt's QMdiArea class. \image mdi-example.png diff --git a/doc/src/examples/menus.qdoc b/doc/src/examples/menus.qdoc index 0a31ca8..f42aa64 100644 --- a/doc/src/examples/menus.qdoc +++ b/doc/src/examples/menus.qdoc @@ -29,7 +29,7 @@ \example mainwindows/menus \title Menus Example - The Menus example demonstrates how menus can be used in a main + \brief The Menus example demonstrates how menus can be used in a main window application. A menu widget can be either a pull-down menu in a menu bar or a diff --git a/doc/src/examples/mousecalibration.qdoc b/doc/src/examples/mousecalibration.qdoc index 590153b..b2f7939 100644 --- a/doc/src/examples/mousecalibration.qdoc +++ b/doc/src/examples/mousecalibration.qdoc @@ -29,7 +29,7 @@ \example qws/mousecalibration \title Mouse Calibration Example - The Mouse Calibration example demonstrates how to write a simple + \brief The Mouse Calibration example demonstrates how to write a simple program using the mechanisms provided by the QWSMouseHandler class to calibrate the mouse handler in \l{Qt for Embedded Linux}. diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc index e5ce3be..5acaa47 100644 --- a/doc/src/examples/moveblocks.qdoc +++ b/doc/src/examples/moveblocks.qdoc @@ -29,7 +29,7 @@ \example animation/moveblocks \title Move Blocks Example - The Move Blocks example shows how to animate items in a + \brief The Move Blocks example shows how to animate items in a QGraphicsScene using a QStateMachine with a custom transition. \image moveblocks-example.png diff --git a/doc/src/examples/movie.qdoc b/doc/src/examples/movie.qdoc index bd5726c..4f31674 100644 --- a/doc/src/examples/movie.qdoc +++ b/doc/src/examples/movie.qdoc @@ -29,8 +29,10 @@ \example widgets/movie \title Movie Example - The Movie example demonstrates how to use QMovie and QLabel to - display animations. Now that Qt comes with the \l{Phonon multimedia + \brief The Movie example demonstrates how to use QMovie and QLabel to + display animations. + + Now that Qt comes with the \l{Phonon multimedia framework} {Phonon multimedia framework}, QMovie is mostly useful if one wants to play a simple animation without the added complexity of a multimedia framework to install and deploy. diff --git a/doc/src/examples/multicastreceiver.qdoc b/doc/src/examples/multicastreceiver.qdoc new file mode 100644 index 0000000..96a011f --- /dev/null +++ b/doc/src/examples/multicastreceiver.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/multicastreceiver + \title Multicast Receiver Example + + \brief The Multicast Receiever example shows how to receive information that is + sent to a multicast group. + + \image multicastreceiver-example.png +*/ diff --git a/doc/src/examples/multicastsender.qdoc b/doc/src/examples/multicastsender.qdoc new file mode 100644 index 0000000..c5b7531 --- /dev/null +++ b/doc/src/examples/multicastsender.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/multicastsender + \title Multicast Sender Example + + \brief The Multicast Sender example shows how to send information to multiple + clients in a multicast group. + + \image multicastsender-example.png +*/ diff --git a/doc/src/examples/multipleinheritance.qdoc b/doc/src/examples/multipleinheritance.qdoc index fa125f0..9c86950 100644 --- a/doc/src/examples/multipleinheritance.qdoc +++ b/doc/src/examples/multipleinheritance.qdoc @@ -29,7 +29,7 @@ \example uitools/multipleinheritance \title Multiple Inheritance Example - The Multiple Inheritance Example shows how to use a form created with \QD + \brief The Multiple Inheritance Example shows how to use a form created with \QD in an application by subclassing both QWidget and the user interface class, which is \c{Ui::CalculatorForm}. diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc index 7cba674..13a7bba 100644 --- a/doc/src/examples/musicplayerexample.qdoc +++ b/doc/src/examples/musicplayerexample.qdoc @@ -29,8 +29,9 @@ \example phonon/qmusicplayer \title Music Player Example - The Music Player Example shows how to use Phonon - the multimedia + \brief The Music Player Example shows how to use Phonon - the multimedia framework that comes with Qt - to create a simple music player. + The player can play music files, and provides simple playback control, such as pausing, stopping, and resuming the music. diff --git a/doc/src/examples/network-chat.qdoc b/doc/src/examples/network-chat.qdoc index bd8288f..b91b9c0 100644 --- a/doc/src/examples/network-chat.qdoc +++ b/doc/src/examples/network-chat.qdoc @@ -29,7 +29,7 @@ \example network/network-chat \title Network Chat Example - The Network Chat example demonstrates a stateful peer-to-peer Chat client + \brief The Network Chat example demonstrates a stateful peer-to-peer Chat client that uses broadcasting with QUdpSocket and QNetworkInterface to discover its peers. diff --git a/doc/src/examples/network-download.qdoc b/doc/src/examples/network-download.qdoc index da86b2a..48dbe10 100644 --- a/doc/src/examples/network-download.qdoc +++ b/doc/src/examples/network-download.qdoc @@ -29,7 +29,7 @@ \example network/download \title Network Download Example - The Network Download example shows how to perform multiple downloads in + \brief The Network Download example shows how to perform multiple downloads in parallel using the QNetworkAccessManager class. This example is designed to be run from the command line. diff --git a/doc/src/examples/network-downloadmanager.qdoc b/doc/src/examples/network-downloadmanager.qdoc index 0fa8cda..501c469 100644 --- a/doc/src/examples/network-downloadmanager.qdoc +++ b/doc/src/examples/network-downloadmanager.qdoc @@ -29,7 +29,7 @@ \example network/downloadmanager \title Network Download Manager Example - The Network Download example shows how to implement a queue for multiple + \brief The Network Download example shows how to implement a queue for multiple downloads using the QNetworkAccessManager class. This example is designed to be run from the command line. diff --git a/doc/src/examples/openvg-star.qdoc b/doc/src/examples/openvg-star.qdoc index 67422ae..2b25dbc 100644 --- a/doc/src/examples/openvg-star.qdoc +++ b/doc/src/examples/openvg-star.qdoc @@ -29,5 +29,5 @@ \example openvg/star \title OpenVG Star Example - The OpenVG Star example demonstrates the use of Qt's OpenVG integration. + \brief The OpenVG Star example demonstrates the use of Qt's OpenVG integration. */ diff --git a/doc/src/examples/orderform.qdoc b/doc/src/examples/orderform.qdoc index ea93d86..8d61143 100644 --- a/doc/src/examples/orderform.qdoc +++ b/doc/src/examples/orderform.qdoc @@ -29,9 +29,10 @@ \example richtext/orderform \title Order Form Example - The Order Form example shows how to generate rich text documents by - combining a simple template with data input by the user in a dialog. Data - is extracted from a \c DetailsDialog object and displayed on a QTextEdit + \brief The Order Form example shows how to generate rich text documents by + combining a simple template with data input by the user in a dialog. + + Data is extracted from a \c DetailsDialog object and displayed on a QTextEdit with a QTextCursor, using various formats. Each form generated is added to a QTabWidget for easy access. diff --git a/doc/src/examples/orientation.qdoc b/doc/src/examples/orientation.qdoc new file mode 100644 index 0000000..fc9f1c1 --- /dev/null +++ b/doc/src/examples/orientation.qdoc @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/orientation + \group all-examples + \title Orientation Example + + \brief The Orientation example shows a simple way to use different UIs depending on the screen + orientation of a mobile device. + + \image orientation-landscape.png The UI in landscape mode + \image orientation-portrait.png The UI in portrait mode + + The screen on many mobile devices can be viewed in both portrait and + landscape orientation. The orientation can be swiched with the help of a + hardware or software trigger. Due to the often small physical screen size, + user interfaces has to be very simple and compact to stay usable, and + applications usually occupy the whole screen. Designing a user interface + that works equally well in both landscape and portrait mode is not always + possible, however, so making a different layout for each case usually pays + off. + + The example application makes use of two different UI widgets created with + the Qt Designer, one for portrait and one for landscape orientation. The + application has a widget that contains an image and the user is able to + select one of three images for it to show. In addition to the two UIs, the + application consists of a \c MainWindow class. + + \section1 Landscape UI + + If the screen is in landscape mode, the user probably holds the device with + both hands and is ready to give full attention to the application. The + landscape UI looks like this: + + \image orientation-landscape-ui.png The landscape UI + + To the left is a QWidget called \c choiceWidget, which will show the + current image, and to the right are three QRadioButton instances. The + active radio button specifies the image to show. + + \section1 Portrait UI + + When the device is in portrait mode, it usually means that the user holds + it with one hand, and can comfortably use the thumb for small amounts of + input. The layout is simpler, and is focused on consuming content. The + portrait UI looks like this: + + \image orientation-portrait-ui.png The portrait UI + + Similarly, it contains a QWidget, also called \c choiceWidget, that will + show the current image. In contrast to the landscape UI, this one doesn't + provide any controls to change the image. + + \section1 MainWindow Class Definition + + \c MainWindow inherits from QWidget and acts as the top level widget of the + application. + + \snippet examples/widgets/orientation/mainwindow.h 0 + + The \c resizeEvent() method is re-implemented, and used to check which + UI to show. The \c onRadioButtonClicked() slot is connected to the + landscape UI's radio button group and selects the current image. + + \c landscapeWidget and \c portraitWidget will contain the UI layouts. Only + one of them is visible at a time. + + \section1 MainWindow Class Implementation + + In the constructor, the widgets that will hold the UIs are created and set + up. + + \snippet examples/widgets/orientation/mainwindow.cpp 0 + + Since the exit buttons on the layouts are different from each other, both + of them have to have their \c clicked() signal connected to the \c close() + slot of the main widget. The first image is also made current with the call + to \c onRadioButtonClicked(). + + \snippet examples/widgets/orientation/mainwindow.cpp 1 + + On the Maemo platform, windows are stuck in landscape mode by default. The + application has to explicitly say that rotation is supported. + + \snippet examples/widgets/orientation/mainwindow.cpp 2 + + The \c resizeEvent() is called when the main window is first created, and + also whenever the window has been resized. If the window is shown in + full screen, this is an indication that the orientation of the screen has + changed. + + The dimensions of \c landscapeWidget is the transpose of the dimensions of + \c portraitWidget. When the orientation is known, both are set to the + (possibly transposed) size of the window. Depending on the orientation, one + widget is made visible and the other invisible. + + \snippet examples/widgets/orientation/mainwindow.cpp 3 + + When the user selects one of the radio buttons in the landscape UI, the + current image is changed. The image is displayed by specifying the + background style of the choice widget. Since both \c portrait and + \c landscape have a \c choiceWidget of their own, the change has to be + reflected in both instances. + + \snippet examples/widgets/orientation/mainwindow.cpp 4 + + Synchronizing both UIs like this might become unfeasible when there are + many things that can change. In that case it is better to make use of the + \l{Introduction to Model/View Programming}{Model-View-Controller pattern} + more extensively and share the content between both portrait and landscape + widgets. Then an interface for displaying and manipulating it can be tailor + made for both orientations. + + \section1 The \c main() Function + + The main function creates a \c MainWindow instance and shows it full + screen. + \snippet examples/widgets/orientation/main.cpp 0 +*/ diff --git a/doc/src/examples/overpainting.qdoc b/doc/src/examples/overpainting.qdoc index 12f9756..74001fc 100644 --- a/doc/src/examples/overpainting.qdoc +++ b/doc/src/examples/overpainting.qdoc @@ -29,7 +29,7 @@ \example opengl/overpainting \title Overpainting Example - The Overpainting example shows how QPainter can be used + \brief The Overpainting example shows how QPainter can be used to overpaint a scene rendered using OpenGL in a QGLWidget. \image overpainting-example.png diff --git a/doc/src/examples/padnavigator.qdoc b/doc/src/examples/padnavigator.qdoc index 0942c82..111beda 100644 --- a/doc/src/examples/padnavigator.qdoc +++ b/doc/src/examples/padnavigator.qdoc @@ -29,7 +29,7 @@ \example graphicsview/padnavigator \title Pad Navigator Example - The Pad Navigator Example shows how you can use Graphics View together with + \brief The Pad Navigator Example shows how you can use Graphics View together with embedded widgets and Qt's \l{State Machine Framework} to create a simple but useful, dynamic, animated user interface. diff --git a/doc/src/examples/painterpaths.qdoc b/doc/src/examples/painterpaths.qdoc index 2f740b8..04012eb 100644 --- a/doc/src/examples/painterpaths.qdoc +++ b/doc/src/examples/painterpaths.qdoc @@ -29,7 +29,7 @@ \example painting/painterpaths \title Painter Paths Example - The Painter Paths example shows how painter paths can be used to + \brief The Painter Paths example shows how painter paths can be used to build complex shapes for rendering. \image painterpaths-example.png diff --git a/doc/src/examples/pbuffers.qdoc b/doc/src/examples/pbuffers.qdoc index 0c496b4..1c31994 100644 --- a/doc/src/examples/pbuffers.qdoc +++ b/doc/src/examples/pbuffers.qdoc @@ -29,7 +29,7 @@ \example opengl/pbuffers \title Pixel Buffers Example - The Pixel Buffers example demonstrates how to use the + \brief The Pixel Buffers example demonstrates how to use the QGLPixelBuffer class to render into an off-screen buffer and use the contents as a dynamic texture in a QGLWidget. diff --git a/doc/src/examples/pbuffers2.qdoc b/doc/src/examples/pbuffers2.qdoc index 280f329..4827b86 100644 --- a/doc/src/examples/pbuffers2.qdoc +++ b/doc/src/examples/pbuffers2.qdoc @@ -29,7 +29,7 @@ \example opengl/pbuffers2 \title Pixel Buffers 2 Example - The Pixel Buffers 2 example demonstrates how to use the + \brief The Pixel Buffers 2 example demonstrates how to use the QGLPixelBuffer class to render into an off-screen buffer and use the contents as a dynamic texture in a QGLWidget. diff --git a/doc/src/examples/pinchzoom.qdoc b/doc/src/examples/pinchzoom.qdoc index 04a8bb4..540d54c 100644 --- a/doc/src/examples/pinchzoom.qdoc +++ b/doc/src/examples/pinchzoom.qdoc @@ -29,7 +29,7 @@ \example touch/pinchzoom \title Pinch Zoom Example - The Pinch Zoom example shows how to use low-level touch information + \brief The Pinch Zoom example shows how to use low-level touch information to recognize a gesture. \image touch-pinchzoom-example.png diff --git a/doc/src/examples/pingpong.qdoc b/doc/src/examples/pingpong.qdoc index c4a29a4..a90db94 100644 --- a/doc/src/examples/pingpong.qdoc +++ b/doc/src/examples/pingpong.qdoc @@ -29,7 +29,7 @@ \example statemachine/pingpong \title Ping Pong States Example - The Ping Pong States example shows how to use parallel states together + \brief The Ping Pong States example shows how to use parallel states together with custom events and transitions in \l{The State Machine Framework}. This example implements a statechart where two states communicate by diff --git a/doc/src/examples/pixelator.qdoc b/doc/src/examples/pixelator.qdoc index b6d1fd6..50e79da 100644 --- a/doc/src/examples/pixelator.qdoc +++ b/doc/src/examples/pixelator.qdoc @@ -29,7 +29,7 @@ \example itemviews/pixelator \title Pixelator Example - The Pixelator example shows how delegates can be used to customize the way that + \brief The Pixelator example shows how delegates can be used to customize the way that items are rendered in standard item views. \image pixelator-example.png diff --git a/doc/src/examples/plugandpaint.qdoc b/doc/src/examples/plugandpaint.qdoc index 2a9d286..960ec8c 100644 --- a/doc/src/examples/plugandpaint.qdoc +++ b/doc/src/examples/plugandpaint.qdoc @@ -29,7 +29,7 @@ \example tools/plugandpaint \title Plug & Paint Example - The Plug & Paint example demonstrates how to write Qt + \brief The Plug & Paint example demonstrates how to write Qt applications that can be extended through plugins. \image plugandpaint.png Screenshot of the Plug & Paint example diff --git a/doc/src/examples/portedasteroids.qdoc b/doc/src/examples/portedasteroids.qdoc index 0458125..3fa0793 100644 --- a/doc/src/examples/portedasteroids.qdoc +++ b/doc/src/examples/portedasteroids.qdoc @@ -29,8 +29,9 @@ \example graphicsview/portedasteroids \title Ported Asteroids Example - This GraphicsView example is a port of the - Asteroids game, which was based on QCanvas. + \brief The Ported Asteroids example is a port of the + Asteroids game, which was based on QCanvas, to the Graphics View + framework. \image portedasteroids-example.png */ diff --git a/doc/src/examples/portedcanvas.qdoc b/doc/src/examples/portedcanvas.qdoc index 43b3a38..457d6b3 100644 --- a/doc/src/examples/portedcanvas.qdoc +++ b/doc/src/examples/portedcanvas.qdoc @@ -29,8 +29,8 @@ \example graphicsview/portedcanvas \title Ported Canvas Example - This GraphicsView example is a port of the old - QCanvas example from Qt 3. + \brief The Ported Canvas example is a port of the old + QCanvas example from Qt 3 to the Graphics View framework. \sa {Porting to Graphics View} diff --git a/doc/src/examples/previewer.qdoc b/doc/src/examples/previewer.qdoc index 2fe8d8d..128d3be 100644 --- a/doc/src/examples/previewer.qdoc +++ b/doc/src/examples/previewer.qdoc @@ -29,7 +29,7 @@ \example webkit/previewer \title Previewer Example - The Previewer example shows how to use QtWebKit's QWebView to preview + \brief The Previewer example shows how to use QtWebKit's QWebView to preview HTML data written in a QPlainTextEdit. \image previewer-example.png @@ -164,4 +164,4 @@ \snippet examples/webkit/previewer/main.cpp 0 -*/
\ No newline at end of file +*/ diff --git a/doc/src/examples/qml-calculator.qdoc b/doc/src/examples/qml-calculator.qdoc index 0624cb4..2e2cdc8 100644 --- a/doc/src/examples/qml-calculator.qdoc +++ b/doc/src/examples/qml-calculator.qdoc @@ -29,7 +29,7 @@ \title Calculator \example demos/declarative/calculator - This demo shows how to write a simple calculator application in QML and JavaScript. + \brief The Qt Quick Calculator demo shows how to write a simple calculator application in QML and JavaScript. \image qml-calculator-example.png */ diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index a910266..bde2ed7 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -29,7 +29,7 @@ \title Animation: Basics Example \example declarative/animation/basics - This example shows how to create and combine \l{QML Animation and Transitions}{animations} in QML. + \brief This example shows how to create and combine \l{QML Animation}{animations} in QML. \table \row @@ -38,6 +38,12 @@ \o color-animation.qml \endtable +/*! + \title Animation: Basics Property Animation Example + \example declarative/animation/basics/property-animation + + \brief This example shows how to create and combine \l{QML Animation}{animations} in QML. + \table \row \o \image qml-propertyanim-example.png @@ -50,7 +56,7 @@ \title Animation: Behavior Examples \example declarative/animation/behaviors - This example shows how to use QML behaviors. + \brief This example shows how to use QML behaviors. \image qml-behaviors-example.png */ @@ -59,7 +65,7 @@ \title Animation: Easing Example \example declarative/animation/easing - This example shows the different easing modes available for \l{QML Animation and Transitions}{animations}. + \brief This example shows the different easing modes available for \l{QML Animation}{animations}. \image qml-easing-example.png */ @@ -68,7 +74,7 @@ \title Animation: States Example \example declarative/animation/states - These examples show how to use \l{State}{states} and \l{Transition}{transitions}. + \brief These examples show how to use \l{States}{states} and \l{Transitions}{transitions}. The \c states.qml example shows how an item can change between states, and \c transitions.qml shows how these state changes can be animated. @@ -92,7 +98,7 @@ \title Image Elements: Border Image Example \example declarative/imageelements/borderimage - These examples show how to use the BorderImage element. + \brief These examples show how to use the BorderImage element. \table \row @@ -101,6 +107,12 @@ \o borderimage.qml \endtable +/*! + \title Image Elements: Shadows Image Example + \example declarative/imageelements/shadows + + \brief This example shows how to use the BorderImage element. + \table \row \o \image qml-borderimage-shadows-example.png @@ -113,7 +125,7 @@ \title Image Elements: Image Example \example declarative/imageelements/image - This example shows how to use the \l Image element and its \l{Image::fillMode}{fillModes}. + \brief This example shows how to use the \l Image element and its \l{Image::fillMode}{fillModes}. \image qml-image-example.png */ @@ -122,8 +134,8 @@ \page declarative-cppextensions-reference.html \title C++ Extensions: Reference examples - These examples show how QML can be extended from C++ in various ways. - + \brief These examples show how QML can be extended from C++ in various ways. + The code for these examples is used throughout the \l {Extending QML Functionalities using C++} reference documentation, which highlights the main principles demonstrated in each example. @@ -151,7 +163,7 @@ \title C++ Extensions: Plugins Example \example declarative/cppextensions/plugins - This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin. + \brief This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin. \image qml-plugins-example.png */ @@ -160,7 +172,7 @@ \title LayoutItem Example \example declarative/cppextensions/qgraphicslayouts/layoutitem - This example show how to use the LayoutItem element to integrate QML items into an existing + \brief This example show how to use the LayoutItem element to integrate QML items into an existing \l{Graphics View Framework}{Graphics View}-based application. \image qml-layoutitem-example.png @@ -169,7 +181,7 @@ \title QGraphicsGridLayout Example \example declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout - This example shows how to use QGraphicsGridLayout to lay out QML items. This is + \brief This example shows how to use QGraphicsGridLayout to lay out QML items. This is useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with QML. @@ -179,7 +191,7 @@ \title QGraphicsLinearLayout Example \example declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout - This example shows how to use QGraphicsLinearLayout to lay out QML items. This is + \brief This example shows how to use QGraphicsLinearLayout to lay out QML items. This is useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with QML. @@ -189,7 +201,7 @@ \title C++ Extensions: QGraphicsLayouts examples \page declarative-cppextensions-qgraphicslayouts.html - These examples show how to integrate \l{Graphics View Framework}{Graphics View} + \brief These examples show how to integrate \l{Graphics View Framework}{Graphics View} layout components with QML: \list @@ -206,7 +218,7 @@ \title C++ Extensions: QWidgets Example \example declarative/cppextensions/qwidgets - This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget. + \brief This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget. \image qml-qwidgets-example.png */ @@ -215,7 +227,7 @@ \title C++ Extensions: Image Provider Example \example declarative/cppextensions/imageprovider - This examples shows how to use QDeclarativeImageProvider to serve images + \brief This examples shows how to use QDeclarativeImageProvider to serve images to QML image elements. \image qml-imageprovider-example.png @@ -225,7 +237,7 @@ \title C++ Extensions: Network Access Manager Factory Example \example declarative/cppextensions/networkaccessmanagerfactory - This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager + \brief This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager with a proxy. */ @@ -234,7 +246,7 @@ \example declarative/i18n \ingroup internationalization - This example shows how to enable text translation in QML. + \brief This example shows how to enable text translation in QML. \image qml-i18n-example.png @@ -316,7 +328,7 @@ \title Positioners Example \example declarative/positioners - This example shows how to use the positioner elements such as \l Row, \l Column, + \brief This example shows how to use positioner elements such as \l Row, \l Column, \l Grid and \l Flow. \image qml-positioners-example.png @@ -326,7 +338,7 @@ \title Key Interaction: Focus Example \example declarative/keyinteraction/focus - This example shows how to handle keyboard input and focus in QML. + \brief This example shows how to handle keyboard input and focus in QML. \image qml-focus-example.png */ @@ -335,7 +347,7 @@ \title Models and Views: AbstractItemModel Example \example declarative/modelviews/abstractitemmodel - This example shows how to use a QAbstractItemModel subclass as a model in QML. + \brief This example shows how to use a QAbstractItemModel subclass as a model in QML. \image qml-abstractitemmodel-example.png */ @@ -344,7 +356,7 @@ \title Models and Views: GridView Example \example declarative/modelviews/gridview - This example shows how to use the GridView element. + \brief This example shows how to use the GridView element. \image qml-gridview-example.png */ @@ -353,7 +365,9 @@ \title Models and Views: ListView Example \example declarative/modelviews/listview - These examples show how to use the ListView element. + \brief This example shows how items can be dynamically added to + and removed from a ListModel, and how these list + modifications can be animated. \table \row @@ -362,6 +376,13 @@ \o dynamiclist.qml \endtable +/*! + \title Models and Views: Expanding Delegate ListView Example + \example declarative/modelviews/listview/expandingdelegates + + \brief This example shows how to create a dynamic delegate, which + expands when selected. + \table \row \o \image qml-listview-expandingdelegates-example.png @@ -369,6 +390,13 @@ \o expandingdelegates.qml \endtable +/*! + \title Models and Views: Highlight ListView Example + \example declarative/modelviews/listview/highlight + + \brief This example shows how to highlight one item + inside a ListView element. + \table \row \o \image qml-listview-highlight-example.png @@ -376,6 +404,13 @@ \o highlight.qml \endtable +/*! + \title Models and Views: Highlight Ranges ListView Example + \example declarative/modelviews/listview/highlightranges + + \brief This example shows how to highlight ranges within a + ListView element. + \table \row \o \image qml-listview-highlightranges-example.png @@ -383,6 +418,12 @@ \o highlightranges.qml \endtable +/*! + \title Models and Views: Sections ListView Example + \example declarative/modelviews/listview/sections + + \brief This example shows how to use the ListView element. + \table \row \o \image qml-listview-sections-example.png @@ -395,7 +436,7 @@ \title Models and Views: PathView Example \example declarative/modelviews/pathview - This example shows how to use the PathView element. + \brief This example shows how to use the PathView element. \image qml-pathview-example.png */ @@ -404,7 +445,7 @@ \title Models and Views: Object ListModel Example \example declarative/modelviews/objectlistmodel - This example shows how to use a QList<QObject*> as a model in QML. + \brief This example shows how to use a QList<QObject*> as a model in QML. \image qml-objectlistmodel-example.png */ @@ -413,7 +454,7 @@ \title Models and Views: Package Example \example declarative/modelviews/package - This example shows how to use the \l Package element. + \brief This example shows how to use the \l Package element. \image qml-package-example.png */ @@ -422,7 +463,7 @@ \title Models and Views: Parallax Example \example declarative/modelviews/parallax - This example shows how to combine and switch between views. + \brief This example shows how to combine and switch between views. \image qml-parallax-example.png */ @@ -431,7 +472,7 @@ \title Models and Views: String ListModel Example \example declarative/modelviews/stringlistmodel - This example shows how to use a QStringList as a model in QML. + \brief This example shows how to use a QStringList as a model in QML. \image qml-stringlistmodel-example.png */ @@ -440,7 +481,7 @@ \title Models and Views: VisualItemModel Example \example declarative/modelviews/visualitemmodel - This example shows how to use the VisualItemModel element. + \brief This example shows how to use the VisualItemModel element. \image qml-visualitemmodel-example.png */ @@ -449,7 +490,7 @@ \title Models and Views: WebView Example \example declarative/modelviews/webview - These examples show how to use the WebView element. + \brief These examples show how to use the WebView element. \table \row @@ -458,6 +499,12 @@ \o alert.qml \endtable +/*! + \title Models and Views: Autosize WebView Example + \example declarative/modelviews/webview/autosize + + \brief These examples show how to use the WebView element. + \table \row \o \image qml-webview-autosize-example.png @@ -465,6 +512,12 @@ \o autosize.qml \endtable +/*! + \title Models and Views: GoogleMaps WebView Example + \example declarative/modelviews/webview/googlemaps + + \brief These examples show how to use the WebView element. + \table \row \o \image qml-webview-googlemaps-example.png @@ -472,6 +525,12 @@ \o googlemaps.qml \endtable +/*! + \title Models and Views: Inline HTML WebView Example + \example declarative/modelviews/webview/inlinehtml + + \brief These examples show how to use the WebView element. + \table \row \o \image qml-webview-inlinehtml-example.png @@ -479,6 +538,12 @@ \o inlinehtml.qml \endtable +/*! + \title Models and Views: New Windows WebView Example + \example declarative/modelviews/webview/newwindows + + \brief These examples show how to use the WebView element. + \table \row \o \image qml-webview-newwindows-example.png @@ -492,22 +557,21 @@ \title Screen Orientation \example declarative/screenorientation - This example shows how to implement screen orientation support for your application. + \brief This example shows how to implement screen orientation support for your application. */ /*! \title SQL Local Storage Example \example declarative/sqllocalstorage - This example shows how to use the SQL Local Storage API in QML. + \brief This example shows how to use the SQL Local Storage API in QML. */ /*! \title Text: Fonts Example \example declarative/text/fonts - These examples show how to discover available fonts from QML and manipulate - text in various ways. + \brief These examples show how to discover available fonts from QML. \table \row @@ -516,6 +580,12 @@ \o availableFonts.qml \endtable +/*! + \title Text: Banner Fonts Example + \example declarative/text/fonts/banner + + \brief These example shows how to manipulate text in various ways. + \table \row \o \image qml-fonts-banner-example.png @@ -523,6 +593,12 @@ \o banner.qml \endtable +/*! + \title Text: Fonts Example + \example declarative/text/fonts/fonts + + \brief These examples shows how to display a text with multiple fonts. + \table \row \o \image qml-fonts-fonts-example.png @@ -530,6 +606,12 @@ \o fonts.qml \endtable +/*! + \title Text: Hello Fonts Example + \example declarative/text/fonts/hello + + \brief This example shows how to manipulate text in various ways. + \table \row \o \image qml-fonts-hello-example.png @@ -542,7 +624,7 @@ \title Text: Text Selection Example \example declarative/text/textselection - This example shows how text selection, copy and paste operations + \brief This example shows how text selection, copy and paste operations can be implemented on top of the TextEdit element. \image qml-textselection-example.png @@ -552,7 +634,7 @@ \title Threading: Threaded ListModel Example \example declarative/threading/threadedlistmodel - This example shows how to use a ListModel from multiple threads using + \brief This example shows how to use a ListModel from multiple threads using WorkerScript. */ @@ -560,15 +642,16 @@ \title Threading: WorkerScript Example \example declarative/threading/workerscript - This example shows how to use the WorkerScript element for threading in QML. + \brief This example shows how to use the WorkerScript element for threading in QML. */ /*! \title Toys: Clocks Example \example declarative/toys/clocks - This example displays a set of clocks with different times for different cities. - Each clock is created by combining \l Image elements with \l Rotation transforms + \brief This example displays a set of clocks with different times for different cities. + + Each clock is created by combining \l Image elements with \l Rotation transforms and \l SpringAnimation behaviors. \image qml-clocks-example.png @@ -578,7 +661,7 @@ \title Toys: Corkboards Example \example declarative/toys/corkboards - This example presents a flickable set of interactive corkboards. It is created + \brief This example presents a flickable set of interactive corkboards. It is created through a combination of elements like \l ListModel, \l Repeater and \l TextEdit together with rotation and scaling transforms, animation and mouse interaction. @@ -589,7 +672,7 @@ \title Toys: Dynamic Scene Example \example declarative/toys/dynamicscene - This example presents an interactive drag-and-drop scene. It demonstrates + \brief This example presents an interactive drag-and-drop scene. It demonstrates how to use QML's \l{Dynamic Object Creation} support to dynamically create and destroy objects. @@ -600,7 +683,7 @@ \title Toys: Tic-Tac-Toe Example \example declarative/toys/tic-tac-toe - This example presents a simple implementation of Tic Tac Toe. + \brief This example presents a simple implementation of Tic Tac Toe. \image qml-tic-tac-toe-example.png */ @@ -609,17 +692,24 @@ \title Toys: TV Tennis Example \example declarative/toys/tvtennis - This example shows how to use animation components such as \l SpringAnimation, + \brief This example shows how to use animation components such as \l SpringAnimation, \l SequentialAnimation and \l PropertyAction to create a game of TV tennis. \image qml-tvtennis-example.png */ /*! + \title Touch Interaction: Gestures Example + \example declarative/touchinteraction/gestures + + \brief This example shows how to use the GestureArea element. +*/ + +/*! \title Touch Interaction: MouseArea Example \example declarative/touchinteraction/mousearea - This example shows how to use the MouseArea element to access information + \brief This example shows how to use the MouseArea element to access information about mouse input. \image qml-mousearea-example.png @@ -629,7 +719,7 @@ \title UI Components: Dial Control Example \example declarative/ui-components/dialcontrol - This example shows how to create a dial-type control. It combines + \brief This example shows how to create a dial-type control. It combines \l Image elements with \l Rotation transforms and \l SpringAnimation behaviors to produce an interactive speedometer-type dial. @@ -641,7 +731,7 @@ \title UI Components: Flipable Example \example declarative/ui-components/flipable - This example shows how to use the \l Flipable element. + \brief This example shows how to use the \l Flipable element. \image qml-flipable-example.png */ @@ -650,7 +740,7 @@ \title UI Components: Progress Bars Example \example declarative/ui-components/progressbar - This example shows how to create a progress bar. + \brief This example shows how to create a progress bar. \image qml-progressbar-example.png */ @@ -659,7 +749,7 @@ \title UI Components: Scroll Bar Example \example declarative/ui-components/scrollbar - This example shows how to create scroll bars for a \l Flickable element + \brief This example shows how to create scroll bars for a \l Flickable element using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea} properties. @@ -670,7 +760,7 @@ \title UI Components: Search Box Example \example declarative/ui-components/searchbox - This example shows how to combine TextInput, FocusScope and BorderImage + \brief This example shows how to combine TextInput, FocusScope and BorderImage elements to display multiple text input fields. \image qml-searchbox-example.png @@ -680,7 +770,7 @@ \title UI Components: Slide Switch Example \example declarative/ui-components/slideswitch - This example shows how to create a slide switch control. + \brief This example shows how to create a slide switch control. \image qml-slideswitch-example.png */ @@ -689,7 +779,7 @@ \title UI Components: Spinner Example \example declarative/ui-components/spinner - This example shows how to create a spinner-type component using the PathView element. + \brief This example shows how to create a spinner-type component using the PathView element. \image qml-spinner-example.png */ @@ -698,7 +788,7 @@ \title UI Components: Tab Widget Example \example declarative/ui-components/tabwidget - This example shows how to create a tab widget. It also demonstrates how + \brief This example shows how to create a tab widget. It also demonstrates how \l {Property aliases}{property aliases} and \l {Introduction to the QML Language#Default Properties}{default properties} can be used to collect and assemble the child items declared within an \l Item. @@ -710,7 +800,7 @@ \title XML: XMLHttpRequest Example \example declarative/xml/xmlhttprequest - This example shows how to use the \l XmlHttpRequest API in QML. + \brief This example shows how to use the \l XmlHttpRequest API in QML. \image qml-xmlhttprequest-example.png */ diff --git a/doc/src/examples/qml-extending.qdoc b/doc/src/examples/qml-extending.qdoc index 8dbbe7f..da7ab47 100644 --- a/doc/src/examples/qml-extending.qdoc +++ b/doc/src/examples/qml-extending.qdoc @@ -29,7 +29,8 @@ \example declarative/cppextensions/referenceexamples/adding \title Extending QML - Adding Types Example -The Adding Types Example shows how to add a new element type, \c Person, to QML. +\brief The Adding Types Example shows how to add a new element type, \c Person, to QML. + The \c Person type can be used from QML like this: \snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0 diff --git a/doc/src/examples/qml-flickr.qdoc b/doc/src/examples/qml-flickr.qdoc index c23c0ba..65e8e0d 100644 --- a/doc/src/examples/qml-flickr.qdoc +++ b/doc/src/examples/qml-flickr.qdoc @@ -29,7 +29,7 @@ \title Flickr Mobile \example demos/declarative/flickr - This demo shows how to write a mobile Flickr browser application in QML. + \brief The Qt Quick Flickr Mobile demo shows how to write a mobile Flickr browser application in QML. \image qml-flickr-demo.png */ diff --git a/doc/src/examples/qml-folderlistmodel.qdoc b/doc/src/examples/qml-folderlistmodel.qdoc index ed92c9d..609be27 100644 --- a/doc/src/examples/qml-folderlistmodel.qdoc +++ b/doc/src/examples/qml-folderlistmodel.qdoc @@ -30,7 +30,9 @@ \title FolderListModel - a C++ model plugin \example src/imports/folderlistmodel -This plugin shows how to make a C++ model available to QML. It presents +\brief The FolderListModel plugin example shows how to make a C++ model available to QML. + +It presents a simple file list for a single folder (directory) and allows the presented folder to be changed. diff --git a/doc/src/examples/qml-minehunt.qdoc b/doc/src/examples/qml-minehunt.qdoc index ac13456..66c7dd3 100644 --- a/doc/src/examples/qml-minehunt.qdoc +++ b/doc/src/examples/qml-minehunt.qdoc @@ -29,7 +29,7 @@ \title Minehunt \example demos/declarative/minehunt - This demo shows how to create a simple Minehunt game, using QML for the + \brief The Qt Quick Minehunt demo shows how to create a simple Minehunt game, using QML for the UI and C++ for the game logic. \image qml-minehunt-demo.png diff --git a/doc/src/examples/qml-photoviewer.qdoc b/doc/src/examples/qml-photoviewer.qdoc index 5ecbf84..40b6372 100644 --- a/doc/src/examples/qml-photoviewer.qdoc +++ b/doc/src/examples/qml-photoviewer.qdoc @@ -29,7 +29,7 @@ \title Photo Viewer \example demos/declarative/photoviewer - This demo shows how to write a Flickr photo viewer application in QML. + \brief The Qt Quick Photo Viewer demo shows how to write a Flickr photo viewer application in QML. \image qml-photoviewer-demo.png */ diff --git a/doc/src/examples/qml-rssnews.qdoc b/doc/src/examples/qml-rssnews.qdoc index beea4d3..76df4e3 100644 --- a/doc/src/examples/qml-rssnews.qdoc +++ b/doc/src/examples/qml-rssnews.qdoc @@ -29,7 +29,7 @@ \title RSS News \example demos/declarative/rssnews - This demo shows how to write a RSS news reader in QML. + \brief The Qt Quick RSS News demo shows how to write a RSS news reader in QML. \image qml-rssnews-demo.png */ diff --git a/doc/src/examples/qml-samegame.qdoc b/doc/src/examples/qml-samegame.qdoc index 81a26a3..8b67a49 100644 --- a/doc/src/examples/qml-samegame.qdoc +++ b/doc/src/examples/qml-samegame.qdoc @@ -29,7 +29,7 @@ \title Same Game \example demos/declarative/samegame - This demo shows how to write a 'Same Game' game in QML, using Javascript + \brief The Qt Quick Same Game demo shows how to write a 'Same Game' game in QML, using Javascript for all the game logic. \image qml-samegame-demo.png diff --git a/doc/src/examples/qml-snake.qdoc b/doc/src/examples/qml-snake.qdoc index bce0e71..8a27711 100644 --- a/doc/src/examples/qml-snake.qdoc +++ b/doc/src/examples/qml-snake.qdoc @@ -29,7 +29,7 @@ \title Snake \example demos/declarative/snake - This demo shows how to write a Snake game in QML, controlled by the + \brief The Qt Quick Snake demo shows how to write a Snake game in QML, controlled by the keyboard as well as the mouse. \image qml-snake-demo.png diff --git a/doc/src/examples/qml-twitter.qdoc b/doc/src/examples/qml-twitter.qdoc index 3ebabb4..3334370 100644 --- a/doc/src/examples/qml-twitter.qdoc +++ b/doc/src/examples/qml-twitter.qdoc @@ -29,7 +29,7 @@ \title Twitter Mobile \example demos/declarative/twitter - This demo shows how to write a mobile Twitter search client in QML. Use it to + \brief The Qt Quick Twitter Mobile demo shows how to write a mobile Twitter search client in QML. Use it to see what people think about Qt Quick! \image qml-twitter-demo.png diff --git a/doc/src/examples/qml-webbrowser.qdoc b/doc/src/examples/qml-webbrowser.qdoc index 08416af..bdead7f 100644 --- a/doc/src/examples/qml-webbrowser.qdoc +++ b/doc/src/examples/qml-webbrowser.qdoc @@ -26,10 +26,10 @@ ****************************************************************************/ /*! - \title QML Web Browser + \title Qt Quick Web Browser \example demos/declarative/webbrowser - This demo shows how to write a simple web browser in QML by combining the + \brief The Qt Quick Web Browser demo shows how to write a simple web browser in QML by combining the WebView element with other components including scroll bars, \l Flickable views and TextInput fields. diff --git a/doc/src/examples/qobjectxmlmodel.qdoc b/doc/src/examples/qobjectxmlmodel.qdoc index a950f72..6f66e70 100644 --- a/doc/src/examples/qobjectxmlmodel.qdoc +++ b/doc/src/examples/qobjectxmlmodel.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/qobjectxmlmodel \title QObject XML Model Example - This example shows how to use QtXmlPatterns to query QObject trees + \brief The XML Model example shows how to use QtXmlPatterns to query QObject trees by modeling the non-XML data structure of a QObject tree to look like XML. diff --git a/doc/src/examples/qtconcurrent-imagescaling.qdoc b/doc/src/examples/qtconcurrent-imagescaling.qdoc index 1b3c6d6..15f2dab 100644 --- a/doc/src/examples/qtconcurrent-imagescaling.qdoc +++ b/doc/src/examples/qtconcurrent-imagescaling.qdoc @@ -29,6 +29,6 @@ \example qtconcurrent/imagescaling \title QtConcurrent Image Scaling Example - The QtConcurrent Map example shows how to use the asynchronous + \brief The QtConcurrent Image Scaling example shows how to use the asynchronous QtConcurrent API to load and scale a collection of images. */ diff --git a/doc/src/examples/qtconcurrent-map.qdoc b/doc/src/examples/qtconcurrent-map.qdoc index 76a6f13..6b22966 100644 --- a/doc/src/examples/qtconcurrent-map.qdoc +++ b/doc/src/examples/qtconcurrent-map.qdoc @@ -29,6 +29,6 @@ \example qtconcurrent/map \title QtConcurrent Map Example - The QtConcurrent Map example shows how to use the synchronous (blocking) + \brief The QtConcurrent Map example shows how to use the synchronous (blocking) QtConcurrent API to scale a collection of images. */ diff --git a/doc/src/examples/qtconcurrent-progressdialog.qdoc b/doc/src/examples/qtconcurrent-progressdialog.qdoc index 43e5fef..7f18b0f 100644 --- a/doc/src/examples/qtconcurrent-progressdialog.qdoc +++ b/doc/src/examples/qtconcurrent-progressdialog.qdoc @@ -29,7 +29,7 @@ \example qtconcurrent/progressdialog \title QtConcurrent Progress Dialog Example - The QtConcurrent Progress Dialog example shows how to use the + \brief The QtConcurrent Progress Dialog example shows how to use the QFutureWatcher class to monitor the progress of a long-running operation. \image qtconcurrent-progressdialog.png diff --git a/doc/src/examples/qtconcurrent-runfunction.qdoc b/doc/src/examples/qtconcurrent-runfunction.qdoc index c66ac11..7e73508 100644 --- a/doc/src/examples/qtconcurrent-runfunction.qdoc +++ b/doc/src/examples/qtconcurrent-runfunction.qdoc @@ -29,7 +29,7 @@ \example qtconcurrent/runfunction \title QtConcurrent Run Function Example - The QtConcurrent Run Function example shows how to apply concurrency to + \brief The QtConcurrent Run Function example shows how to apply concurrency to a standard function, using QFuture instances to retrieve return values at a later time. */ diff --git a/doc/src/examples/qtconcurrent-wordcount.qdoc b/doc/src/examples/qtconcurrent-wordcount.qdoc index 26e65be..5f87884 100644 --- a/doc/src/examples/qtconcurrent-wordcount.qdoc +++ b/doc/src/examples/qtconcurrent-wordcount.qdoc @@ -29,7 +29,7 @@ \example qtconcurrent/wordcount \title QtConcurrent Word Count Example - The QtConcurrent Word Count example demonstrates the use of the map-reduce + \brief The QtConcurrent Word Count example demonstrates the use of the map-reduce algorithm when applied to the problem of counting words in a collection of files. */ diff --git a/doc/src/examples/qtscriptcalculator.qdoc b/doc/src/examples/qtscriptcalculator.qdoc index ce925f3..109394d 100644 --- a/doc/src/examples/qtscriptcalculator.qdoc +++ b/doc/src/examples/qtscriptcalculator.qdoc @@ -29,7 +29,7 @@ \example script/calculator \title QtScript Calculator Example - In this simple QtScript example, we show how to implement the + \brief In the QtScript Calculator example, we show how to implement the functionality of a calculator widget. \image qtscript-calculator-example.png diff --git a/doc/src/examples/qtscriptcustomclass.qdoc b/doc/src/examples/qtscriptcustomclass.qdoc index b3d4535..21624a0 100644 --- a/doc/src/examples/qtscriptcustomclass.qdoc +++ b/doc/src/examples/qtscriptcustomclass.qdoc @@ -29,7 +29,7 @@ \example script/customclass \title Custom Script Class Example - The Custom Script Class example shows how to use QScriptClass and QScriptClassPropertyIterator + \brief The Custom Script Class example shows how to use QScriptClass and QScriptClassPropertyIterator to implement a custom script class. The script class we are going to implement is called \c{ByteArray}. It provides a wrapper around diff --git a/doc/src/examples/qtscripttetrix.qdoc b/doc/src/examples/qtscripttetrix.qdoc index 92a50bf..fe9632e 100644 --- a/doc/src/examples/qtscripttetrix.qdoc +++ b/doc/src/examples/qtscripttetrix.qdoc @@ -29,7 +29,7 @@ \example script/qstetrix \title Qt Script Tetrix Example - The QSTetrix example is a Qt Script version of the classic Tetrix game. + \brief The QSTetrix example is a Qt Script version of the classic Tetrix game. \image tetrix-example.png diff --git a/doc/src/examples/querymodel.qdoc b/doc/src/examples/querymodel.qdoc index 554ae21..9c523e7 100644 --- a/doc/src/examples/querymodel.qdoc +++ b/doc/src/examples/querymodel.qdoc @@ -29,7 +29,7 @@ \example sql/querymodel \title Query Model Example - The Query Model example shows how to make customized versions of + \brief The Query Model example shows how to make customized versions of data obtained from a SQL query, using a model that encapsulates the query and table views to display the results. diff --git a/doc/src/examples/queuedcustomtype.qdoc b/doc/src/examples/queuedcustomtype.qdoc index 85f6b07..4b1db01 100644 --- a/doc/src/examples/queuedcustomtype.qdoc +++ b/doc/src/examples/queuedcustomtype.qdoc @@ -29,7 +29,7 @@ \example threads/queuedcustomtype \title Queued Custom Type Example - The Queued Custom Type example shows how to send custom types between + \brief The Queued Custom Type example shows how to send custom types between threads with queued signals and slots. \image queuedcustomtype-example.png diff --git a/doc/src/examples/qxmlstreambookmarks.qdoc b/doc/src/examples/qxmlstreambookmarks.qdoc index ecb8fce..6d2a6f1 100644 --- a/doc/src/examples/qxmlstreambookmarks.qdoc +++ b/doc/src/examples/qxmlstreambookmarks.qdoc @@ -29,7 +29,7 @@ \example xml/streambookmarks \title QXmlStream Bookmarks Example - The QXmlStream Bookmarks example provides a reader for XML Bookmark + \brief The QXmlStream Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) files using Qt's QXmlStreamReader class for reading, and QXmlStreamWriter class for writing the files. diff --git a/doc/src/examples/recentfiles.qdoc b/doc/src/examples/recentfiles.qdoc index 048df01..03c79c6 100644 --- a/doc/src/examples/recentfiles.qdoc +++ b/doc/src/examples/recentfiles.qdoc @@ -29,7 +29,7 @@ \example mainwindows/recentfiles \title Recent Files Example - The Recent Files example shows how a standard File menu can be extended to show + \brief The Recent Files example shows how a standard File menu can be extended to show the most recent files loaded by a main window application. \image recentfiles-example.png diff --git a/doc/src/examples/recipes.qdoc b/doc/src/examples/recipes.qdoc index f2665eb..c93e4dbe 100644 --- a/doc/src/examples/recipes.qdoc +++ b/doc/src/examples/recipes.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/recipes \title Recipes Example - The recipes example shows how to use QtXmlPatterns to query XML data + \brief The Recipes example shows how to use QtXmlPatterns to query XML data loaded from a file. \tableofcontents diff --git a/doc/src/examples/regexp.qdoc b/doc/src/examples/regexp.qdoc index 7b97156..4fc07d6 100644 --- a/doc/src/examples/regexp.qdoc +++ b/doc/src/examples/regexp.qdoc @@ -29,7 +29,7 @@ \example tools/regexp \title Regular Expressions Example - The Regular Expressions (RegExp) example shows how regular expressions in Qt are + \brief The Regular Expressions (RegExp) example shows how regular expressions in Qt are applied to text by providing an environment in which new regular expressions can be created and tested on custom text strings. diff --git a/doc/src/examples/relationaltablemodel.qdoc b/doc/src/examples/relationaltablemodel.qdoc index f23c69c..1c2c473 100644 --- a/doc/src/examples/relationaltablemodel.qdoc +++ b/doc/src/examples/relationaltablemodel.qdoc @@ -29,7 +29,7 @@ \example sql/relationaltablemodel \title Relational Table Model Example - The Relational Table Model example shows how to use table views with a relational + \brief The Relational Table Model example shows how to use table views with a relational model to visualize the relations between items in a database. \image relationaltablemodel-example.png diff --git a/doc/src/examples/remotecontrol.qdoc b/doc/src/examples/remotecontrol.qdoc index c92c5e4..e1e60b0 100644 --- a/doc/src/examples/remotecontrol.qdoc +++ b/doc/src/examples/remotecontrol.qdoc @@ -29,6 +29,6 @@ \example help/remotecontrol \title Remote Control Example - This example shows how to use and control Qt Assistant + \brief The Remote Control example shows how to use and control Qt Assistant as a help viewer. -*/
\ No newline at end of file +*/ diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc index e93886b..b872008 100644 --- a/doc/src/examples/rogue.qdoc +++ b/doc/src/examples/rogue.qdoc @@ -29,7 +29,7 @@ \example statemachine/rogue \title Rogue Example - The Rogue example shows how to use the Qt state machine for event + \brief The Rogue example shows how to use the Qt state machine for event handling. \image rogue-example.png diff --git a/doc/src/examples/rsslisting.qdoc b/doc/src/examples/rsslisting.qdoc index 8893325..7ad464f 100644 --- a/doc/src/examples/rsslisting.qdoc +++ b/doc/src/examples/rsslisting.qdoc @@ -29,7 +29,7 @@ \example xml/rsslisting \title RSS-Listing Example - This example shows how to create a widget that displays news items + \brief The RSS-Listing example shows how to create a widget that displays news items from RDF news sources. \image rsslistingexample.png diff --git a/doc/src/examples/samplebuffers.qdoc b/doc/src/examples/samplebuffers.qdoc index c9d6438..422f96b 100644 --- a/doc/src/examples/samplebuffers.qdoc +++ b/doc/src/examples/samplebuffers.qdoc @@ -29,7 +29,7 @@ \example opengl/samplebuffers \title Sample Buffers Example - The Sample Buffers example demonstrates how to use and enable + \brief The Sample Buffers example demonstrates how to use and enable sample buffers in a QGLWidget. \image samplebuffers-example.png diff --git a/doc/src/examples/saxbookmarks.qdoc b/doc/src/examples/saxbookmarks.qdoc index e912372..089f2de 100644 --- a/doc/src/examples/saxbookmarks.qdoc +++ b/doc/src/examples/saxbookmarks.qdoc @@ -29,8 +29,10 @@ \example xml/saxbookmarks \title SAX Bookmarks Example - The SAX Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) - files that uses Qt's SAX-based API to read and parse the files. The DOM Bookmarks + \brief The SAX Bookmarks example provides a reader for XML Bookmark Exchange Language (XBEL) + files that uses Qt's SAX-based API to read and parse the files. + + The DOM Bookmarks example provides an alternative way to read this type of file. \image saxbookmarks-example.png diff --git a/doc/src/examples/schema.qdoc b/doc/src/examples/schema.qdoc index 99966a6..0ba794b 100644 --- a/doc/src/examples/schema.qdoc +++ b/doc/src/examples/schema.qdoc @@ -29,8 +29,8 @@ \example xmlpatterns/schema \title XML Schema Validation Example - This example shows how to use QtXmlPatterns to validate XML with - a W3C XML Schema. + \brief The XML Schema Validation example shows how to use QtXmlPatterns to + validate XML with a W3C XML Schema. \tableofcontents diff --git a/doc/src/examples/screenshot.qdoc b/doc/src/examples/screenshot.qdoc index bc87fdb..1d8505f 100644 --- a/doc/src/examples/screenshot.qdoc +++ b/doc/src/examples/screenshot.qdoc @@ -29,7 +29,7 @@ \example desktop/screenshot \title Screenshot Example - The Screenshot example shows how to take a screenshot of the + \brief The Screenshot example shows how to take a screenshot of the desktop using QApplication and QDesktopWidget. It also shows how to use QTimer to provide a single-shot timer, and how to reimplement the QWidget::resizeEvent() event handler to make sure diff --git a/doc/src/examples/scribble.qdoc b/doc/src/examples/scribble.qdoc index da9b0b6..56b678c 100644 --- a/doc/src/examples/scribble.qdoc +++ b/doc/src/examples/scribble.qdoc @@ -29,7 +29,7 @@ \example widgets/scribble \title Scribble Example - The Scribble example shows how to reimplement some of QWidget's + \brief The Scribble example shows how to reimplement some of QWidget's event handlers to receive the events generated for the application's widgets. diff --git a/doc/src/examples/script-marshal.qdoc b/doc/src/examples/script-marshal.qdoc index 90ff69b..852f9be 100644 --- a/doc/src/examples/script-marshal.qdoc +++ b/doc/src/examples/script-marshal.qdoc @@ -29,6 +29,6 @@ \example script/marshal \title Qt Script Marshalling Example - The Qt Script Marshalling example demonstrates the marshalling of value + \brief The Qt Script Marshalling example demonstrates the marshalling of value types between C++ and Qt Script. */ diff --git a/doc/src/examples/script-qscript.qdoc b/doc/src/examples/script-qscript.qdoc index 6c50c3f..d0c2841 100644 --- a/doc/src/examples/script-qscript.qdoc +++ b/doc/src/examples/script-qscript.qdoc @@ -29,6 +29,6 @@ \example script/qscript \title Qt Script Interpreter Example - The Qt Script Interpreter example shows how to create an interactive + \brief The Qt Script Interpreter example shows how to create an interactive interpreter for Qt Script. */ diff --git a/doc/src/examples/script-qsdbg.qdoc b/doc/src/examples/script-qsdbg.qdoc index 59ab10e..7e4f05c 100644 --- a/doc/src/examples/script-qsdbg.qdoc +++ b/doc/src/examples/script-qsdbg.qdoc @@ -29,6 +29,6 @@ \example script/qsdbg \title Qt Script Debugger Example - The Qt Script Debugger example shows how to enable the Qt Script debugger + \brief The Qt Script Debugger example shows how to enable the Qt Script debugger for command line debugging. */ diff --git a/doc/src/examples/sdi.qdoc b/doc/src/examples/sdi.qdoc index 5e3eb79..e975879 100644 --- a/doc/src/examples/sdi.qdoc +++ b/doc/src/examples/sdi.qdoc @@ -29,7 +29,7 @@ \example mainwindows/sdi \title SDI Example - The SDI example shows how to create a Single Document Interface. It uses a number of + \brief The SDI example shows how to create a Single Document Interface. It uses a number of top-level windows to display the contents of different text files. \image sdi-example.png diff --git a/doc/src/examples/securesocketclient.qdoc b/doc/src/examples/securesocketclient.qdoc index 30ba16a..655465c 100644 --- a/doc/src/examples/securesocketclient.qdoc +++ b/doc/src/examples/securesocketclient.qdoc @@ -29,7 +29,7 @@ \example network/securesocketclient \title Secure Socket Client Example - The Secure Socket Client example shows how to use QSslSocket to + \brief The Secure Socket Client example shows how to use QSslSocket to communicate over an encrypted (SSL) connection. It also demonstrates how to deal with authenticity problems, and how to display security and certificate information. diff --git a/doc/src/examples/semaphores.qdoc b/doc/src/examples/semaphores.qdoc index aeced47..3bbf028 100644 --- a/doc/src/examples/semaphores.qdoc +++ b/doc/src/examples/semaphores.qdoc @@ -29,7 +29,7 @@ \example threads/semaphores \title Semaphores Example - The Semaphores example shows how to use QSemaphore to control + \brief The Semaphores example shows how to use QSemaphore to control access to a circular buffer shared by a producer thread and a consumer thread. diff --git a/doc/src/examples/settingseditor.qdoc b/doc/src/examples/settingseditor.qdoc index a0fcc17..fc581fd 100644 --- a/doc/src/examples/settingseditor.qdoc +++ b/doc/src/examples/settingseditor.qdoc @@ -29,7 +29,7 @@ \example tools/settingseditor \title Settings Editor Example - The Settings Editor example shows how Qt's standard settings support is used in an + \brief The Settings Editor example shows how Qt's standard settings support is used in an application by providing an editor that enables the user to view the settings for installed applications, and modify those that can be edited. diff --git a/doc/src/examples/shapedclock.qdoc b/doc/src/examples/shapedclock.qdoc index e66b3ef..c46c5a7 100644 --- a/doc/src/examples/shapedclock.qdoc +++ b/doc/src/examples/shapedclock.qdoc @@ -29,7 +29,7 @@ \example widgets/shapedclock \title Shaped Clock Example - The Shaped Clock example shows how to apply a widget mask to a top-level + \brief The Shaped Clock example shows how to apply a widget mask to a top-level widget to produce a shaped window. \image shapedclock-example.png diff --git a/doc/src/examples/sharedmemory.qdoc b/doc/src/examples/sharedmemory.qdoc index 2f4088b..c67d3f5 100644 --- a/doc/src/examples/sharedmemory.qdoc +++ b/doc/src/examples/sharedmemory.qdoc @@ -29,9 +29,10 @@ \example ipc/sharedmemory \title Shared Memory Example - The Shared Memory example shows how to use the QSharedMemory class - to implement inter-process communication using shared memory. To - build the example, run make. To run the example, start two instances + \brief The Shared Memory example shows how to use the QSharedMemory class + to implement inter-process communication using shared memory. + + To build the example, run make. To run the example, start two instances of the executable. The main() function creates an \l {QApplication} {application} and an instance of our example's Dialog class. The dialog is displayed and then control is passed to the application in diff --git a/doc/src/examples/simpledecoration.qdoc b/doc/src/examples/simpledecoration.qdoc index 3c02009..7b033a6 100644 --- a/doc/src/examples/simpledecoration.qdoc +++ b/doc/src/examples/simpledecoration.qdoc @@ -30,7 +30,7 @@ \title Simple Decoration Example \ingroup qt-embedded - The Simple Decoration example shows how to create a custom window decoration + \brief The Simple Decoration example shows how to create a custom window decoration for embedded applications. \image embedded-simpledecoration-example.png diff --git a/doc/src/examples/simpledommodel.qdoc b/doc/src/examples/simpledommodel.qdoc index b7fae91..2f7dd41 100644 --- a/doc/src/examples/simpledommodel.qdoc +++ b/doc/src/examples/simpledommodel.qdoc @@ -29,7 +29,7 @@ \example itemviews/simpledommodel \title Simple DOM Model Example - The Simple DOM Model example shows how an existing class can be adapted for use with + \brief The Simple DOM Model example shows how an existing class can be adapted for use with the model/view framework. \image simpledommodel-example.png diff --git a/doc/src/examples/simpleselector.qdoc b/doc/src/examples/simpleselector.qdoc index 4455c2b..28f9707 100644 --- a/doc/src/examples/simpleselector.qdoc +++ b/doc/src/examples/simpleselector.qdoc @@ -29,7 +29,7 @@ \example webkit/simpleselector \title Simple Selector Example - The Simple Selector example shows how to use QWebElement to access the + \brief The Simple Selector example shows how to use QWebElement to access the Document Object Model (DOM) in a Web page. \image webkit-simpleselector.png diff --git a/doc/src/examples/simpletextviewer.qdoc b/doc/src/examples/simpletextviewer.qdoc index bf44938..6bb1420 100644 --- a/doc/src/examples/simpletextviewer.qdoc +++ b/doc/src/examples/simpletextviewer.qdoc @@ -29,7 +29,7 @@ \example help/simpletextviewer \title Simple Text Viewer Example - The Simple Text Viewer example shows how to use \QA as a customized + \brief The Simple Text Viewer example shows how to use \QA as a customized help viewer for your application. This is done in two stages. Firstly, documentation is created and \QA diff --git a/doc/src/examples/simpletreemodel.qdoc b/doc/src/examples/simpletreemodel.qdoc index 00464b2..7989893 100644 --- a/doc/src/examples/simpletreemodel.qdoc +++ b/doc/src/examples/simpletreemodel.qdoc @@ -29,9 +29,10 @@ \example itemviews/simpletreemodel \title Simple Tree Model Example - The Simple Tree Model example shows how to create a basic, read-only - hierarchical model to use with Qt's standard view classes. For a - description of simple non-hierarchical list and table models, see the + \brief The Simple Tree Model example shows how to create a basic, read-only + hierarchical model to use with Qt's standard view classes. + + For a description of simple non-hierarchical list and table models, see the \l{Model/View Programming} overview. \image simpletreemodel-example.png diff --git a/doc/src/examples/simplewebplugin.qdoc b/doc/src/examples/simplewebplugin.qdoc new file mode 100644 index 0000000..185cc85 --- /dev/null +++ b/doc/src/examples/simplewebplugin.qdoc @@ -0,0 +1,181 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/simplewebplugin + \title Simple Web Plugin Example + + \brief The Simple Web Plugin example shows how to embed a regular Qt widget into a + Web page displayed using QWebView. + + \image webkit-simplewebplugin.png A table widget embedded in a Web page. + + In this example, we will show how to include Qt widgets in Web-centric user + interfaces. + + \section1 QtWebKit Basics + + QtWebKit provides integration between Qt and WebKit on two different levels. + On a low level, Qt provides widgets for Web pages to be rendered onto; on a + high level, a set of classes are provided that represent all the key + components of a Web browser. + + QWebView is a widget that is used to display Web pages, QWebPage represents + the content in a page, and QWebFrame represents an individual frame in a + Web page. The code to display a Web page is very simple: + + \snippet webkitsnippets/simple/main.cpp Using QWebView + + The widget provides fundamental Web browsing features, such as Cascading + Style Sheet and JavaScript support. Other technologies can be added to + provide a more comprehensive experience. + + \section1 Adding a Widget to a Page + + Since Qt is used to render pages, it is easy to add both standard and + custom widgets to pages. All we need is some markup to indicate where a + widget is expected in a page and a mechanism that lets us know when it + needs to be created. + + The markup used involves the \c <object> element, described in the HTML 4 + specification, which is used to include generic objects in Web pages. When + describing an object to represent a widget, there are typically three + attributes this element can have: a \c data attribute that indicates where + any relevant data can be obtained; \c width and \c height attributes can + be used to set the size of the widget on the page. + + Here's how we might describe such an object: + + \snippet examples/webkit/simplewebplugin/pages/index.html embedded object + + The mechanism used by QtWebKit to insert widgets into pages is a plugin + factory that is registered with a given WebPage instance. Factories are + subclasses of QWebPluginFactory and can be equipped to supply more than one + type of widget. + + \section1 Creating a Widget to Embed + + To demonstrate how the factory is used, we create a simple widget that can + be used to display Comma-Separated Values (CSV) files. The widget class, + \c CSVView, is just a subclass of QTableView with extra functions to set + up an internal data model. Instances of the factory class, \c CSVFactory, + are responsible for creating \c CSVView widgets and requesting data on + their behalf. + + The \c CSVFactory class is defined in the following way: + + \snippet examples/webkit/simplewebplugin/csvfactory.h plugin factory + + The public functions give a good overview of how QtWebKit will use the + factory to create widgets. We begin by looking at the factory's constructor: + + \snippet examples/webkit/simplewebplugin/csvfactory.cpp constructor + + The factory contains a network access manager which we will use to obtain + data for each of the plugin widgets created. + + The \c plugins() function is used to report information + about the kinds of widget plugins it can create; our implementation reports + the MIME type it expects and provides a description of the plugin: + + \snippet examples/webkit/simplewebplugin/csvfactory.cpp plugins + + The \c create() function is where most of the action happens. It is + called with a MIME type that describes the kind of data to be displayed, + a URL that refers to the data, and information about any additional + arguments that were specified in the Web page. We begin by checking the + basic MIME type information passed in the \c mimeType parameter, and only + continue if we recognize it. + + \snippet examples/webkit/simplewebplugin/csvfactory.cpp begin create + + We construct a view widget + using the fully-specified MIME type, which is guaranteed to be in the list of + arguments if a MIME type has been supplied. + + \snippet examples/webkit/simplewebplugin/csvfactory.cpp submit request + + Lastly, we use the network access manager to request the data specified by + the \c url parameter, connecting its \c finished() signal to the view's + \c updateModel() slot so that it can collect the data. The reply object is + intentionally created on the heap; the \c finished() signal is connected to + its \c deleteLater() slot, ensuring that Qt will dispose of it when it is no + longer needed. + + The \c CSVView class provides only minor extensions to the functionality of + QTableView, with a public slot to handle incoming data and a private + variable to record exact MIME type information: + + \snippet examples/webkit/simplewebplugin/csvview.h definition + + The constructor is simply used to record the MIME type of the data: + + \snippet examples/webkit/simplewebplugin/csvview.cpp constructor + + To save space, we will only look at parts of the \c updateModel() function, + which begins by obtaining the QNetworkReply object that caused the slot + to be invoked before checking for errors: + + \snippet examples/webkit/simplewebplugin/csvview.cpp update model begin + + Assuming that the data is correct, we need to determine whether the + CSV file includes a table header, and to find out which character encoding was + used to store the data. Both these pieces of information may be included in + the complete MIME type information, so we parse this before continuing---this + is shown in the online example code. + + \snippet examples/webkit/simplewebplugin/csvview.cpp read data begin + + Since QNetworkReply is a QIODevice subclass, the reply can be read + using a suitably configured text stream, and the data fed into a standard + model. The mechanics of this can be found in the + \l{webkit/simplewebplugin/csvview.cpp}{code listing}. Here, we skip to the + end of the function where we close the reply object and set the model on + the view: + + \snippet examples/webkit/simplewebplugin/csvview.cpp update model + + Once the reply has been read, and the model populated with data, very little + needs to be done by the plugin. Ownership of the view widget is handled + elsewhere, and we have ensured that the model will be destroyed when it is + no longer needed by making it a child object of the view. + + Let's look quickly at the \c MainWindow implementation: + + \snippet examples/webkit/simplewebplugin/mainwindow.cpp constructor + + Apart from creating and setting a factory on the QWebPage object, the + most important task is to enable Web plugins. If this global setting is not + enabled, plugins will not be used and our \c <object> elements will simply + be ignored. + + \section1 Further Reading + + The \l{Web Plugin Example} extends this example by adding a signal-slot + connection between the embedded widget and a JavaScript function in the + page. +*/ diff --git a/doc/src/examples/simplewidgetmapper.qdoc b/doc/src/examples/simplewidgetmapper.qdoc index 60837fc..705da4b 100644 --- a/doc/src/examples/simplewidgetmapper.qdoc +++ b/doc/src/examples/simplewidgetmapper.qdoc @@ -29,7 +29,7 @@ \example itemviews/simplewidgetmapper \title Simple Widget Mapper Example - The Simple Widget Mapper example shows how to use a widget mapper to display + \brief The Simple Widget Mapper example shows how to use a widget mapper to display data from a model in a collection of widgets. \image simplewidgetmapper-example.png diff --git a/doc/src/examples/sipdialog.qdoc b/doc/src/examples/sipdialog.qdoc index 349ab18..ce78a9e 100644 --- a/doc/src/examples/sipdialog.qdoc +++ b/doc/src/examples/sipdialog.qdoc @@ -30,7 +30,7 @@ \title SIP Dialog Example \ingroup qtce - The SIP Dialog example shows how to create a dialog that is aware of + \brief The SIP Dialog example shows how to create a dialog that is aware of the Windows Mobile SIP (Software Input Panel) and reacts to it. \table diff --git a/doc/src/examples/sliders.qdoc b/doc/src/examples/sliders.qdoc index 7e47dcc..fc8af36 100644 --- a/doc/src/examples/sliders.qdoc +++ b/doc/src/examples/sliders.qdoc @@ -29,7 +29,7 @@ \example widgets/sliders \title Sliders Example - Qt provides three types of slider-like widgets: QSlider, + \brief Qt provides three types of slider-like widgets: QSlider, QScrollBar and QDial. They all inherit most of their functionality from QAbstractSlider, and can in theory replace each other in an application since the differences only concern diff --git a/doc/src/examples/spinboxdelegate.qdoc b/doc/src/examples/spinboxdelegate.qdoc index 50d5b9c..62f3ced 100644 --- a/doc/src/examples/spinboxdelegate.qdoc +++ b/doc/src/examples/spinboxdelegate.qdoc @@ -29,7 +29,7 @@ \example itemviews/spinboxdelegate \title Spin Box Delegate Example - The Spin Box Delegate example shows how to create an editor for a custom delegate in + \brief The Spin Box Delegate example shows how to create an editor for a custom delegate in the model/view framework by reusing a standard Qt editor widget. The model/view framework provides a standard delegate that is used by default diff --git a/doc/src/examples/spinboxes.qdoc b/doc/src/examples/spinboxes.qdoc index e87faf1..575d99d 100644 --- a/doc/src/examples/spinboxes.qdoc +++ b/doc/src/examples/spinboxes.qdoc @@ -29,7 +29,7 @@ \example widgets/spinboxes \title Spin Boxes Example - The Spin Boxes example shows how to use the many different types of spin boxes + \brief The Spin Boxes example shows how to use the many different types of spin boxes available in Qt, from a simple QSpinBox widget to more complex editors like the QDateTimeEdit widget. diff --git a/doc/src/examples/sqlwidgetmapper.qdoc b/doc/src/examples/sqlwidgetmapper.qdoc index cf1a158..453c811 100644 --- a/doc/src/examples/sqlwidgetmapper.qdoc +++ b/doc/src/examples/sqlwidgetmapper.qdoc @@ -29,7 +29,7 @@ \example sql/sqlwidgetmapper \title SQL Widget Mapper Example - The SQL Widget Mapper example shows how to use a map information from a + \brief The SQL Widget Mapper example shows how to use a map information from a database to widgets on a form. \image sql-widget-mapper.png diff --git a/doc/src/examples/standarddialogs.qdoc b/doc/src/examples/standarddialogs.qdoc index 92005b4..d187715 100644 --- a/doc/src/examples/standarddialogs.qdoc +++ b/doc/src/examples/standarddialogs.qdoc @@ -29,7 +29,7 @@ \example dialogs/standarddialogs \title Standard Dialogs Example - The Standard Dialogs example shows the standard dialogs that are provided by Qt. + \brief The Standard Dialogs example shows the standard dialogs that are provided by Qt. \image standarddialogs-example.png */ diff --git a/doc/src/examples/stardelegate.qdoc b/doc/src/examples/stardelegate.qdoc index 3b009d5..b94935e 100644 --- a/doc/src/examples/stardelegate.qdoc +++ b/doc/src/examples/stardelegate.qdoc @@ -29,7 +29,7 @@ \example itemviews/stardelegate \title Star Delegate Example - The Star Delegate example shows how to create a delegate that + \brief The Star Delegate example shows how to create a delegate that can paint itself and that supports editing. \image stardelegate.png The Star Delegate Example @@ -42,12 +42,12 @@ editing takes place. Delegates are subclasses of QAbstractItemDelegate. Qt provides - QItemDelegate, which inherits QAbstractItemDelegate and handles - the most common data types (notably \c int and QString). If we - need to support custom data types, or want to customize the + QStyledItemDelegate, which inherits QAbstractItemDelegate and + handles the most common data types (notably \c int and QString). + If we need to support custom data types, or want to customize the rendering or the editing for existing data types, we can subclass - QAbstractItemDelegate or QItemDelegate. See \l{Delegate Classes} - for more information about delegates, and \l{Model/View + QAbstractItemDelegate or QStyledItemDelegate. See \l{Delegate + Classes} for more information about delegates, and \l{Model/View Programming} if you need a high-level introduction to Qt's model/view architecture (including delegates). @@ -62,9 +62,9 @@ expressed as stars, such as "2 out of 5 stars" or "5 out of 6 stars". - \o \c StarDelegate inherits QItemDelegate and provides support + \o \c StarDelegate inherits QStyledItemDelegate and provides support for \c StarRating (in addition to the data types already - handled by QItemDelegate). + handled by QStyledItemDelegate). \o \c StarEditor inherits QWidget and is used by \c StarDelegate to let the user edit a star rating using the mouse. @@ -80,20 +80,20 @@ \snippet examples/itemviews/stardelegate/stardelegate.h 0 All public functions are reimplemented virtual functions from - QItemDelegate to provide custom rendering and editing. + QStyledItemDelegate to provide custom rendering and editing. \section1 StarDelegate Class Implementation - The \l{QAbstractItemDelegate::}{paint()} function is - reimplemented from QItemDelegate and is called whenever the view - needs to repaint an item: + The \l{QAbstractItemDelegate::}{paint()} function is reimplemented + from QStyledItemDelegate and is called whenever the view needs to + repaint an item: \snippet examples/itemviews/stardelegate/stardelegate.cpp 0 The function is invoked once for each item, represented by a QModelIndex object from the model. If the data stored in the item is a \c StarRating, we paint it ourselves; otherwise, we let - QItemDelegate paint it for us. This ensures that the \c + QStyledItemDelegate paint it for us. This ensures that the \c StarDelegate can handle the most common data types. In the case where the item is a \c StarRating, we draw the diff --git a/doc/src/examples/states.qdoc b/doc/src/examples/states.qdoc index 815c969..284b4ec 100644 --- a/doc/src/examples/states.qdoc +++ b/doc/src/examples/states.qdoc @@ -29,7 +29,7 @@ \example animation/states \title States Example - The States example shows how to use the Qt state machine to play + \brief The States example shows how to use the Qt state machine to play animations. \image states-example.png diff --git a/doc/src/examples/stickman.qdoc b/doc/src/examples/stickman.qdoc index 8c35fe1..d980586 100644 --- a/doc/src/examples/stickman.qdoc +++ b/doc/src/examples/stickman.qdoc @@ -29,7 +29,7 @@ \example animation/stickman \title Stickman Example - The Stickman example shows how to animate transitions in a state machine to implement key frame + \brief The Stickman example shows how to animate transitions in a state machine to implement key frame animations. \image stickman-example.png diff --git a/doc/src/examples/styleplugin.qdoc b/doc/src/examples/styleplugin.qdoc index 59729c7..a38b8d7 100644 --- a/doc/src/examples/styleplugin.qdoc +++ b/doc/src/examples/styleplugin.qdoc @@ -29,7 +29,7 @@ \example tools/styleplugin \title Style Plugin Example - This example shows how to create a plugin that extends Qt with a new + \brief The Style Plugin example shows how to create a plugin that extends Qt with a new GUI look and feel. \image stylepluginexample.png diff --git a/doc/src/examples/styles.qdoc b/doc/src/examples/styles.qdoc index 5258c19..f9ac48c 100644 --- a/doc/src/examples/styles.qdoc +++ b/doc/src/examples/styles.qdoc @@ -29,7 +29,7 @@ \example widgets/styles \title Styles Example - The Styles example illustrates how to create custom widget + \brief The Styles example illustrates how to create custom widget drawing styles using Qt, and demonstrates Qt's predefined styles. \image styles-enabledwood.png Screenshot of the Styles example diff --git a/doc/src/examples/stylesheet.qdoc b/doc/src/examples/stylesheet.qdoc index a82d0d1..edb684b 100644 --- a/doc/src/examples/stylesheet.qdoc +++ b/doc/src/examples/stylesheet.qdoc @@ -29,7 +29,7 @@ \example widgets/stylesheet \title Style Sheet Example - The Style Sheet Example shows how to use style sheets. + \brief The Style Sheet Example shows how to use style sheets with Qt. \image stylesheet-pagefold.png Screen Shot of the Pagefold style sheet */ diff --git a/doc/src/examples/svgalib.qdoc b/doc/src/examples/svgalib.qdoc index dbdad0f..a0320e7 100644 --- a/doc/src/examples/svgalib.qdoc +++ b/doc/src/examples/svgalib.qdoc @@ -29,9 +29,11 @@ \example qws/svgalib \title Accelerated Graphics Driver Example - The Accelerated Graphics Driver example shows how you can write + \brief The Accelerated Graphics Driver example shows how you can write your own accelerated graphics driver and \l {add your graphics - driver to Qt for Embedded Linux}. In \l{Qt for Embedded Linux}, + driver to Qt for Embedded Linux}. + + In \l{Qt for Embedded Linux}, painting is a pure software implementation and is normally performed in two steps: The clients render each window onto a corresponding surface diff --git a/doc/src/examples/svggenerator.qdoc b/doc/src/examples/svggenerator.qdoc index 1fce379..ed5ea77 100644 --- a/doc/src/examples/svggenerator.qdoc +++ b/doc/src/examples/svggenerator.qdoc @@ -29,7 +29,7 @@ \example painting/svggenerator \title SVG Generator Example - The SVG Generator example shows how to add SVG file export to applications. + \brief The SVG Generator example shows how to add SVG file export to applications. \image svggenerator-example.png diff --git a/doc/src/examples/svgviewer.qdoc b/doc/src/examples/svgviewer.qdoc index f393b08..93671b6 100644 --- a/doc/src/examples/svgviewer.qdoc +++ b/doc/src/examples/svgviewer.qdoc @@ -29,7 +29,7 @@ \example painting/svgviewer \title SVG Viewer Example - The SVG Viewer example shows how to add SVG viewing support to applications. + \brief The SVG Viewer example shows how to add SVG viewing support to applications. \image svgviewer-example.png diff --git a/doc/src/examples/symbianvibration.qdoc b/doc/src/examples/symbianvibration.qdoc new file mode 100644 index 0000000..a6a3d52 --- /dev/null +++ b/doc/src/examples/symbianvibration.qdoc @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \example widgets/symbianvibration + \group all-examples + \title Symbian Vibration Example + + \brief The Symbian Vibrator example shows how to get fine-grained vibration + control on Symbian devices. + + Native Symbian APIs have to be used to enable vibration, since QtMobility + doesn't provide an interface for it yet. It is, however, planned to be + included in a future release. In anticipation for that, we make use of the + \c XQVibra class that was a part of the Mobile Extensions Technology Preview + API for Qt for Symbian. The pre-compiled libraries are no longer compatible + with Qt 4.6, but we can include the source code itself with the project. + + \image symbianvibration-example.png Screenshot of the Symbian Vibration example + + The example application divides the window into rectangles, which can be + pressed to make the device vibrate. Pressing different rectangles make the + device vibrate with different intensities. Each rectangle has a different + color and its intensity number is drawn on top of it. Moving the cursor + from one rectangle to another changes the vibration intensity to that of + the new one. Vibration stops when the mouse button has been released. It + is also possible to launch a short burst of vibration through the menu. + + The example consists of four classes: + + \list + \o \c XQVibra is the vibration interface class taken from the Mobile + Extensions for Qt for Symbian. + + \o \c XQVibraPrivate is the Symbian specific private implementation of the + vibration implementation. + + \o \c VibrationSurface is a custom widget that uses a XQVibra instance to + vibrate the device depending on where the user presses. + + \o \c MainWindow inherits from QMainWindow and contains a \c VibrationSurface + as its central widget, and also has a menu from which it is possible to + make the phone vibrate. + \endlist + + \section1 XQVibra Class Definition + + The \c XQVibra class uses the pimpl-idiom to hide the platform specific + implementation behind a common interface. Technically it would be possible + to support more target platforms, with only the addition of a private + implementation. The rest of the code would work the same, since only the + common interface is used. + + \snippet examples/widgets/symbianvibration/xqvibra.h 0 + + \c XQVibra provides a very simple interface for us to use. The interesting + part are the three slots \c start(), \c stop() and \c setIntensity(). Calling the start + method initiates vibration for the specified duration. Calling it while the + device is already vibrating causes it to stop the current one and start the + new one, even if the intensities are the same. The \c setIntensity() method + should be called before starting vibration. + + + \section1 VibrationSurface Class Definition + + \c VibrationSurface inherits from QWidget and acts like a controller for a + \c XQVibra object. It responds to mouse events and performs custom painting. + + \snippet examples/widgets/symbianvibration/vibrationsurface.h 0 + + The virtual event methods are reimplemented from QWidget. As can be seen, + there is no public programmable interface beyond what QWidget provides. + + + \section1 VibrationSurface Class Implementation + + Mouse events control the intensity of the vibration. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 0 + \codeline + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 1 + \codeline + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 2 + + Presses starts the vibration, movement changes the intensity and releases + stops the vibration. To set the right amount of vibration, the private + method \c applyIntensity() is used. It sets the vibration intensity according to + which rectangle the mouse currently resides in. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 3 + + We make sure only to change the intensity if it is different than last + time, so that the vibrator isn't stopped and restarted unnecessarily. + + The range of vibration intensity ranges from 0 to XQVibra::MaxIntensity. We + divide this range into a set of levels. The number of levels and the intensity + increase for each level are stored in two constants. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 4 + + Each rectangle has an intensity of one \c IntensityPerLevel more than the + previous one. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 5 + + The rectangles are either put in a row, if the widget's width is greater + than its height (landscape), otherwise they are put in a column (portrait). + Each rectangle's size is thus dependent on the length of the width or the + height of the widget, whichever is longer. The length is then divided by + the number of levels, which gets us either the height or the width of each + rectangle. The dx and dy specify the distance from one rectangle to the + next, which is the same as either the width or height of the rectangle. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 6 + + For each level of intensity, we draw a rectangle with increasing + brightness. On top of the rectangle a text label is drawn, specifying the + intesity of this level. We use the rectangle rect as a template for + drawing, and move it down or right at each iteration. + + The intensity is calculated by dividing the greater of the width and height + into \c NumberOfLevels slices. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 7 + + In case the widget's geometry is too small to fit all the levels, the user + interface will not work. For simplicity, we just return 0. + + When we know the axis along which the rectangles lie, we can find the one + in which the mouse cursor lie. + + \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 8 + + The final clamp of the intensity value at the end is necessary in case the + mouse coordinate lies outside the widget's geometry. + + + \section1 MainWindow Class Definition + + Here's the definition of the \c MainWindow class: + + \snippet examples/widgets/symbianvibration/mainwindow.h 0 + + \c MainWindow is a top level window that uses a \c XQVibra and a + \c VibrationSurface. It also adds a menu option to the menu bar which can + start a short vibration. + + \section1 MainWindow Class Implementation + + In the \c MainWindow constructor the \c XQVibra and the \c VibrationSurface + are created. An action is added to the menu and is connected to the vibrate + slot. + + \snippet examples/widgets/symbianvibration/mainwindow.cpp 0 + + The \c vibrate() slot offers a way to invoke the vibration in case no + mouse is present on the device. + + \snippet examples/widgets/symbianvibration/mainwindow.cpp 1 + + \section1 Symbian Vibration Library + + The \c XQVibra class requires a platform library to be included. It is + included in the \c .pro file for the symbian target. + + \quotefromfile examples/widgets/symbianvibration/symbianvibration.pro + \skipto /^symbian \{/ + \printuntil /^\}/ +*/ diff --git a/doc/src/examples/syntaxhighlighter.qdoc b/doc/src/examples/syntaxhighlighter.qdoc index 703bd62..13409dc 100644 --- a/doc/src/examples/syntaxhighlighter.qdoc +++ b/doc/src/examples/syntaxhighlighter.qdoc @@ -29,7 +29,7 @@ \example richtext/syntaxhighlighter \title Syntax Highlighter Example - The Syntax Highlighter example shows how to perform simple syntax + \brief The Syntax Highlighter example shows how to perform simple syntax highlighting by subclassing the QSyntaxHighlighter class. \image syntaxhighlighter-example.png @@ -239,4 +239,14 @@ function. The QSyntaxHighlighter class also provides the \l {QSyntaxHighlighter::document()}{document()} function which returns the currently set document. + + \section1 Other Code Editor Features + + It is possible to implement parenthesis matching with + QSyntaxHighlighter. The "Matching Parentheses with + QSyntaxHighlighter" article in Qt Quarterly 31 + (\l{http://doc.qt.nokia.com/qq/}) implements this. We also have + the \l{Code Editor Example}, which shows how to implement line + numbers and how to highlight the current line. + */ diff --git a/doc/src/examples/systray.qdoc b/doc/src/examples/systray.qdoc index e072c9d..22f3779 100644 --- a/doc/src/examples/systray.qdoc +++ b/doc/src/examples/systray.qdoc @@ -29,8 +29,7 @@ \example desktop/systray \title System Tray Icon Example - - The System Tray Icon example shows how to add an icon with a menu + \brief The System Tray Icon example shows how to add an icon with a menu and popup messages to a desktop environment's system tray. \image systemtray-example.png Screenshot of the System Tray Icon. diff --git a/doc/src/examples/tabdialog.qdoc b/doc/src/examples/tabdialog.qdoc index b192645..d450783 100644 --- a/doc/src/examples/tabdialog.qdoc +++ b/doc/src/examples/tabdialog.qdoc @@ -29,7 +29,7 @@ \example dialogs/tabdialog \title Tab Dialog Example - The Tab Dialog example shows how to construct a tab dialog using the + \brief The Tab Dialog example shows how to construct a tab dialog using the QTabWidget class. Dialogs provide an efficient way for the application to communicate diff --git a/doc/src/examples/tablemodel.qdoc b/doc/src/examples/tablemodel.qdoc index bd81763..ad2d557 100644 --- a/doc/src/examples/tablemodel.qdoc +++ b/doc/src/examples/tablemodel.qdoc @@ -29,7 +29,7 @@ \example sql/tablemodel \title Table Model Example - The Table Model example shows how to use a specialized SQL table model with table + \brief The Table Model example shows how to use a specialized SQL table model with table views to edit information in a database. \image tablemodel-example.png diff --git a/doc/src/examples/tablet.qdoc b/doc/src/examples/tablet.qdoc index 8639ab6..8c29642 100644 --- a/doc/src/examples/tablet.qdoc +++ b/doc/src/examples/tablet.qdoc @@ -29,7 +29,7 @@ \example widgets/tablet \title Tablet Example - This example shows how to use a Wacom tablet in Qt applications. + \brief The Tablet example shows how to use a Wacom tablet in Qt applications. \image tabletexample.png diff --git a/doc/src/examples/taskmenuextension.qdoc b/doc/src/examples/taskmenuextension.qdoc index a5562eb..2414ae4 100644 --- a/doc/src/examples/taskmenuextension.qdoc +++ b/doc/src/examples/taskmenuextension.qdoc @@ -29,7 +29,7 @@ \example designer/taskmenuextension \title Task Menu Extension Example - The Task Menu Extension example shows how to create a custom + \brief The Task Menu Extension example shows how to create a custom widget plugin for \l {Qt Designer Manual}{\QD}, and how to to use the QDesignerTaskMenuExtension class to provide custom task menu entries associated with the plugin. diff --git a/doc/src/examples/tetrix.qdoc b/doc/src/examples/tetrix.qdoc index e37d2b6..92e9e28 100644 --- a/doc/src/examples/tetrix.qdoc +++ b/doc/src/examples/tetrix.qdoc @@ -29,7 +29,7 @@ \example widgets/tetrix \title Tetrix Example - The Tetrix example is a Qt version of the classic Tetrix game. + \brief The Tetrix example is a Qt version of the classic Tetrix game. \image tetrix-example.png diff --git a/doc/src/examples/textfinder.qdoc b/doc/src/examples/textfinder.qdoc index fc6d2ba..87947ac 100644 --- a/doc/src/examples/textfinder.qdoc +++ b/doc/src/examples/textfinder.qdoc @@ -29,8 +29,10 @@ \example uitools/textfinder \title Text Finder Example - The Text Finder example demonstrates how to dynamically process forms - using the QtUiTools module. Dynamic form processing enables a form to + \brief The Text Finder example demonstrates how to dynamically process forms + using the QtUiTools module. + + Dynamic form processing enables a form to be processed at run-time only by changing the UI file for the project. The program allows the user to look up a particular word within the contents of a text file. This text file is included in the project's diff --git a/doc/src/examples/textobject.qdoc b/doc/src/examples/textobject.qdoc index 30bf417..a108038 100644 --- a/doc/src/examples/textobject.qdoc +++ b/doc/src/examples/textobject.qdoc @@ -29,7 +29,7 @@ \example richtext/textobject \title Text Object Example - The Text Object example shows how to insert an SVG file into a + \brief The Text Object example shows how to insert an SVG file into a QTextDocument. \image textobject-example.png diff --git a/doc/src/examples/textures.qdoc b/doc/src/examples/textures.qdoc index 52bde78..09f6d9a 100644 --- a/doc/src/examples/textures.qdoc +++ b/doc/src/examples/textures.qdoc @@ -29,7 +29,7 @@ \example opengl/textures \title Textures Example - The Textures example demonstrates the use of Qt's image classes as textures in + \brief The Textures example demonstrates the use of Qt's image classes as textures in applications that use both OpenGL and Qt to display graphics. \image textures-example.png diff --git a/doc/src/examples/threadedfortuneserver.qdoc b/doc/src/examples/threadedfortuneserver.qdoc index 87da054..855d735 100644 --- a/doc/src/examples/threadedfortuneserver.qdoc +++ b/doc/src/examples/threadedfortuneserver.qdoc @@ -29,9 +29,11 @@ \example network/threadedfortuneserver \title Threaded Fortune Server Example - The Threaded Fortune Server example shows how to create a server for a + \brief The Threaded Fortune Server example shows how to create a server for a simple network service that uses threads to handle requests from different - clients. It is intended to be run alongside the Fortune Client example. + clients. + + The example is intended to be run alongside the Fortune Client example. \image threadedfortuneserver-example.png diff --git a/doc/src/examples/tooltips.qdoc b/doc/src/examples/tooltips.qdoc index 9786c40..4abdf99 100644 --- a/doc/src/examples/tooltips.qdoc +++ b/doc/src/examples/tooltips.qdoc @@ -29,7 +29,7 @@ \example widgets/tooltips \title Tool Tips Example - The Tool Tips example shows how to provide static and dynamic tool + \brief The Tool Tips example shows how to provide static and dynamic tool tips for an application's widgets. The simplest and most common way to set a widget's tool tip is by diff --git a/doc/src/examples/torrent.qdoc b/doc/src/examples/torrent.qdoc index 86c0b0c..9082441 100644 --- a/doc/src/examples/torrent.qdoc +++ b/doc/src/examples/torrent.qdoc @@ -29,7 +29,7 @@ \example network/torrent \title Torrent Example - The Torrent example is a functional BitTorrent client that + \brief The Torrent example is a functional BitTorrent client that illustrates how to write a complex TCP/IP application using Qt. \image torrent-example.png diff --git a/doc/src/examples/touch-dials.qdoc b/doc/src/examples/touch-dials.qdoc index f80e72e..008a7f2 100644 --- a/doc/src/examples/touch-dials.qdoc +++ b/doc/src/examples/touch-dials.qdoc @@ -29,7 +29,7 @@ \example touch/dials \title Touch Dials Example - The Touch Dials example shows how to apply touch to a set of + \brief The Touch Dials example shows how to apply touch to a set of standard Qt widgets. \image touch-dials-example.png diff --git a/doc/src/examples/touch-knobs.qdoc b/doc/src/examples/touch-knobs.qdoc index 44ff8a8..4abc64c 100644 --- a/doc/src/examples/touch-knobs.qdoc +++ b/doc/src/examples/touch-knobs.qdoc @@ -29,7 +29,7 @@ \example touch/knobs \title Touch Knobs Example - The Touch Knobs example shows how to create custom controls that + \brief The Touch Knobs example shows how to create custom controls that accept touch input. \image touch-knobs-example.png diff --git a/doc/src/examples/trafficinfo.qdoc b/doc/src/examples/trafficinfo.qdoc index dc12f37..b73f5ce 100644 --- a/doc/src/examples/trafficinfo.qdoc +++ b/doc/src/examples/trafficinfo.qdoc @@ -29,7 +29,7 @@ \example xmlpatterns/trafficinfo \title TrafficInfo Example - Shows how XQuery can be used extract information from WML documents provided by a WAP service. + \brief The Traffic Info example shows how XQuery can be used extract information from WML documents provided by a WAP service. \section1 Overview diff --git a/doc/src/examples/trafficlight.qdoc b/doc/src/examples/trafficlight.qdoc index 828195e..cf6bb19 100644 --- a/doc/src/examples/trafficlight.qdoc +++ b/doc/src/examples/trafficlight.qdoc @@ -29,7 +29,7 @@ \example statemachine/trafficlight \title Traffic Light Example - The Traffic Light example shows how to use \l{The State Machine Framework} + \brief The Traffic Light example shows how to use \l{The State Machine Framework} to implement the control flow of a traffic light. \image trafficlight-example.png diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc index 26b558c..c4888f9 100644 --- a/doc/src/examples/transformations.qdoc +++ b/doc/src/examples/transformations.qdoc @@ -29,7 +29,7 @@ \example painting/transformations \title Transformations Example - The Transformations example shows how transformations influence + \brief The Transformations example shows how transformations influence the way that QPainter renders graphics primitives. In particular it shows how the order of transformations affect the result. diff --git a/doc/src/examples/treemodelcompleter.qdoc b/doc/src/examples/treemodelcompleter.qdoc index 4caba0d..94c363e 100644 --- a/doc/src/examples/treemodelcompleter.qdoc +++ b/doc/src/examples/treemodelcompleter.qdoc @@ -29,7 +29,7 @@ \example tools/treemodelcompleter \title Tree Model Completer Example - The Tree Model Completer example shows how to provide completion + \brief The Tree Model Completer example shows how to provide completion facilities for a hierarchical model, using a period as the separator to access Child, GrandChild and GrandGrandChild level objects. diff --git a/doc/src/examples/trivialwizard.qdoc b/doc/src/examples/trivialwizard.qdoc index e654a78..df8378f 100644 --- a/doc/src/examples/trivialwizard.qdoc +++ b/doc/src/examples/trivialwizard.qdoc @@ -29,7 +29,7 @@ \example dialogs/trivialwizard \title Trivial Wizard Example - The Trivial Wizard example illustrates how to create a linear three-page + \brief The Trivial Wizard example illustrates how to create a linear three-page registration wizard using three instances of QWizardPage and one instance of QWizard. diff --git a/doc/src/examples/trollprint.qdoc b/doc/src/examples/trollprint.qdoc index de6cc60..faa6405 100644 --- a/doc/src/examples/trollprint.qdoc +++ b/doc/src/examples/trollprint.qdoc @@ -29,7 +29,7 @@ \example linguist/trollprint \title Troll Print Example - Troll Print is an example application that lets the user choose + \brief Troll Print is an example application that lets the user choose printer settings. It comes in two versions: English and Portuguese. diff --git a/doc/src/examples/twowaybutton.qdoc b/doc/src/examples/twowaybutton.qdoc index b42615e..8e3f5a6 100644 --- a/doc/src/examples/twowaybutton.qdoc +++ b/doc/src/examples/twowaybutton.qdoc @@ -29,7 +29,7 @@ \example statemachine/twowaybutton \title Two-way Button Example - The Two-way button example shows how to use \l{The State Machine + \brief The Two-way button example shows how to use \l{The State Machine Framework} to implement a simple state machine that toggles the current state when a button is clicked. diff --git a/doc/src/examples/undoframework.qdoc b/doc/src/examples/undoframework.qdoc index 15372ec..2fdb4cf 100644 --- a/doc/src/examples/undoframework.qdoc +++ b/doc/src/examples/undoframework.qdoc @@ -29,7 +29,7 @@ \example tools/undoframework \title Undo Framework Example - This example shows how to implement undo/redo functionality + \brief The Undo Framework example shows how to implement undo/redo functionality with the Qt undo framework. \image undoframeworkexample.png The Undo Diagram Example diff --git a/doc/src/examples/videographicsitem.qdoc b/doc/src/examples/videographicsitem.qdoc index f52e043..76f54cb 100644 --- a/doc/src/examples/videographicsitem.qdoc +++ b/doc/src/examples/videographicsitem.qdoc @@ -29,7 +29,7 @@ \example multimedia/videographicsitem \title Video Graphics Item Example - The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a + \brief The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a graphics scene using QtMultimedia's QAbstractVideoSurface. \image video-videographicsitem.png diff --git a/doc/src/examples/videowidget.qdoc b/doc/src/examples/videowidget.qdoc index c9a87ce..d2dab10 100644 --- a/doc/src/examples/videowidget.qdoc +++ b/doc/src/examples/videowidget.qdoc @@ -29,7 +29,7 @@ \example multimedia/videowidget \title Video Widget Example - The Video Widget example shows how to implement a video widget using + \brief The Video Widget example shows how to implement a video widget using QtMultimedia's QAbstractVideoSurface \image video-videowidget.png diff --git a/doc/src/examples/waitconditions.qdoc b/doc/src/examples/waitconditions.qdoc index 0d0cd1b..f2f07c5 100644 --- a/doc/src/examples/waitconditions.qdoc +++ b/doc/src/examples/waitconditions.qdoc @@ -29,7 +29,7 @@ \example threads/waitconditions \title Wait Conditions Example - The Wait Conditions example shows how to use QWaitCondition and + \brief The Wait Conditions example shows how to use QWaitCondition and QMutex to control access to a circular buffer shared by a producer thread and a consumer thread. diff --git a/doc/src/examples/webftpclient.qdoc b/doc/src/examples/webftpclient.qdoc new file mode 100644 index 0000000..47006f9 --- /dev/null +++ b/doc/src/examples/webftpclient.qdoc @@ -0,0 +1,336 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/webftpclient + \title Web FTP Client Example + + \brief The Web FTP Client example shows how to add support for a new protocol + to QtWebKit-based applications. + + \image webkit-webftpclient.png An FTP client displaying the contents of the ftp.qt.nokia.com site. + + \section1 Introduction + + The QtWebKit module presents many ways to integrate the worlds of native + desktop and mobile applications and the Web, making it possible for + developers to extend and combine features found in Qt and WebKit to create + new ones. In this article, we examine the use of Qt's network access API + with WebKit and show how to turn QWebView into a simple FTP client. + + In the \l{Web Plugin Example}, we extended Qt's WebKit integration by + showing how to add custom widgets to Web pages. In the article, we used + QNetworkRequest to ask for content for display in a widget, and we obtained + the data returned by the server by reading from the corresponding + QNetworkReply. + + Qt's network access API is a technology that aims to replace much, but not + all, of the functionality provided by the QHttp and QFtp classes. + Although the network access API is a Qt-specific technology, the QtWebKit + module integrates this Qt technology with WebKit to enable customization of + the browser engine by Qt application developers. It also means that we can + control how the browser engine obtains and renders content. + + Since QNetworkRequest and QNetworkReply are designed to provide a reusable + abstraction for network operations, it seems obvious to use these classes + to add FTP support to browsers written using QtWebKit. To do this, we first + need to examine the network access classes before we see how the QtWebKit + module uses them to manage network operations. + + \section1 Network Access + + The central class in Qt's network access API is QNetworkAccessManager. + This class performs the work of dispatching requests to remote servers and + handling incoming replies. Applications typically construct an instance of + this class and use it for all high level network communication. + + Applications create QNetworkRequest objects, each of them specifying a URL + where the request is to be sent and containing meta-data that will be + understood by the server. Each request is dispatched by passing it to a + function in the network manager \mdash there are different functions + corresponding to different kinds of operations, such as + \l{QNetworkAccessManager::}{get()}, \l{QNetworkAccessManager::}{put()} and + \l{QNetworkAccessManager::}{post()}. Each of these functions returns a + QNetworkReply object which is used to obtain the content sent in the reply, + as well as any meta-data that describes it. + + The QtWebKit module provides the QWebPage class which represents the + content displayed in a QWebView widget. Behind the scenes, this class uses + a default network access manager to handle network communication. This + default manager works perfectly well for fetching content over HTTP from + \tt{http://} URLs, but only supports fetching of files over FTP when using + \tt{ftp://} URLs. + + Fortunately, QWebPage provides the \l{QWebPage::}{setNetworkAccessManager()} + function that allows the default manager to be replaced with one with more + features. This lets us add improved support for FTP quite easily if we can + write a new manager that supports \tt{ftp://} URLs. + + The process of replacing the manager and using a new one with an existing + QWebPage object can be broken up into three steps: + + \list 1 + \o Creating a new QNetworkAccessManager subclass. + \o Creating a new QNetworkReply subclass to deal with the FTP protocol. + \o Setting the new manager on the QWebPage. + \endlist + + Additionally, to provide a reasonable user experience, we should also handle + content that the browser engine cannot display. To do this, we create a + custom \c{Downloader} object. We will briefly return to this topic later. + + \section1 Creating a New Network Manager + + Replacing an existing network manager for a QWebPage is conceptually simple: + we subclass QNetworkAccessManager and reimplement its + \l{QNetworkAccessManager::}{createRequest()} function to check for URLs + with the \tt{ftp} scheme. However, we want to ensure that the manager uses + any existing cache and proxy settings that may have been set up for the + existing manager used by the QWebPage. + + To keep the existing proxy and cache, we give our network manager a + constructor that accepts the old manager as an argument. In the constructor, + we reuse the settings from the old manager. + + \snippet examples/webkit/webftpclient/networkaccessmanager.cpp constructor + + The \c{createRequest()} function is used to create and dispatch requests to + remote servers for each of the different kinds of operation that the API + presents to the developer. Since we are only interested in performing simple + fetches of resources using the \tt{ftp} scheme, we filter out other schemes + and other kinds of operation, delegating the task of handling these to the + default implementation. + + \snippet examples/webkit/webftpclient/networkaccessmanager.cpp create request + + Here, we construct and return an instance of the \c FtpReply class. This + class performs most of the work of handling the FTP protocol. + + \section1 Creating a Custom Reply + + The network access API is designed to be simple to use: we set up a request, + dispatch it using the network manager, and obtain a QNetworkReply object. + If we are not interested in the reply's meta-data, we can simply read the + data using its \l{QNetworkReply::}{readAll()} function because QNetworkReply + is a QIODevice subclass. + + In order to keep the API so simple, however, we need to perform some work + behind the scenes. In this case, that means that we must perform a series of + communications with the FTP server. Fortunately, we can use the existing + implementation provided by QFtp to perform the low level work. + + In the \c FtpReply class, we need to reimplement four functions in the + API to ensure that it will work correctly. These functions, + \l{QNetworkReply::}{abort()}, \l{QIODevice::}{bytesAvailable()}, + \l{QIODevice::}{isSequential()}, \l{QIODevice::}{readData()}, + rely on the rest of the implementation to fill a QByteArray with data and + use an integer offset to track how much has been read from the device by + the browser. + + \snippet examples/webkit/webftpclient/ftpreply.h class definition + + The \c{processCommand()}, \c{processListInfo} and \c{processData()} slots + handle interaction with the FTP server. The private \c{setContent()} and + \c{setListContent()} functions are used to add meta-data to the reply and + compose HTML for the browser to display. + + Two of the private variables hold information about the data obtained from + the FTP server: \c items is updated to contain information about each + file found at a given URL, and \c content contains the raw data obtained + from the server. The \c offset variable is used to track how much data has + been read by the browser from the reply. + + In the constructor, we construct a QFtp object and connect the signals and + slots that form the basis of the interaction with the FTP server. The high + level communication is reported by the \l{QFtp::}{commandFinished()} + signal. New data from the server is reported by the + \l{QFtp::}readyRead()} signal. + Individual items in an FTP directory listing are reported by the + \l{QFtp::}{listInfo()} signal. + + \snippet examples/webkit/webftpclient/ftpreply.cpp constructor + + We also initialize the \c offset into the data that represents the number + of bytes that the browser has read from the reply. Additionally, we define + a list of units for use with the \c setListContent() function. + The last two tasks performed in the constructor are to set the URL of the + reply so that the browser can tell where it came from, and to connect to + the FTP server. + + \section2 Fetching Data from the Server + + All communication with the server is handled by the \c processCommand() + slot, which acts on responses from the server and tells us when a command + we have issued has completed. + This slot performs the task of logging in to the server when connection has + occurred (the \l{QFtp::}{ConnectToHost} command has completed), asking for + a list of files when logged in (\l{QFtp::}{Login} has completed), + preparing a page with a listing when all file information has been received + (\l{QFtp::}{List} has completed), and setting the current content for the + reply when data has been fetched from the server + (\l{QFtp::}{Get} has completed). + + \snippet examples/webkit/webftpclient/ftpreply.cpp process command + + The result of the \l{QFtp::}{List} command is handled by looking at the + number of items obtained from the server. + The items themselves are recorded by the \c processListInfo() slot. When a + \l{QFtp::}{List} command is complete, we can count the number of items + received and determine whether or not we should create a file listing, or + try to fetch the file instead by invoking a \l{QFtp::}{Get} command. + + \snippet examples/webkit/webftpclient/ftpreply.cpp process list info + + Since the reply will only be used once, we can simply append items to a list + and never bother to clear it. + + The \c processData() slot simply appends data obtained from the FTP server + to the QByteArray containing the content to be supplied to the browser. + + \snippet examples/webkit/webftpclient/ftpreply.cpp process data + + Data is appended to the \c content array until the connection to the FTP + server is closed, either by the reply or by the server itself. One of the + ways in which this happens is when a \l{QFtp::}{Get} command completes. At + this point, the \c setContent() function is called from within the + \c processCommand() function. + + \snippet examples/webkit/webftpclient/ftpreply.cpp set content + + Here, we prepare the reply for use by the browser by opening it for + unbuffered reading and setting the header that reports the amount of data + held by the reply. We emit signals that indicate that the network operation + has finished and that it has data to be read. Since we are no longer + interested in the FTP server, we close the connection to it. + + \section2 Preparing Content for the Reader + + Another way in which the reply closes the connection to the server is when + the \c setListContent() function is called from the \c processCommand() + function. Most of the implementation of this function involves transforming + the information about the items held in the reply's private \c items + variable to HTML. + + \snippet examples/webkit/webftpclient/ftpreply.cpp set list content + + Once the HTML description of the files has been composed in a QString, we + convert it to a UTF-8 encoded set of bytes which we store in the reply's + private \c content variable. In this case, the QByteArray holds HTML + instead of file data. We set the reply's headers to indicate that it + contains UTF-8 encoded HTML with a certain length, and we emit the + \l{QNetworkReply::}{readyRead()} and \l{QNetworkReply::}{finished()} + signals to let the browser know that it can start reading the content. + + \section2 Supplying Data to the Browser + + We reimplement four QIODevice functions to provide basic read-only behavior, + simply supplying the data held in the \c content array. + + We do not support aborting of the reply, so our \c abort() implementation + is empty. + + \snippet examples/webkit/webftpclient/ftpreply.cpp abort + + Similarly, we do not support random access reading, so \c isSequential() + is reimplemented to always return true. + + \snippet examples/webkit/webftpclient/ftpreply.cpp is sequential + + The \c bytesAvailable() function returns the total number of bytes held by + the reply minus the value of \c offset, which is the number of bytes we + have already supplied to the reader. + + \snippet examples/webkit/webftpclient/ftpreply.cpp bytes available + + \snippet examples/webkit/webftpclient/ftpreply.cpp read data + + The \c readData() reimplementation tries to return as much data to the + reader as it will allow, copying bytes directly to the appropriate location + in memory. The \c offset variable is updated to keep track of how many + bytes have been read. + + \section1 Enabling the Protocol + + Now that we have an FTP-enabled network manager and a reply that can handle + communication with FTP servers, we can now enable the manager for a given + QWebPage. + We derive the \c FtpView class from QWebView and configure its behavior in + its constructor. + + As we mentioned earlier, we pass the original network manager to the + newly-created manager and pass the new manager to the QWebPage belonging to + the browser. This enables our network manager for the content it displays. + + \snippet examples/webkit/webftpclient/ftpview.cpp constructor + + We also go to some effort to handle content that WebKit does not natively + support, using a \c Downloader helper class to manage this and files that + the user downloads via the browser's \gui{Save Link...} context menu entry. + + In the example's \c main() function, we perform the usual steps to + initialize our Qt application. We choose an appropriate starting URL for + the \c FtpView widget to open before running the application's event loop. + + \snippet examples/webkit/webftpclient/main.cpp main + + \section1 Summary + + As we have seen, enabling support for another protocol and URL scheme in + QtWebKit is a fairly simple process involving the creation of a network + manager and custom reply object. The implementation challenges + are mostly related to how the protocol is handled by the custom + QNetworkReply subclass where, in our case, we need to issue the appropriate + commands in the correct order to obtain data from the FTP server. + + We also need to ensure that that the reply emits the appropriate signals to + inform the browser that it has content to be read. Our implementation is + intentionally simple, only notifying the browser with the + \l{QIODevice::}{readyRead()} signal when \e all the content is ready to + read and emitting the \l{QNetworkReply::}{finished()} signal to indicate + that communication is complete; a more sophisticated approach would + interleave the commands sent to the server with the emission of signals, + allowing the browser to read content as data is obtained from the FTP + server. + + The reply also needs to be open for reading. Forgetting to call the + \l{QIODevice::}{open()} function is a common error to make when dealing + with devices, but in this case it is the reply's responsibility to open + itself. + It must indicate how much content it has for the browser to read. As we + have seen, this is done by setting the reply's + \l{QNetworkRequest::}{ContentLengthHeader} header with the appropriate + value. With this information available, the browser can read from the reply + when the content becomes available, displaying a directory listing or + downloading content depending on the type of data supplied. + + We can use the approach described in this article to enable support for + other protocols by writing or extending a network manager to handle URL + schemes such as \tt mailto, \tt sip, \tt news, \tt file and \tt ldap. + Applications that integrate Web content with information from other sources + can also provide custom URL schemes as long as care is taken not to use an + existing public scheme. +*/ diff --git a/doc/src/examples/webkit-bridge-imageanalyzer.qdoc b/doc/src/examples/webkit-bridge-imageanalyzer.qdoc index a736879..7383abc 100644 --- a/doc/src/examples/webkit-bridge-imageanalyzer.qdoc +++ b/doc/src/examples/webkit-bridge-imageanalyzer.qdoc @@ -30,12 +30,13 @@ \startpage {index.html}{Qt Reference Documentation} \title The Webkit Bridge Tutorial - Hybrid Client Application - In this example, we will show how to write a hybrid application using + \brief In this example, we will show how to write a hybrid application using \l{The QtWebKit Bridge}{QtWebKit Bridge}, which distinguishes itself from a thin client in that it performs heavy calculations on the client side in C++, like a native application, but presents nothing more than a \c QWebView for its -user interface, displaying web content written in HTML/JavaScript. The -application uses QtConcurrent to distribute its work across as many CPU cores as +user interface, displaying web content written in HTML/JavaScript. + +The application uses QtConcurrent to distribute its work across as many CPU cores as are available from the system, so it can process each image in parallel. For the full reference documentation of QtWebKit hybrid development, see diff --git a/doc/src/examples/webkit-framecapture.qdoc b/doc/src/examples/webkit-framecapture.qdoc index 2d80c6a..1f9fa9f 100644 --- a/doc/src/examples/webkit-framecapture.qdoc +++ b/doc/src/examples/webkit-framecapture.qdoc @@ -29,7 +29,7 @@ \example webkit/framecapture \title WebKit Frame Capture Example - The Frame Capture example shows how to use the WebKit browser engine to + \brief The Frame Capture example shows how to use the WebKit browser engine to obtain images of frames in a Web page. This example is designed to be run from the command line. Run the diff --git a/doc/src/examples/webplugin.qdoc b/doc/src/examples/webplugin.qdoc new file mode 100644 index 0000000..c607bef --- /dev/null +++ b/doc/src/examples/webplugin.qdoc @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/webplugin + \title Web Plugin Example + + \brief The Web Plugin example shows how to communicate between a Qt widget + embedded in a Web page and the page itself. + + \image webkit-webplugin.png A table widget embedded in a Web page. + + In this example, we will take the widget described in the + \l{Simple Web Plugin Example} and show how to set up communications between + the widget and the Web environment. + + \section1 Setting up Communications + + There are two ways of interacting with the content in a Web page. The first + way involves the use of QWebElement to read and modify the page + content and structure; this is useful for certain types of application, as + demonstrated by the \l{DOM Traversal Example} and the + \l{Simple Selector Example}. + + The second way is to add Qt objects to the page, connecting their signals + to JavaScript functions, and executing the object's slots directly from + JavaScript in the page. We explore this approach in this example. + + To perform this communication, we require an updated \c CSVView widget from + the \l{Simple Web Plugin Example} that can emit a signal whenever a row is + selected, a JavaScript function to modify elements on the page, and some + glue code to make the connection. + + On the page, the plugin is declared like this: + + \snippet examples/webkit/webplugin/pages/index.html embedded object + + As in the previous example, the \c <object> definition includes information + about the data to be displayed, its location, and the dimensions of the + plugin in the page. + + Later in the document, we include a table that we will update with data + from the \c CSVView widget: + + \snippet examples/webkit/webplugin/pages/index.html table + + The \c CSVView widget is similar to the previous version. However, we + wish to obtain and export individual rows of data, so we define the + \c rowSelected() signal and \c exportRow() slot to perform this task. + + \snippet examples/webkit/webplugin/csvview.h definition + + Since we wish to obtain one row of data at a time, the constructor includes + code to restrict how the user can interact with the view: + + \snippet examples/webkit/simplewebplugin/csvview.cpp constructor + + The \c exportRow() slot provides a convenient mechanism for obtaining and + emitting the values found on the current row of the table: + + \snippet examples/webkit/webplugin/csvview.cpp export row + + This slot is connected to a signal belonging to the view's selection model: + \l{QItemSelectionModel::}{currentChanged()}. This can be seen by examining + the \c updateModel() function in the source code. + + \c exportRow() emits the \c rowSelected() signal, passing strings containing + the name, address and quantity in the current table row. To see how this + data is passed to the Web page, we need to look at the \c CSVFactory class. + + \section1 Connecting Components Together + + In the \c CSVFactory class, we reimplement the \l{QWebPluginFactory::}{create()} + function to create instances of the \c CSVView class, as in the previous + example. + + \snippet examples/webkit/webplugin/csvfactory.cpp begin create + + We also expose the view widget to the frame in the page that + contains the elements, and set up a connection between the view and a + JavaScript function defined in the page header: + + \snippet examples/webkit/webplugin/csvfactory.cpp create connection + + The view is added to the Web page as \c view, and the connection code we + evaluate performs a signal-slot connection from the view's \c rowSelected() + signal to a pure JavaScript function: + + \js + view.rowSelected.connect(fillInTable); + \endjs + + \c fillInTable is the name of the JavaScript function to modify the + form's input elements. This function expects three arguments: the name, + address and quantity values for a row of data. + + Whenever the current row changes in the \c view object, the \c exportRow() + slot is called, the data found in the selected row is extracted from the + model and emitted in the \c rowSelected() signal as three strings, and + the above connection ensures that \c fillInTable() will be called with the + current items of data. The appropriate type conversions occur behind the + scenes to ensure that each QString is converted to a JavaScript string + object. + + The rest of the function is the same as in the previous example: + + \snippet examples/webkit/webplugin/csvfactory.cpp submit request + + We now give the JavaScript \c fillInForm() function to show what it does + with the strings it is given. The function itself is defined in the HTML + page header: + + \snippet examples/webkit/webplugin/pages/index.html script + + We obtain the elements in the page that we wish to update by using the HTML + Document Object Model (DOM) API. The values of these elements are updated + with the \c name, \c address and \c quantity strings supplied. + + \section1 Linking Things Together + + Although we have used the widgets to demonstrate the use of signals and + slots for communication between Qt components and JavaScript in the browser, + we do not need to embed widgets in Web pages to be able to do this. By + inserting objects into pages and evaluating JavaScript, Qt applications can + be made to examine and process information found online. + + One additional improvement that can be made to this example is to create + a relation between the embedded widget and the table to be updated. We + could do this by including \c <param> elements within the \c <object> + element that refers to the table cells by their \c id attributes. This + would help us to avoid hard-coding the \c customers_name, + \c customers_address and \c customers_quantity identifiers in the script. +*/ diff --git a/doc/src/examples/widgets-softkeys.qdoc b/doc/src/examples/widgets-softkeys.qdoc index 336aac8..1c66718 100644 --- a/doc/src/examples/widgets-softkeys.qdoc +++ b/doc/src/examples/widgets-softkeys.qdoc @@ -29,5 +29,5 @@ \example widgets/softkeys \title Soft Keys Example - The Soft Keys example shows how to use soft key input on the Symbian platform. + \brief The Soft Keys example shows how to use soft key input on the Symbian platform. */ diff --git a/doc/src/examples/widgets-validators.qdoc b/doc/src/examples/widgets-validators.qdoc index d6c229d..1984d9f 100644 --- a/doc/src/examples/widgets-validators.qdoc +++ b/doc/src/examples/widgets-validators.qdoc @@ -29,5 +29,5 @@ \example widgets/validators \title Validators Example - The Validators example shows the signal emission behavior of input validators. + \brief The Validators example shows the signal emission behavior of input validators. */ diff --git a/doc/src/examples/wiggly.qdoc b/doc/src/examples/wiggly.qdoc index 3685741..2bb3d64 100644 --- a/doc/src/examples/wiggly.qdoc +++ b/doc/src/examples/wiggly.qdoc @@ -29,7 +29,7 @@ \example widgets/wiggly \title Wiggly Example - The Wiggly example shows how to animate a widget using + \brief The Wiggly example shows how to animate a widget using QBasicTimer and \l{QObject::timerEvent()}{timerEvent()}. In addition, the example demonstrates how to use QFontMetrics to determine the size of text on screen. diff --git a/doc/src/examples/windowflags.qdoc b/doc/src/examples/windowflags.qdoc index e690c37..d701498 100644 --- a/doc/src/examples/windowflags.qdoc +++ b/doc/src/examples/windowflags.qdoc @@ -29,7 +29,7 @@ \example widgets/windowflags \title Window Flags Example - The Window Flags example shows how to use the window flags + \brief The Window Flags example shows how to use the window flags available in Qt. A window flag is either a type or a hint. A type is used to diff --git a/doc/src/examples/worldtimeclockbuilder.qdoc b/doc/src/examples/worldtimeclockbuilder.qdoc index e8999ea..cf6d062 100644 --- a/doc/src/examples/worldtimeclockbuilder.qdoc +++ b/doc/src/examples/worldtimeclockbuilder.qdoc @@ -29,7 +29,7 @@ \example designer/worldtimeclockbuilder \title World Time Clock Builder Example - The World Time Clock Builder example shows how forms created with Qt + \brief The World Time Clock Builder example shows how forms created with Qt Designer that contain custom widgets can be dynamically generated at run-time. diff --git a/doc/src/examples/worldtimeclockplugin.qdoc b/doc/src/examples/worldtimeclockplugin.qdoc index 7b88708..ee1d534 100644 --- a/doc/src/examples/worldtimeclockplugin.qdoc +++ b/doc/src/examples/worldtimeclockplugin.qdoc @@ -29,7 +29,7 @@ \example designer/worldtimeclockplugin \title World Time Clock Plugin Example - The World Time Clock Plugin example shows how to create a custom + \brief The World Time Clock Plugin example shows how to create a custom widget plugin for \QD that uses signals and slots. \image worldtimeclockplugin-example.png diff --git a/doc/src/examples/xmlstreamlint.qdoc b/doc/src/examples/xmlstreamlint.qdoc index 98bee62..0a31fb0 100644 --- a/doc/src/examples/xmlstreamlint.qdoc +++ b/doc/src/examples/xmlstreamlint.qdoc @@ -29,7 +29,7 @@ \example xml/xmlstreamlint \title XML Stream Lint Example - The XML Stream Lint example provides a simple command line utility that + \brief The XML Stream Lint example provides a simple command line utility that accepts a file name as its single argument and writes it to the standard output file. |