diff options
author | David Boddie <dboddie@trolltech.com> | 2009-08-26 12:35:45 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-08-26 12:35:45 (GMT) |
commit | 7e30c92186878beb300a13093c3668ae8a10f2be (patch) | |
tree | 313aa7f7a8345e65b7803bae1cb68ad866bdadbc /doc | |
parent | b98042831f4f6f6c5844965731b2dd64f27c076e (diff) | |
parent | aeb4251c76560a070ce22320be00e860950b4668 (diff) | |
download | Qt-7e30c92186878beb300a13093c3668ae8a10f2be.zip Qt-7e30c92186878beb300a13093c3668ae8a10f2be.tar.gz Qt-7e30c92186878beb300a13093c3668ae8a10f2be.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'doc')
-rw-r--r-- | doc/doc.pri | 4 | ||||
-rw-r--r-- | doc/src/classes.qdoc | 123 | ||||
-rw-r--r-- | doc/src/classes/exportedfunctions.qdoc | 6 | ||||
-rw-r--r-- | doc/src/development/qmake-manual.qdoc | 458 | ||||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-dockwidget.txt (renamed from doc/src/diagrams/designer-adding-dockwidget.txt) | 0 | ||||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-dockwidget1.png (renamed from doc/src/diagrams/designer-adding-dockwidget1.png) | bin | 8897 -> 8897 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-dockwidget1.zip (renamed from doc/src/diagrams/designer-adding-dockwidget1.zip) | bin | 12252 -> 12252 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-menu-action1.png (renamed from doc/src/diagrams/designer-adding-menu-action1.png) | bin | 16173 -> 16173 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-menu-action1.zip (renamed from doc/src/diagrams/designer-adding-menu-action1.zip) | bin | 19245 -> 19245 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-menu-action2.zip (renamed from doc/src/diagrams/designer-adding-menu-action2.zip) | bin | 19587 -> 19587 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.png (renamed from doc/src/diagrams/designer-adding-toolbar-action1.png) | bin | 14911 -> 14911 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.zip (renamed from doc/src/diagrams/designer-adding-toolbar-action1.zip) | bin | 17515 -> 17515 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-adding-toolbar-action2.zip (renamed from doc/src/diagrams/designer-adding-toolbar-action2.zip) | bin | 15433 -> 15433 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-dynamic-property.png (renamed from doc/src/diagrams/designer-creating-dynamic-property.png) | bin | 7561 -> 7561 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry1.png (renamed from doc/src/diagrams/designer-creating-menu-entry1.png) | bin | 9618 -> 9618 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry1.zip (renamed from doc/src/diagrams/designer-creating-menu-entry1.zip) | bin | 11753 -> 11753 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry2.png (renamed from doc/src/diagrams/designer-creating-menu-entry2.png) | bin | 9090 -> 9090 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry2.zip (renamed from doc/src/diagrams/designer-creating-menu-entry2.zip) | bin | 11709 -> 11709 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry3.png (renamed from doc/src/diagrams/designer-creating-menu-entry3.png) | bin | 5435 -> 5435 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry3.zip (renamed from doc/src/diagrams/designer-creating-menu-entry3.zip) | bin | 11520 -> 11520 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry4.png (renamed from doc/src/diagrams/designer-creating-menu-entry4.png) | bin | 10141 -> 10141 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu-entry4.zip (renamed from doc/src/diagrams/designer-creating-menu-entry4.zip) | bin | 12473 -> 12473 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu.txt (renamed from doc/src/diagrams/designer-creating-menu.txt) | 0 | ||||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu1.png (renamed from doc/src/diagrams/designer-creating-menu1.png) | bin | 4733 -> 4733 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu1.zip (renamed from doc/src/diagrams/designer-creating-menu1.zip) | bin | 5279 -> 5279 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu2.png (renamed from doc/src/diagrams/designer-creating-menu2.png) | bin | 4296 -> 4296 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu2.zip (renamed from doc/src/diagrams/designer-creating-menu2.zip) | bin | 5295 -> 5295 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu3.png (renamed from doc/src/diagrams/designer-creating-menu3.png) | bin | 5053 -> 5053 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu3.zip (renamed from doc/src/diagrams/designer-creating-menu3.zip) | bin | 6197 -> 6197 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menu4.png (renamed from doc/src/diagrams/designer-creating-menu4.png) | bin | 5274 -> 5274 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menubar.png (renamed from doc/src/diagrams/designer-creating-menubar.png) | bin | 7024 -> 7024 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-creating-menubar.zip (renamed from doc/src/diagrams/designer-creating-menubar.zip) | bin | 10485 -> 10485 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-edit-resource.zip (renamed from doc/src/diagrams/designer-edit-resource.zip) | bin | 11195 -> 11195 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-find-icon.zip (renamed from doc/src/diagrams/designer-find-icon.zip) | bin | 47820 -> 47820 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-form-layoutfunction-crop.png (renamed from doc/src/diagrams/designer-form-layoutfunction-crop.png) | bin | 5132 -> 5132 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-form-layoutfunction.png (renamed from doc/src/diagrams/designer-form-layoutfunction.png) | bin | 15912 -> 15912 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-form-layoutfunction.zip (renamed from doc/src/diagrams/designer-form-layoutfunction.zip) | bin | 21179 -> 21179 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-main-window.zip (renamed from doc/src/diagrams/designer-main-window.zip) | bin | 35959 -> 35959 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui (renamed from doc/src/diagrams/designer-mainwindow-actions.ui) | 0 | ||||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-palette-brush-editor.zip (renamed from doc/src/diagrams/designer-palette-brush-editor.zip) | bin | 17703 -> 17703 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-palette-editor.zip (renamed from doc/src/diagrams/designer-palette-editor.zip) | bin | 30588 -> 30588 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-palette-gradient-editor.zip (renamed from doc/src/diagrams/designer-palette-gradient-editor.zip) | bin | 55456 -> 55456 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-palette-pattern-editor.zip (renamed from doc/src/diagrams/designer-palette-pattern-editor.zip) | bin | 15845 -> 15845 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-resource-editor.zip (renamed from doc/src/diagrams/designer-resource-editor.zip) | bin | 12287 -> 12287 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/designer-widget-box.zip (renamed from doc/src/diagrams/designer-widget-box.zip) | bin | 30530 -> 30530 bytes | |||
-rw-r--r-- | doc/src/diagrams/designer-manual/rgbController.ui | 212 | ||||
-rw-r--r-- | doc/src/examples/htmlinfo.qdoc | 89 | ||||
-rw-r--r-- | doc/src/examples/qtscriptcalculator.qdoc | 6 | ||||
-rw-r--r-- | doc/src/examples/tablet.qdoc | 2 | ||||
-rw-r--r-- | doc/src/examples/videographicsitem.qdoc | 52 | ||||
-rw-r--r-- | doc/src/examples/videowidget.qdoc | 187 | ||||
-rw-r--r-- | doc/src/exceptionsafety.qdoc | 156 | ||||
-rw-r--r-- | doc/src/getting-started/demos.qdoc | 2 | ||||
-rw-r--r-- | doc/src/getting-started/examples.qdoc | 7 | ||||
-rw-r--r-- | doc/src/getting-started/installation.qdoc | 177 | ||||
-rw-r--r-- | doc/src/howtos/appicon.qdoc | 15 | ||||
-rw-r--r-- | doc/src/images/gestures.png | bin | 0 -> 178365 bytes | |||
-rw-r--r-- | doc/src/images/video-videographicsitem.png | bin | 0 -> 54436 bytes | |||
-rw-r--r-- | doc/src/images/video-videowidget.png | bin | 0 -> 54199 bytes | |||
-rw-r--r-- | doc/src/images/whatsnewanimatedtiles.png | bin | 0 -> 168909 bytes | |||
-rw-r--r-- | doc/src/index.qdoc | 4 | ||||
-rw-r--r-- | doc/src/legal/commercialeditions.qdoc | 12 | ||||
-rw-r--r-- | doc/src/modules.qdoc | 52 | ||||
-rw-r--r-- | doc/src/platforms/emb-install.qdoc | 4 | ||||
-rw-r--r-- | doc/src/platforms/platform-notes.qdoc | 13 | ||||
-rw-r--r-- | doc/src/platforms/winsystem.qdoc | 4 | ||||
-rw-r--r-- | doc/src/qt4-intro.qdoc | 179 | ||||
-rw-r--r-- | doc/src/s60-introduction.qdoc | 117 | ||||
-rw-r--r-- | doc/src/scripting/scripting.qdoc | 38 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_appicon.qdoc | 4 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_installation.qdoc | 38 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qmake-manual.qdoc | 119 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_s60-introduction.qdoc | 16 | ||||
-rw-r--r-- | doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp | 103 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp | 33 | ||||
-rw-r--r-- | doc/src/snippets/qprocess-environment/main.cpp | 6 | ||||
-rw-r--r-- | doc/src/symbian-exceptionsafety.qdoc | 241 |
77 files changed, 2309 insertions, 170 deletions
diff --git a/doc/doc.pri b/doc/doc.pri index 13d481f..66953e6 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -14,9 +14,9 @@ win32:!win32-g++ { } $$unixstyle { - QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/tools/qdoc3/qdoc3 $$DOCS_GENERATION_DEFINES + QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES } else { - QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/tools/qdoc3/qdoc3.exe $$DOCS_GENERATION_DEFINES + QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES QDOC = $$replace(QDOC, "/", "\\") } macx { diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc index 864445f..24acce1 100644 --- a/doc/src/classes.qdoc +++ b/doc/src/classes.qdoc @@ -41,58 +41,85 @@ /*! \group classlists - \title Class and Function Indexes - \brief Collections of classes and functions grouped together into lists. + \title Class and Function Documentation + \brief Lists and Indexes of classes, functions, and types. - The following documents contain collections of classes, grouped by - subject area or related to particular functionality, or comprehensive - lists of classes and functions. + Links to indexes and lists for finding class and function + reference documentation. + + \section2 Class Lists + + \annotatedlist classlists + + \section2 Function Lists + + \annotatedlist funclists - \generatelist{related} */ /*! - \group groups - \title Grouped Classes + \page classes.html + \title All Qt Classes (main index) \ingroup classlists - This page provides a way of navigating Qt's classes by grouping - related classes together. Some classes may appear in more than one group. + \brief If you know the name of the class you want, find it here. - \generatelist{related} + This is a list of all Qt classes. For a list of the classes + provided for compatibility with Qt3, see \l{Qt3 Support + Classes}. For classes that have been deprecated, see the + \l{Obsolete Classes} list. + + \generatelist classes + \sa {Qt3 Support Classes}, {All Qt Modules}, {Obsolete Classes} */ /*! - \page classes.html - \title Qt's Classes + \page annotated.html + \title Annotated Class List \ingroup classlists - This is a list of all Qt classes. For a list of the classes provided - for compatibility with Qt3, see \l{Qt 3 compatibility classes}. For - classes that have been deprecated, see the \l{Obsolete Classes} list. + \brief If you don't know the name of the class you want, but you + know what the class should do, you might try looking here. - \generatelist classes + Qt classes with brief descriptions: - \sa {Qt 3 Compatibility Classes}, {Qt's Modules}, {Obsolete Classes} + \generatelist annotatedclasses */ /*! - \page namespaces.html - \title Qt's Namespaces + \group groups + \title Groups Of Related Classes \ingroup classlists - This is a list of the main namespaces in Qt. For a list of classes in - Qt, see \l{Qt's Classes}. + \brief If you know what kind of class you want (GUI, painting, + I.O, etc), look here. - \generatelist{namespaces} + This is a list of functional groups of Qt classes. A class can + appear in more than one functional group. + + \generatelist{related} + +*/ + +/*! + \page hierarchy.html + + \title Inheritance Hierarchy + \ingroup classlists + + \brief The C++ class inheritance hierarchy for all classes in the + Qt API. + + \generatelist classhierarchy */ /*! \page obsoleteclasses.html \title Obsolete Classes \ingroup classlists - + + \brief These classes are obsolete and should not be used in new code. This is a list of Qt classes that are obsolete (deprecated). These classes are provided to keep old source code working but they are @@ -101,52 +128,46 @@ \generatelist obsoleteclasses - \sa {Qt's Classes}, {Qt's Modules} */ /*! - \page annotated.html - \title Annotated Class Index + \page compatclasses.html + \title Qt3 Support Classes \ingroup classlists - Qt's classes with brief descriptions: + \brief These classes ease the porting of code from Qt 3 to Qt 4. - \generatelist annotatedclasses -*/ - -/*! - \page functions.html - \title Member Function Index - \ingroup classlists + These are the classes that Qt provides for compatibility with Qt + 3. Most of these are provided by the Qt3Support module. - Here is the list of all the documented member functions in the Qt - API with links to the class documentation for each function. + \generatelist compatclasses - \generatelist functionindex */ /*! - \page hierarchy.html + \page functions.html + \title All Functions (main index) + \ingroup funclists - \title Class Inheritance Hierarchy - \ingroup classlists + \brief All documented Qt functions listed alphabetically with a + link to where each one is declared. - This list shows the C++ class inheritance relations between the - classes in the Qt API. + This is the list of all documented member functions and global + functions in the Qt API. Each function has a link to the class or + header file where it is declared and documented. - \generatelist classhierarchy + \generatelist functionindex */ + /*! - \page compatclasses.html - \title Qt 3 Compatibility Classes + \page namespaces.html + \title All Qt Namespaces \ingroup classlists - This is a list of the classes that Qt provides for compatibility - with Qt 3. The vast majority of these are provided by the - Qt3Support module. + \brief A Qt namespace contains enum types, functions, and sometimes classes. - \generatelist compatclasses + This is a list of the main namespaces in Qt. - \sa {Qt's Classes}, {Qt's Modules} + \generatelist{namespaces} */ diff --git a/doc/src/classes/exportedfunctions.qdoc b/doc/src/classes/exportedfunctions.qdoc index c51ace4..a0e3904 100644 --- a/doc/src/classes/exportedfunctions.qdoc +++ b/doc/src/classes/exportedfunctions.qdoc @@ -41,8 +41,10 @@ /*! \page exportedfunctions.html - \title Special-Purpose Global Functions Exported by Qt - \ingroup classlists + \title Platform-Specific Functions + \ingroup funclists + + \brief Exported functions for fine tuning Qt applications. Qt provides a few low-level global functions for fine-tuning applications. Most of these perform very specific tasks and are diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 181ba6a..5fdc4e8 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -918,6 +918,89 @@ This is discussed in more detail in the \l{Deploying an Application on Windows#Visual Studio 2005 Onwards} {deployment guide for Windows}. + + + \section1 S60 + + Features specific to this platform include handling of static data, + capabilities, stack and heap size, compiler specific options, and unique + identifiers for the application or library. + + \section2 Handling of static data + + If the application uses any static data, the build system needs to be + informed about it. This is because Symbian tries to save memory if no + static data is in use. + + To specify that static data support is desired, add this to the project file: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 129 + + The default value is zero. + + \section2 Stack and heap size + + Symbian uses predefined sizes for stacks and heaps. If an + application exceeds either limit, it may crash or fail to complete its + task. Crashes that seem to have no reason can often be traced back to + insufficient stack and/or heap sizes. + + The stack size has a maximum value, whereas the heap size has a + minimum and a maximum value, all specified in bytes. The minimum value + prevents the application from starting if that amount of memory is not available. The + minimum and maximum values are separated by a space. For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 130 + + The default values depend on the version of the S60 SDK you're using. + + \section2 Compiler specific options + + General compiler options can as usual be set using \c QMAKE_CFLAGS and \c QMAKE_CXXFLAGS. + In order to set specific compiler options, \c QMAKE_CFLAGS.<compiler> and + \c QMAKE_CXXFLAGS.<compiler> can be used. \c <compiler> can be either \c CW for the WINSCW + architecture (emulator), or \c ARMCC for the ARMv5 architecture (hardware). + + Here is an example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131 + + \section2 Unique identifiers + + Symbian applications may have unique identifiers attached to them. + Here is how to define them in a project file: + + There are four types of IDs supported: \c UID2, \c UID3, \c SID, and \c VID. They + are specified like this: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 132 + + If \c UID2 is not specified, it defaults to the same value as \c UID3. + If \c UID3 is not specified, qmake will automatically generate a \c UID3 + suitable for development and debugging. This value should be manually + specified for applications that are to be released. In order to optain + an official UID, please contact Nokia. Both \c SID and \c VID default to empty values. + + For more information about unique identifiers and their meaning for + Symbian applications, please refer to the + \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/ToolsAndUtilities/BuildTools/UsingUids.guide.html}{respective S60 SDK documentation}. + + \section2 Capabilities + + Capabilities define extra priviledges for the application, such as the + ability to list all files on the file system. Capabilities are defined + in the project file like this: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 133 + + It is also possible to specify which capabilities \e not to have, + by first specifying \c ALL and then list the unwanted capabilities + with a minus in front of them, like this: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 134 + + For more information about capabilities, please refer to the + \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/guide/platsecsdk/index.html}{respective S60 SDK documentation}. */ /*! @@ -1008,6 +1091,32 @@ \tableofcontents{3} + \target BLD_INF_RULES + \section1 BLD_INF_RULES + + \e {This is only used on Symbian.} + + Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables. + The section of \c bld.inf file where each rule goes is appended to + \c BLD_INF_RULES with a dot. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 146 + + This will add the specified statements to the \c prj_exports section of the + generated \c bld.inf file. + + It is also possible to add multiple rows in a single block. Each double + quoted string will be placed on a new row in the generated \c bld.inf file. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 143 + + Any rules you define will be added after automatically generated + rules in each section. + \target CONFIG \section1 CONFIG @@ -1178,6 +1287,20 @@ The build process for bundles is also influenced by the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable. + These options only have an effect on Symbian: + + \table 95% + \header \o Option \o Description + \row \o stdbinary \o Builds an Open C binary (i.e. STDDLL, STDEXE, or STDLIB, + depending on the target binary type.) + \row \o no_icon \o Doesn't generate resources needed for displaying an icon + for executable in application menu (app only). + \row \o symbian_test \o Places mmp files and extension makefiles under + test sections in generated bld.inf instead of their regular sections. + Note that this only affects automatically generated bld.inf content; + the content added via \c BLD_INF_RULES variable is not affected. + \endtable + These options have an effect on Linux/Unix platforms: \table 95% @@ -1221,7 +1344,7 @@ \target DEPLOYMENT \section1 DEPLOYMENT - \e {This is only used on Windows CE.} + \e {This is only used on Windows CE and Symbian.} Specifies which additional files will be deployed. Deployment means the transfer of files from the development system to the target device or @@ -1239,7 +1362,8 @@ The default deployment target path for Windows CE is \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to - \c{\Program Files\target}. + \c{\Program Files\target}. For Symbian, the default target is the application + private directory on the drive it is installed to. It is also possible to specify multiple \c sources to be deployed on target \c paths. In addition, different variables can be used for @@ -1249,24 +1373,85 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 29 - \note All linked Qt libraries will be deployed to the path specified - by \c{myFiles.path}. + \note In Windows CE all linked Qt libraries will be deployed to the path + specified by \c{myFiles.path}. In Symbian all libraries and executables + will always be deployed to the \\sys\\bin of the installation drive. + + Since the Symbian build system automatically moves binaries to certain + directories under the epoc32 directory, custom plugins, executables or + dynamically loadable libraries need special handling. When deploying + extra executables or dynamically loadable libraries, the target path + must specify \\sys\\bin. For plugins, the target path must specify the + location where the plugin stub will be deployed to (see the + \l{How to Create Qt Plugins} document for more information about plugins). + If the binary cannot be found from the indicated source path, + the directory Symbian build process moves the executables to is + searched, e.g. \\epoc32\\release\\armv5\\urel. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128 + In Symbian, generic PKG file content can also be specified with this + variable. You can use either \c pkg_prerules or \c pkg_postrules to + pass raw data to PKG file. The strings in \c pkg_prerules are added before + package-body and \c pkg_postrules after. The strings defined in + \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they + should be in a format understood by Symbian package generation tools. + Please consult Symbian documentation for correct syntax. + + For example, to deploy DLL and add a new dependency: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140 + + Please note that \c pkg_prerules can also replace default statements in + pkg file. If no pkg_prerules is defined, qmake makes sure that PKG file + syntax is correct and it contains all mandatory statements such as: + + \list + \o languages, for example \BR + &EN,FR + \o package-header, for example \BR + #{"MyApp-EN", "MyApp-FR"}, (0x1000001F), 1, 2, 3, TYPE=SA + \o localized and unique vendor, for example \BR + %{"Vendor-EN", ..., "Vendor-FR"} + :"Unique vendor name" + \endlist + + If you decide to override any of these statements, you need to pay + attention that also other statements stay valid. For example if you + override languages statement, you must override also package-header + statement and all other statements which are language specific. + + In Symbian, the \c default_deployment item specifies + default platform dependencies. It can be overwritten if a more + restrictive set is needed - e.g. if a specific + device is required to run the application. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141 + \target DEPLOYMENT_PLUGIN \section1 DEPLOYMENT_PLUGIN - \e {This is only used on Windows CE.} + \e {This is only used on Windows CE and Symbian.} This variable specifies the Qt plugins that will be deployed. All plugins available in Qt can be explicitly deployed to the device. See \l{Static Plugins}{Static Plugins} for a complete list. - \note No plugins will be deployed automatically. If the application - depends on plugins, these plugins have to be specified manually. + \note In Windows CE, No plugins will be deployed automatically. + If the application depends on plugins, these plugins have to be specified + manually. + + \note In Symbian, all plugins supported by this variable will be deployed + by default with Qt libraries, so generally using this variable is not + needed. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128 + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 142 This will upload the jpeg imageformat plugin to the plugins directory on the Windows CE device. @@ -1366,7 +1551,14 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 34 See also \l{#SOURCES}{SOURCES}. - + + \target ICON + \section1 ICON + + This variable is used only in MAC and S60 to set the application icon. + Please see \l{Setting the Application Icon}{the application icon documentation} + for more information. + \target INCLUDEPATH \section1 INCLUDEPATH @@ -1430,9 +1622,9 @@ This variable contains a list of libraries to be linked into the project. You can use the Unix \c -l (library) and -L (library path) flags and qmake - will do the correct thing with these libraries on Windows (namely this - means passing the full path of the library to the linker). The only - limitation to this is the library must exist, for qmake to find which + will do the correct thing with these libraries on Windows and Symbian + (namely this means passing the full path of the library to the linker). The + only limitation to this is the library must exist, for qmake to find which directory a \c -l lib lives in. For example: @@ -1454,6 +1646,14 @@ explicitly specify the library to be used by including the \c{.lib} file name suffix. + \bold{Note:} On S60, the build system makes a distinction between shared and + static libraries. In most cases, qmake will figure out which library you + are refering to, but in some cases you may have to specify it explicitly to + get the expected behavior. This typically happens if you are building a + library and using it in the same project. To specify that the library is + either shared or static, add a ".dll" or ".lib" suffix, respectively, to the + library name. + By default, the list of libraries stored in \c LIBS is reduced to a list of unique names before it is used. To change this behavior, add the \c no_lflags_merge option to the \c CONFIG variable: @@ -1489,6 +1689,37 @@ when generating a Makefile. The value of this variable is typically handled internally by \c qmake and rarely needs to be modified. + \target MMP_RULES + \section1 MMP_RULES + + \e {This is only used on Symbian.} + + Generic MMP file content can be specified with this variable. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 137 + + This will add the specified statement to the end of the generated MMP file. + + It is also possible to add multiple rows in a single block. Each double + quoted string will be placed on a new row in the generated MMP file. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 138 + + If you need to include a hash (\c{#}) character inside the + \c MMP_RULES statement, it can be done with the variable + \c LITERAL_HASH as follows: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 139 + + \note You should not use this variable to add MMP statements that are + explicitly supported by their own variables, such as + \c TARGET.EPOCSTACKSIZE. + Doing so could result in duplicate statements in the MMP file. + \target MOC_DIR \section1 MOC_DIR @@ -1781,6 +2012,14 @@ the \c QMAKE_CXXFLAGS_DEBUG and \c QMAKE_CXXFLAGS_RELEASE variables, respectively. + \bold{Note:} On S60, this variable can be used to pass architecture specific + options to each compiler in the Symbian build system. For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131 + + For more information, see + \l{qmake Platform Notes#Compiler specific options}{qmake Platform Notes}. + \target QMAKE_CXXFLAGS_DEBUG \section1 QMAKE_CXXFLAGS_DEBUG @@ -2568,6 +2807,49 @@ This variable contains the name of the resource file for the application. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + + \target RSS_RULES + \section1 RSS_RULES + + \e {This is only used on Symbian.} + + Generic RSS file content can be specified with this variable. The syntax is + similar to \c MMP_RULES and \c BLD_INF_RULES. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 144 + + This will add the specified statement to the end of the generated + registration resource file. As an impact of this statement, the application + will not be visible in application shell. + + It is also possible to add multiple rows in a single block. Each double + quoted string will be placed on a new row in the registration resource file. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145 + + This example will install the application to MyFolder in S60 application + shell. In addition it will make the application to be launched in background. + + For detailed list of possible RSS statements, please refer to Symbian OS help. + + \note You should not use \c RSS_RULES variable to set the following RSS statements: + + app_file + localisable_resource_file + localisable_resource_id + + These statements are internally handled by qmake. + + \target S60_VERSION + \section1 S60_VERSION + + \e {This is only used on Symbian.} + + Contains the version number of the underlying S60 SDK; e.g. "5.0". \target SIGNATURE_FILE \section1 SIGNATURE_FILE @@ -2632,6 +2914,78 @@ The project file above would produce an executable named \c myapp on unix and 'myapp.exe' on windows. + \target TARGET.CAPABILITY + \section1 TARGET.CAPABILITY + + \e {This is only used on Symbian.} + + Specifies which platform capabilities the application should have. For more + information, please refer to the S60 SDK documentation. + + \target TARGET.EPOCALLOWDLLDATA + \section1 TARGET.EPOCALLOWDLLDATA + + \e {This is only used on Symbian.} + + Specifies whether static data should be allowed in the application. Symbian + disallows this by default in order to save memory. To use it, set this to 1. + + \target TARGET.EPOCHEAPSIZE + \section1 TARGET.EPOCHEAPSIZE + + \e {This is only used on Symbian.} + + Specifies the minimum and maximum heap size of the application. The program + will refuse to run if the minimum size is not available when it starts. For + example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 135 + + \target TARGET.EPOCSTACKSIZE + \section1 TARGET.EPOCSTACKSIZE + + \e {This is only used on Symbian.} + + Specifies the maximum stack size of the application. For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 136 + + \target TARGET.SID + \section1 TARGET.SID + + \e {This is only used on Symbian.} + + Specifies which secure identifier to use for the target application or + library. For more information, see the S60 SDK documentation. + + \target TARGET.UID2 + \section1 TARGET.UID2 + + \e {This is only used on Symbian.} + + Specifies which unique identifier 2 to use for the target application or + library. If this variable is not specified, it defaults to the same value + as TARGET.UID3. For more information, see the S60 SDK documentation. + + \target TARGET.UID3 + \section1 TARGET.UID3 + + \e {This is only used on Symbian.} + + Specifies which unique identifier 3 to use for the target application or + library. If this variable is not specified, a UID3 suitable for development + and debugging will be generated automatically. However, applications being + released should always define this variable. For more information, see the + S60 SDK documentation. + + \target TARGET.VID + \section1 TARGET.VID + + \e {This is only used on Symbian.} + + Specifies which vendor identifier to use for the target application or + library. For more information, see the S60 SDK documentation. + \section1 TARGET_EXT This variable specifies the target's extension. The value of this variable @@ -3447,22 +3801,70 @@ \table \header - \o Member - \o Description - \row - \o combine - \o Indicates that all of the input files are combined into a single output file. - \row - \o target_predeps - \o Indicates that the output should be added to the list of PRE_TARGETDEPS. - \row - \o explicit_dependencies - \o The dependencies for the output only get generated from the depends member and from - nowhere else. - \row - \o no_link - \o Indicates that the output should not be added to the list of objects to be linked in - \endtable + \o Member + \o Description + \row + \o commands + \o The commands used for for generating the output from the input. + \row + \o CONFIG + \o Specific configuration options for the custom compiler. See the CONFIG table for details. + \row + \o depend_command + \o Specifies a command used to generate the list of dependencies for the output. + \row + \o dependency_type + \o Specifies the type of file the output is, if it is a known type (such as TYPE_C, + TYPE_UI, TYPE_QRC) then it is handled as one of those type of files. + \row + \o depends + \o Specifies the dependencies of the output file. + \row + \o input + \o The variable that contains the files that should be processed with the custom compiler. + \row + \o name + \o A description of what the custom compiler is doing. This is only used in some backends. + \row + \o output + \o The filename that is created from the custom compiler. + \row + \o output_function + \o Specifies a custom qmake function that is used to specify the filename to be created. + \row + \o variables + \o Indicates that the variables specified here are replaced with $(QMAKE_COMP_VARNAME) when refered to + in the pro file as $(VARNAME). + \row + \o variable_out + \o The variable that the files created from the output should be added to. + \endtable + + List of members specific to the CONFIG option: + + \table + \header + \o Member + \o Description + \row + \o combine + \o Indicates that all of the input files are combined into a single output file. + \row + \o target_predeps + \o Indicates that the output should be added to the list of PRE_TARGETDEPS. + \row + \o explicit_dependencies + \o The dependencies for the output only get generated from the depends member and from + nowhere else. + \row + \o no_link + \o Indicates that the output should not be added to the list of objects to be linked in. + \endtable + + \note Symbian specific: Generating objects to be linked in is not supported in Symbian, + so either the \c CONFIG option \c no_link or variable \c variable_out + should always be defined for extra compilers. + */ /*! diff --git a/doc/src/diagrams/designer-adding-dockwidget.txt b/doc/src/diagrams/designer-manual/designer-adding-dockwidget.txt index 97b4beb..97b4beb 100644 --- a/doc/src/diagrams/designer-adding-dockwidget.txt +++ b/doc/src/diagrams/designer-manual/designer-adding-dockwidget.txt diff --git a/doc/src/diagrams/designer-adding-dockwidget1.png b/doc/src/diagrams/designer-manual/designer-adding-dockwidget1.png Binary files differindex 960da83..960da83 100644 --- a/doc/src/diagrams/designer-adding-dockwidget1.png +++ b/doc/src/diagrams/designer-manual/designer-adding-dockwidget1.png diff --git a/doc/src/diagrams/designer-adding-dockwidget1.zip b/doc/src/diagrams/designer-manual/designer-adding-dockwidget1.zip Binary files differindex 0492df6..0492df6 100644 --- a/doc/src/diagrams/designer-adding-dockwidget1.zip +++ b/doc/src/diagrams/designer-manual/designer-adding-dockwidget1.zip diff --git a/doc/src/diagrams/designer-adding-menu-action1.png b/doc/src/diagrams/designer-manual/designer-adding-menu-action1.png Binary files differindex cde92d9..cde92d9 100644 --- a/doc/src/diagrams/designer-adding-menu-action1.png +++ b/doc/src/diagrams/designer-manual/designer-adding-menu-action1.png diff --git a/doc/src/diagrams/designer-adding-menu-action1.zip b/doc/src/diagrams/designer-manual/designer-adding-menu-action1.zip Binary files differindex 08395eb..08395eb 100644 --- a/doc/src/diagrams/designer-adding-menu-action1.zip +++ b/doc/src/diagrams/designer-manual/designer-adding-menu-action1.zip diff --git a/doc/src/diagrams/designer-adding-menu-action2.zip b/doc/src/diagrams/designer-manual/designer-adding-menu-action2.zip Binary files differindex ca1a5b3..ca1a5b3 100644 --- a/doc/src/diagrams/designer-adding-menu-action2.zip +++ b/doc/src/diagrams/designer-manual/designer-adding-menu-action2.zip diff --git a/doc/src/diagrams/designer-adding-toolbar-action1.png b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.png Binary files differindex 6b82373..6b82373 100644 --- a/doc/src/diagrams/designer-adding-toolbar-action1.png +++ b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.png diff --git a/doc/src/diagrams/designer-adding-toolbar-action1.zip b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.zip Binary files differindex e673b3c..e673b3c 100644 --- a/doc/src/diagrams/designer-adding-toolbar-action1.zip +++ b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action1.zip diff --git a/doc/src/diagrams/designer-adding-toolbar-action2.zip b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action2.zip Binary files differindex 96a9d69..96a9d69 100644 --- a/doc/src/diagrams/designer-adding-toolbar-action2.zip +++ b/doc/src/diagrams/designer-manual/designer-adding-toolbar-action2.zip diff --git a/doc/src/diagrams/designer-creating-dynamic-property.png b/doc/src/diagrams/designer-manual/designer-creating-dynamic-property.png Binary files differindex 1c3d3ca..1c3d3ca 100644 --- a/doc/src/diagrams/designer-creating-dynamic-property.png +++ b/doc/src/diagrams/designer-manual/designer-creating-dynamic-property.png diff --git a/doc/src/diagrams/designer-creating-menu-entry1.png b/doc/src/diagrams/designer-manual/designer-creating-menu-entry1.png Binary files differindex 33aa0d6..33aa0d6 100644 --- a/doc/src/diagrams/designer-creating-menu-entry1.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry1.png diff --git a/doc/src/diagrams/designer-creating-menu-entry1.zip b/doc/src/diagrams/designer-manual/designer-creating-menu-entry1.zip Binary files differindex f9e64c8..f9e64c8 100644 --- a/doc/src/diagrams/designer-creating-menu-entry1.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry1.zip diff --git a/doc/src/diagrams/designer-creating-menu-entry2.png b/doc/src/diagrams/designer-manual/designer-creating-menu-entry2.png Binary files differindex 8338d08..8338d08 100644 --- a/doc/src/diagrams/designer-creating-menu-entry2.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry2.png diff --git a/doc/src/diagrams/designer-creating-menu-entry2.zip b/doc/src/diagrams/designer-manual/designer-creating-menu-entry2.zip Binary files differindex 67d81e4..67d81e4 100644 --- a/doc/src/diagrams/designer-creating-menu-entry2.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry2.zip diff --git a/doc/src/diagrams/designer-creating-menu-entry3.png b/doc/src/diagrams/designer-manual/designer-creating-menu-entry3.png Binary files differindex d242646..d242646 100644 --- a/doc/src/diagrams/designer-creating-menu-entry3.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry3.png diff --git a/doc/src/diagrams/designer-creating-menu-entry3.zip b/doc/src/diagrams/designer-manual/designer-creating-menu-entry3.zip Binary files differindex d530186..d530186 100644 --- a/doc/src/diagrams/designer-creating-menu-entry3.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry3.zip diff --git a/doc/src/diagrams/designer-creating-menu-entry4.png b/doc/src/diagrams/designer-manual/designer-creating-menu-entry4.png Binary files differindex 07a49ba..07a49ba 100644 --- a/doc/src/diagrams/designer-creating-menu-entry4.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry4.png diff --git a/doc/src/diagrams/designer-creating-menu-entry4.zip b/doc/src/diagrams/designer-manual/designer-creating-menu-entry4.zip Binary files differindex d800c31..d800c31 100644 --- a/doc/src/diagrams/designer-creating-menu-entry4.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu-entry4.zip diff --git a/doc/src/diagrams/designer-creating-menu.txt b/doc/src/diagrams/designer-manual/designer-creating-menu.txt index b5b2934..b5b2934 100644 --- a/doc/src/diagrams/designer-creating-menu.txt +++ b/doc/src/diagrams/designer-manual/designer-creating-menu.txt diff --git a/doc/src/diagrams/designer-creating-menu1.png b/doc/src/diagrams/designer-manual/designer-creating-menu1.png Binary files differindex d92a88a..d92a88a 100644 --- a/doc/src/diagrams/designer-creating-menu1.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu1.png diff --git a/doc/src/diagrams/designer-creating-menu1.zip b/doc/src/diagrams/designer-manual/designer-creating-menu1.zip Binary files differindex 780b1ac..780b1ac 100644 --- a/doc/src/diagrams/designer-creating-menu1.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu1.zip diff --git a/doc/src/diagrams/designer-creating-menu2.png b/doc/src/diagrams/designer-manual/designer-creating-menu2.png Binary files differindex 7be4891..7be4891 100644 --- a/doc/src/diagrams/designer-creating-menu2.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu2.png diff --git a/doc/src/diagrams/designer-creating-menu2.zip b/doc/src/diagrams/designer-manual/designer-creating-menu2.zip Binary files differindex 00664a6..00664a6 100644 --- a/doc/src/diagrams/designer-creating-menu2.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu2.zip diff --git a/doc/src/diagrams/designer-creating-menu3.png b/doc/src/diagrams/designer-manual/designer-creating-menu3.png Binary files differindex c2f1beb..c2f1beb 100644 --- a/doc/src/diagrams/designer-creating-menu3.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu3.png diff --git a/doc/src/diagrams/designer-creating-menu3.zip b/doc/src/diagrams/designer-manual/designer-creating-menu3.zip Binary files differindex 76ecbe0..76ecbe0 100644 --- a/doc/src/diagrams/designer-creating-menu3.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menu3.zip diff --git a/doc/src/diagrams/designer-creating-menu4.png b/doc/src/diagrams/designer-manual/designer-creating-menu4.png Binary files differindex 3a3ab54..3a3ab54 100644 --- a/doc/src/diagrams/designer-creating-menu4.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menu4.png diff --git a/doc/src/diagrams/designer-creating-menubar.png b/doc/src/diagrams/designer-manual/designer-creating-menubar.png Binary files differindex e8078e0..e8078e0 100644 --- a/doc/src/diagrams/designer-creating-menubar.png +++ b/doc/src/diagrams/designer-manual/designer-creating-menubar.png diff --git a/doc/src/diagrams/designer-creating-menubar.zip b/doc/src/diagrams/designer-manual/designer-creating-menubar.zip Binary files differindex bddbf0e..bddbf0e 100644 --- a/doc/src/diagrams/designer-creating-menubar.zip +++ b/doc/src/diagrams/designer-manual/designer-creating-menubar.zip diff --git a/doc/src/diagrams/designer-edit-resource.zip b/doc/src/diagrams/designer-manual/designer-edit-resource.zip Binary files differindex dc43d9e..dc43d9e 100644 --- a/doc/src/diagrams/designer-edit-resource.zip +++ b/doc/src/diagrams/designer-manual/designer-edit-resource.zip diff --git a/doc/src/diagrams/designer-find-icon.zip b/doc/src/diagrams/designer-manual/designer-find-icon.zip Binary files differindex e94abd9..e94abd9 100644 --- a/doc/src/diagrams/designer-find-icon.zip +++ b/doc/src/diagrams/designer-manual/designer-find-icon.zip diff --git a/doc/src/diagrams/designer-form-layoutfunction-crop.png b/doc/src/diagrams/designer-manual/designer-form-layoutfunction-crop.png Binary files differindex e8dd39f..e8dd39f 100644 --- a/doc/src/diagrams/designer-form-layoutfunction-crop.png +++ b/doc/src/diagrams/designer-manual/designer-form-layoutfunction-crop.png diff --git a/doc/src/diagrams/designer-form-layoutfunction.png b/doc/src/diagrams/designer-manual/designer-form-layoutfunction.png Binary files differindex 9101e89..9101e89 100644 --- a/doc/src/diagrams/designer-form-layoutfunction.png +++ b/doc/src/diagrams/designer-manual/designer-form-layoutfunction.png diff --git a/doc/src/diagrams/designer-form-layoutfunction.zip b/doc/src/diagrams/designer-manual/designer-form-layoutfunction.zip Binary files differindex fcce637..fcce637 100644 --- a/doc/src/diagrams/designer-form-layoutfunction.zip +++ b/doc/src/diagrams/designer-manual/designer-form-layoutfunction.zip diff --git a/doc/src/diagrams/designer-main-window.zip b/doc/src/diagrams/designer-manual/designer-main-window.zip Binary files differindex 69b7ee6..69b7ee6 100644 --- a/doc/src/diagrams/designer-main-window.zip +++ b/doc/src/diagrams/designer-manual/designer-main-window.zip diff --git a/doc/src/diagrams/designer-mainwindow-actions.ui b/doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui index 593a2de..593a2de 100644 --- a/doc/src/diagrams/designer-mainwindow-actions.ui +++ b/doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui diff --git a/doc/src/diagrams/designer-palette-brush-editor.zip b/doc/src/diagrams/designer-manual/designer-palette-brush-editor.zip Binary files differindex 698f271..698f271 100644 --- a/doc/src/diagrams/designer-palette-brush-editor.zip +++ b/doc/src/diagrams/designer-manual/designer-palette-brush-editor.zip diff --git a/doc/src/diagrams/designer-palette-editor.zip b/doc/src/diagrams/designer-manual/designer-palette-editor.zip Binary files differindex 96646ab..96646ab 100644 --- a/doc/src/diagrams/designer-palette-editor.zip +++ b/doc/src/diagrams/designer-manual/designer-palette-editor.zip diff --git a/doc/src/diagrams/designer-palette-gradient-editor.zip b/doc/src/diagrams/designer-manual/designer-palette-gradient-editor.zip Binary files differindex 4696516..4696516 100644 --- a/doc/src/diagrams/designer-palette-gradient-editor.zip +++ b/doc/src/diagrams/designer-manual/designer-palette-gradient-editor.zip diff --git a/doc/src/diagrams/designer-palette-pattern-editor.zip b/doc/src/diagrams/designer-manual/designer-palette-pattern-editor.zip Binary files differindex 7382bad..7382bad 100644 --- a/doc/src/diagrams/designer-palette-pattern-editor.zip +++ b/doc/src/diagrams/designer-manual/designer-palette-pattern-editor.zip diff --git a/doc/src/diagrams/designer-resource-editor.zip b/doc/src/diagrams/designer-manual/designer-resource-editor.zip Binary files differindex 2c11da4..2c11da4 100644 --- a/doc/src/diagrams/designer-resource-editor.zip +++ b/doc/src/diagrams/designer-manual/designer-resource-editor.zip diff --git a/doc/src/diagrams/designer-widget-box.zip b/doc/src/diagrams/designer-manual/designer-widget-box.zip Binary files differindex 7ba8f77..7ba8f77 100644 --- a/doc/src/diagrams/designer-widget-box.zip +++ b/doc/src/diagrams/designer-manual/designer-widget-box.zip diff --git a/doc/src/diagrams/designer-manual/rgbController.ui b/doc/src/diagrams/designer-manual/rgbController.ui new file mode 100644 index 0000000..37c839f --- /dev/null +++ b/doc/src/diagrams/designer-manual/rgbController.ui @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Form</class> + <widget class="QWidget" name="Form"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>RGB Controller</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>RED</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QSpinBox" name="spinBox"> + <property name="maximum"> + <number>255</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QSlider" name="verticalSlider"> + <property name="maximum"> + <number>255</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>GREEN</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QSpinBox" name="spinBox_2"> + <property name="maximum"> + <number>255</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QSlider" name="verticalSlider_2"> + <property name="maximum"> + <number>255</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>BLUE</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QSpinBox" name="spinBox_3"> + <property name="maximum"> + <number>255</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QSlider" name="verticalSlider_3"> + <property name="maximum"> + <number>255</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + </layout> + </item> + </layout> + <zorder>label</zorder> + <zorder>label_2</zorder> + <zorder>label_3</zorder> + <zorder>spinBox</zorder> + <zorder>spinBox_2</zorder> + <zorder>spinBox_3</zorder> + <zorder>verticalSlider</zorder> + <zorder>verticalSlider_2</zorder> + <zorder>verticalSlider_3</zorder> + <zorder>verticalSlider</zorder> + </widget> + <resources/> + <connections> + <connection> + <sender>spinBox</sender> + <signal>valueChanged(int)</signal> + <receiver>verticalSlider</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>55</x> + <y>51</y> + </hint> + <hint type="destinationlabel"> + <x>53</x> + <y>233</y> + </hint> + </hints> + </connection> + <connection> + <sender>spinBox_2</sender> + <signal>valueChanged(int)</signal> + <receiver>verticalSlider_2</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>193</x> + <y>46</y> + </hint> + <hint type="destinationlabel"> + <x>186</x> + <y>105</y> + </hint> + </hints> + </connection> + <connection> + <sender>spinBox_3</sender> + <signal>valueChanged(int)</signal> + <receiver>verticalSlider_3</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>312</x> + <y>38</y> + </hint> + <hint type="destinationlabel"> + <x>312</x> + <y>132</y> + </hint> + </hints> + </connection> + <connection> + <sender>verticalSlider</sender> + <signal>valueChanged(int)</signal> + <receiver>spinBox</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>57</x> + <y>86</y> + </hint> + <hint type="destinationlabel"> + <x>73</x> + <y>46</y> + </hint> + </hints> + </connection> + <connection> + <sender>verticalSlider_2</sender> + <signal>valueChanged(int)</signal> + <receiver>spinBox_2</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>187</x> + <y>135</y> + </hint> + <hint type="destinationlabel"> + <x>212</x> + <y>44</y> + </hint> + </hints> + </connection> + <connection> + <sender>verticalSlider_3</sender> + <signal>valueChanged(int)</signal> + <receiver>spinBox_3</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>315</x> + <y>187</y> + </hint> + <hint type="destinationlabel"> + <x>349</x> + <y>50</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc new file mode 100644 index 0000000..68e8320 --- /dev/null +++ b/doc/src/examples/htmlinfo.qdoc @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example xml/htmlinfo + \title XML HTML Info Example + + 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. + + \note Standard out is redirected on some platforms. On Symbian using Open + C \c stdout is by default directed to the console window, but this window + may not always be visible. To redirect to a file instead, locate the \c + c:\\system\\data\\config.ini file (on either the emulator or the device) + and change \c STDOUT to point to \c MEDIA4. This will redirect the console + to \c c:\\system\\data\\out.txt. + + The files are parsed using a QXmlStreamReader object. If the file does + not contain a well-formed XML document, a description of the error is + printed to the standard error console. + + \section1 Basic Operation + + The main function of the example uses QDir to access files in the current + directory that match either "*.htm" or "*.html". For each file found, + the \c parseHtmlFile() function is called. + + Reading XML is handled by an instance of the QXmlStreamReader class, which + operates on the input file object: + + \snippet examples/xml/htmlinfo/main.cpp 0 + + The work of parsing and the XML and extracting statistics is done in a + while loop, and is driven by input from the reader: + + \snippet examples/xml/htmlinfo/main.cpp 1 + + If more input is available, the next token from the input file is read + and parsed. The program then looks for the specific element types, + "title", "a", and "p", and stores information about them. + + When there is no more input, the loop terminates. If an error occurred, + information is written to the standard out file via a stream, and the + example exits: + + \snippet examples/xml/htmlinfo/main.cpp 2 + + If no error occurred, the example prints some statistics from the data + gathered in the loop, and then exits. +*/ diff --git a/doc/src/examples/qtscriptcalculator.qdoc b/doc/src/examples/qtscriptcalculator.qdoc index 0e6e153..7adce5a 100644 --- a/doc/src/examples/qtscriptcalculator.qdoc +++ b/doc/src/examples/qtscriptcalculator.qdoc @@ -89,10 +89,8 @@ \snippet examples/script/calculator/calculator.js 1 - The digitClicked() function uses the special local variable - __qt_sender__ to access the object that triggered the signal; - this gives us a simple way to retrieve the value of the digit - that was clicked. + The digitClicked() function is called when a digit button is + clicked, with the input digit as argument. \snippet examples/script/calculator/calculator.js 2 diff --git a/doc/src/examples/tablet.qdoc b/doc/src/examples/tablet.qdoc index 3b2caf3..95acc69 100644 --- a/doc/src/examples/tablet.qdoc +++ b/doc/src/examples/tablet.qdoc @@ -48,7 +48,7 @@ \image tabletexample.png When you use a tablet with Qt applications, \l{QTabletEvent}s are - genarated. You need to reimplement the + generated. You need to reimplement the \l{QWidget::}{tabletEvent()} event handler if you want to handle tablet events. Events are generated when the device used for drawing enters and leaves the proximity of the tablet (i.e., when diff --git a/doc/src/examples/videographicsitem.qdoc b/doc/src/examples/videographicsitem.qdoc new file mode 100644 index 0000000..861b587 --- /dev/null +++ b/doc/src/examples/videographicsitem.qdoc @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example video/videographicsitem + \title Video Graphics Item Example + + 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 + + \sa {Video Widget Example} +*/ diff --git a/doc/src/examples/videowidget.qdoc b/doc/src/examples/videowidget.qdoc new file mode 100644 index 0000000..27d5711 --- /dev/null +++ b/doc/src/examples/videowidget.qdoc @@ -0,0 +1,187 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example video/videowidget + \title Video Widget Example + + The Video Widget example shows how to implement a video widget using + QtMultimedia's QAbstractVideoSurface + + \image video-videowidget.png + + \section1 VideoWidgetSurface Class Definition + + \snippet examples/video/videowidget/videowidgetsurface.h 0 + + The VideoWidgetSurface class inherits QAbstractVideoSurface and paints + video frames on a QWidget. This is a separate class to VideoWidget as both + QAbstractVideoSurface and QWidget inherit QObject. + + In addition to the functions from QAbstractVideoSurface, VideoWidgetSurface + has functions for determining the video display rectangle, and painting + the video. + + \section1 VideoWidgetSurface Class Implementation + + \snippet examples/video/videowidget/videowidgetsurface.cpp 0 + + From the supportedPixelFormats() function we return a list of pixel formats + the surface can paint. The order of the list hints at which formats are + preferred by the surface. Assuming a 32-bit RGB backbuffer, we'd expect + that a 32-bit RGB type with no alpha to be fastest to paint so + QVideoFrame::Image_RGB32 is first in the list. + + Since we don't support rendering using any special frame handles we don't + return any pixel formats if handleType is not + QAbstractVideoBuffer::NoHandle. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 1 + + In isFormatSupported() we test if the frame type of a surface format maps + to a valid QImage format, that the frame size is not empty, and the handle + type is QAbstractVideoBuffer::NoHandle. Note that the + QAbstractVideoSurface implementation of isFormatSupported() will verify + that the list of supported pixel formats returned by + \c supportedPixelFormats(format.handleType()) contains the pixel format and + that the size is not empty so a reimplementation wasn't strictly necessary + in this case. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 2 + + To start our surface we'll extract the image format and size from the + selected video format and save it for use in the paint() function. If the + image format, or size are invalid then we'll set an error and return false. + Otherwise we'll save the format and confirm the surface has been started, + by calling QAbstractVideoSurface::start(). Finally since the video size may + have changed we'll trigger an update of the widget, and video geometry. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 5 + + The updateVideoRect() function calculates the region within the widget the + video occupies. The \l {QVideoSurfaceFormat::sizeHint()}{size hint} of the + video format gives a suggested size for the video calculated from the + \l {QVideoSurfaceFormat::viewport()}{viewport} and + \l {QVideoSurfaceFormat::pixelAspectRatio()}{pixel aspect ratio}. If the + suggested size fits within the widget then we create a new rect of that + size in the center of the widget. Otherwise we shrink the size maintaining + the aspect ratio so that it does fit. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 4 + + We can't paint from outside a paint event, so when a new frame is received + in present() we save a reference to it and force an immediate repaint of + the video region. We retain the saved reference to the frame after the + repaint so that the widget can be repainted between frame changes if + necessary. + + If the format of the frame doesn't match the surface format we can't paint + it or very likely any future frames. So we set an + \l {QAbstractVideoSurface::UnsupportedFormatError}{UnsupportedFormatError} + on our surface and stop it immediately. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 6 + + The paint() function is called by the video widget to paint the current + video frame. Before we draw the frame first we'll check the format for + the scan line direction and if the scan lines are arranged from bottom to + top we'll flip the painter so the frame isn't drawn upside down. Then + using the image format information saved in the start() function we'll + construct a new QImage from the current video frame, and draw it to the + the widget. + + \snippet examples/video/videowidget/videowidgetsurface.cpp 3 + + When the surface is stopped we need to release the current frame and + invalidate the video region. Then we confirm the surface has been + stopped by calling QAbstractVideoSurface::stop() which sets the started + state to false and finally we update so the video widget so paints over + the last frame. + + \section1 VideoWidget Class Definition + + The VideoWidget class uses the VideoWidgetSurface class to implement a + video widget. + + \snippet examples/video/videowidget/videowidget.h 0 + + The VideoWidget QWidget implementation is minimal with just the sizeHint(), + paintEvent(), and resizeEvent() functions in addition to the constructor, + destructor and an instance of VideoWidgetSurface. + + \section1 VideoWidget Class Implementation + + \snippet examples/video/videowidget/videowidget.cpp 0 + + In the VideoWidget constructor we set some flags to speed up re-paints a + little. Setting the Qt::WA_NoSystemBackground flag and disabling automatic + background fills will stop Qt from a painting a background that'll be + completely obscured by the video. The Qt::WA_PaintOnScreen flag will + allow us to paint to the screen instead of the back buffer where supported. + + Next we set the background color to black, so that any borders around the + video are filled in black rather the default background color. + + Finally we construct an instance of the VideoWidgetSurface class. + + \snippet examples/video/videowidget/videowidget.cpp 1 + + In the destructor we simply delete the VideoWidgetSurface instance. + + \snippet examples/video/videowidget/videowidget.cpp 2 + + We get the size hint for the widget from the video format of the surface + which is calculated from viewport and pixel aspect ratio of the video + format. + + \snippet examples/video/videowidget/videowidget.cpp 3 + + When the video widget receives a paint event we first check if the surface + is started, if not then we simply fill the widget with the background + color. If it is then we draw a border around the video region clipped + by the paint region, before calling paint on the video surface to draw the + current frame. + + \snippet examples/video/videowidget/videowidget.cpp 4 + + The resizeEvent() function is reimplemented to trigger an update of the + video region when the widget is resized. +*/ diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/exceptionsafety.qdoc new file mode 100644 index 0000000..284159f --- /dev/null +++ b/doc/src/exceptionsafety.qdoc @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page exceptionsafety.html + \title Exception Safety + \ingroup architecture + \brief A guide to exception safety in Qt. + + \bold {Preliminary warning}: Exception safety is not feature complete! + Common cases should work, but classes might still leak or even crash. + + Qt itself will not throw exceptions. Instead, error codes are used. + In addition, some classes have user visible error messages, for example + \l QIODevice::errorString() or \l QSqlQuery::lastError(). + This has historical and practical reasons - turning on exceptions + can increase the library size by over 20%. + + The following sections describe Qt's behavior if exception support is + enabled at compile time. + + \tableofcontents + + \section1 Exception safe modules + + \section2 Containers + + Qt's \l{container classes} are generally exception neutral. They pass any + exception that happens within their contained type \c T to the user + while keeping their internal state valid. + + Example: + + \code + QList<QString> list; + ... + try { + list.append("hello"); + } catch (...) { + } + // list is safe to use - the exception did not affect it. + \endcode + + Exceptions to that rule are containers for types that can throw during assignment + or copy constructions. For those types, functions that modify the container as well as + returning a value, are unsafe to use: + + \code + MyType s = list.takeAt(2); + \endcode + + If an exception occurs during the assignment of \c s, the value at index 2 is already + removed from the container, but hasn't been assigned to \c s yet. It is lost + without chance of recovery. + + The correct way to write it: + + \code + MyType s = list.at(2); + list.removeAt(2); + \endcode + + If the assignment throws, the container still contains the value, no data loss occured. + + Note that implicitly shared Qt classes will not throw in their assignment + operators or copy constructors, so the limitation above does not apply. + + \section1 Out of Memory Handling + + Most desktop operating systems overcommit memory. This means that \c malloc() + or \c{operator new} return a valid pointer, even though there is not enough + memory available at allocation time. On such systems, no exception of type + \c std::bad_alloc is thrown. + + On all other operating systems, Qt will throw an exception of type std::bad_alloc + if any allocation fails. Allocations can fail if the system runs out of memory or + doesn't have enough continuous memory to allocate the requested size. + + Exceptions to that rule are documented. As an example, \l QImage::create() + returns false if not enough memory exists instead of throwing an exception. + + \section1 Recovering from exceptions + + Currently, the only supported use case for recovering from exceptions thrown + within Qt (for example due to out of memory) is to exit the event loop and do + some cleanup before exiting the application. + + Typical use case: + + \code + QApplication app(argc, argv); + ... + try { + app.exec(); + } catch (const std::bad_alloc &) { + // clean up here, e.g. save the session + // and close all config files. + + return 0; // exit the application + } + \endcode + + After an exception is thrown, the connection to the windowing server + might already be closed. It is not safe to call a GUI related function + after catching an exception. + + \section1 Platform-Specific Exception Handling + + \section2 Symbian (Qt for S60) + + The Symbian platform implements its own exception system that differs from the standard + C++ mechanism. When using Qt for S60, and especially when writing code to access Symbian + functionality directly, it may be necessary to know about the underlying implementation + and how it interacts with Qt. + + The \l{Exception Safety with Symbian} document shows how to use the facilities provided + by Qt to use exceptions as safely as possible. +*/ diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc index 1eac06f..528494b 100644 --- a/doc/src/getting-started/demos.qdoc +++ b/doc/src/getting-started/demos.qdoc @@ -46,7 +46,7 @@ \previouspage Qt Examples \contentspage How to Learn Qt - \nextpage What's New in Qt 4.5 + \nextpage What's New in Qt 4.6 This is the list of demonstrations in Qt's \c demos directory. These are larger and more complicated programs than the diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 253a4e4..b0d6bf6 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -796,6 +796,13 @@ \o \l{multimedia/audio/audioinput}{Audio Input} \endlist + \section1 Video Output + + \list + \o \l{video/videowidget}{Video Widget}\raisedaster + \o \l{video/videographicsitem}{Video Graphics Item} + \endlist + \section1 Phonon The Phonon Multimedia Framework brings multimedia support to Qt applications. diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 10791d8..9bf774b 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -497,6 +497,146 @@ in the \l{Qt for Windows CE Requirements} document. We hope you will enjoy using Qt. Good luck! */ +/*! \page install-S60-installer.html + +\title Installing Qt on S60 using binary package +\ingroup qts60 +\brief How to install Qt on S60 using the binary package. + +\note Qt for S60 has some requirements that are given in more detail +in the \l{Qt for S60 Requirements} document. + +\list 1 + + \o Install Qt + + Run \c{qt-s60-%VERSION%.exe} and follow the instructions. + + \note Qt must be installed on the same drive as the S60 SDK you are + using, and the install path must not contain any spaces. + + \o Running Qt demos + + We've included a subset of the Qt demos in this package for you + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + \c{qt_libs.sis} and \c{fluidlauncher.sis} found in the Qt installation + directory. Begin by connecting your phone using the USB cable and + selecting "PC Suite mode". In Windows Explorer right click on the + \c{.sis} files and select "Install with Nokia Application Installer" + and follow the instructions. + + To run the demos and examples on the emulator, you need to build them first. + Open the "Qt for S60 Command Prompt" from the Start menu and type: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 + + To run the demos on the emulator simply navigate to the directory of the demo + you want to see and run: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 + + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. + + We hope you will enjoy using Qt. + +\endlist + +*/ +/*! \page install-S60.html + +\title Installing Qt on S60 +\ingroup installation +\ingroup qts60 +\brief How to install Qt on S60 + +\note Qt for S60 has some requirements that are given in more detail +in the \l{Qt for S60 Requirements} document. + +\note \bold {This document describes how to install and configure Qt for S60 from scratch. +If you are using pre-built binaries, follow the instructions +\l{Installing Qt on S60 using binary package}{here}.} + +\list 1 + + \o Install Qt + + Uncompress the package into the directory you want Qt installed, + e.g. \c{C:\Qt\%VERSION%}. + + \note Qt must be installed on the same drive as the S60 SDK you are + using, and the install path must not contain any spaces. + + \o Environment variables + + In order to build and use Qt, the \c PATH environment variable needs + to be extended: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 18 + + This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. + + On Windows the PATH can be extended by navigating to + "Control Panel->System->Advanced->Environment variables". + + In addition, you must configure the environment for use with the S60 + emulator. This is done by locating the Carbide.c++ submenu on the Start + menu, and choosing "Configure environment for WINSCW command line". + + \o Configure Qt + + To configure Qt for S60, do: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 23 + + For other options, type \c{configure -help} to get a list of all available + options. + + \o Build Qt + + To build Qt for the device, type: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 28 + + To build Qt for the emulator, type: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 24 + + Congratulations, Qt is now ready to use. + + \o Running Qt demos + + We've included a subset of the Qt demos in this package for you + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + the Qt libraries on the device: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 29 + + \note You will need to supply certificate that allows installation + of binaries with "All -Tcb" capability to your device. + + Similarly, install fluidlauncher to the device: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 30 + + This will create a self-signed \c fluidlauncher_armv5_urel.sis and + install it to your device. + + To run the demos on the emulator simply navigate to the directory of the demo + you want to see and run: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 + + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. + + We hope you will enjoy using Qt. + +\endlist + +*/ /*! \page requirements.html \title General Qt Requirements @@ -523,6 +663,7 @@ in the \l{Qt for Windows CE Requirements} document. \list \o \l{Qt for Embedded Linux Requirements} \o \l{Qt for Mac OS X Requirements} + \o \l{Qt for S60 Requirements} \o \l{Qt for Windows CE Requirements} \o \l{Qt for Windows Requirements} \o \l{Qt for X11 Requirements} @@ -804,3 +945,39 @@ in the \l{Qt for Windows CE Requirements} document. enables the use of the Record extension to the X protocol to be used in applications. */ + +/*! + \page requirements-s60.html + \title Qt for S60 Requirements + \ingroup installation + \brief Setting up the S60 environment for Qt. + \previouspage General Qt Requirements + + Qt for S60 requires the following software installed on your development PC: + \list + \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} + \list + \o \bold{Note:} It may be necessary to update the Carbide compiler. + See \l{http://pepper.troll.no/s60prereleases/patches/}{here} for instructions how to check your + compiler version and how to patch it, if needed. + \endlist + \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} + \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. + Install this to all S60 SDKs you plan to use Qt with. + \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later, + which is not available free of charge. + \endlist + + Running Qt on real device requires the following packages to be installed on your device. + The packages can be found in the S60 SDK where you installed Open C/C++: + \list + \o \c{nokia_plugin\openc\s60opencsis\pips_s60_<version>.sis} + \o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_<version>.sis} + \o \c{nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_<version>.sis} + \endlist + + \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found + \l{http://pepper.troll.no/s60prereleases/patches/}{here}. + + \sa {Known Issues in %VERSION%} +*/ diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index a664ade..2452689 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -212,4 +212,19 @@ installed in the appropriate locations for GNOME. The GNOME developer website is at \l{http://developer.gnome.org/}. + + \section1 Setting the Application Icon on S60 platforms + + In order to set application icon for S60 application you need SVG-T icon. + How to create such SVG-T, please refer to + \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/} + + Once you have icon in correct format and assuming you are using + \c qmake to generate your makefiles, you only need to add a single + line to your \c .pro project file. For example, if the name of your + icon file is \c{myapp.svg}, and your project file is \c{myapp.pro}, + add this line to \c{myapp.pro}: + + \snippet doc/src/snippets/code/doc_src_appicon.qdoc 5 + */ diff --git a/doc/src/images/gestures.png b/doc/src/images/gestures.png Binary files differnew file mode 100644 index 0000000..6bc5632 --- /dev/null +++ b/doc/src/images/gestures.png diff --git a/doc/src/images/video-videographicsitem.png b/doc/src/images/video-videographicsitem.png Binary files differnew file mode 100644 index 0000000..e333c54 --- /dev/null +++ b/doc/src/images/video-videographicsitem.png diff --git a/doc/src/images/video-videowidget.png b/doc/src/images/video-videowidget.png Binary files differnew file mode 100644 index 0000000..a3c7bcb --- /dev/null +++ b/doc/src/images/video-videowidget.png diff --git a/doc/src/images/whatsnewanimatedtiles.png b/doc/src/images/whatsnewanimatedtiles.png Binary files differnew file mode 100644 index 0000000..7152ee2 --- /dev/null +++ b/doc/src/images/whatsnewanimatedtiles.png diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index b0695b8..746a2de 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -76,12 +76,12 @@ <ul> <li><a href="installation.html">Installation</a> and <a href="how-to-learn-qt.html">First Steps with Qt</a></li> <li><a href="tutorials.html">Tutorials</a> and <a href="examples.html">Examples</a></li> - <li><a href="demos.html">Demonstrations</a> and <a href="qt4-5-intro.html"><b>New in Qt 4.5</b></a></li> + <li><a href="demos.html">Demonstrations</a> and <a href="qt4-6-intro.html"><b>New in Qt 4.6</b></a></li> </ul> </td> <td valign="top"> <ul> - <li><a href="classlists.html">C++ Class Documentation</a></li> + <li><a href="classlists.html">Class and Function Documentation</a></li> <li><a href="frameworks-technologies.html">Frameworks and Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> diff --git a/doc/src/legal/commercialeditions.qdoc b/doc/src/legal/commercialeditions.qdoc index 761a53b..93dc194 100644 --- a/doc/src/legal/commercialeditions.qdoc +++ b/doc/src/legal/commercialeditions.qdoc @@ -91,8 +91,8 @@ following pages: \list - \o \l{Qt GUI Framework Edition Classes} - \o \l{Qt Full Framework Edition Classes} + \o \l{Qt GUI Framework Edition} + \o \l{Qt Full Framework Edition} \endlist Please see the \l{Supported Platforms}{list of supported @@ -119,16 +119,20 @@ /*! \page full-framework-edition-classes.html - \title Qt Full Framework Edition Classes + \title Qt Full Framework Edition \ingroup classlists + \brief The list of Qt classes included in the Full Framework Edition. + \generatelist{classesbyedition Desktop} */ /*! \page gui-framework-edition-classes.html - \title Qt GUI Framework Edition Classes + \title Qt GUI Framework Edition \ingroup classlists + \brief The list of Qt classes included in the GUI Framework Edition. + \generatelist{classesbyedition DesktopLight} */ diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 2fc6eaf..786122e 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -41,14 +41,14 @@ /*! \group modules - \title Qt's Modules + \title All Qt Modules \startpage index.html Qt Reference Documentation \nextpage QtCore \ingroup classlists - Qt 4 consists of several modules, each of which lives in a - separate library. + \brief Qt 4 comprises several modules. Each module is a separate + library. \table 80% \header \o {2,1} \bold{Modules for general software development} @@ -89,14 +89,14 @@ or other build tools such as CMake, you also need to link against the \c qtmain library. - \sa {Qt's Classes} + \sa {Class and Function Documentation} */ /*! \module QtCore \title QtCore Module - \contentspage Qt's Modules - \previouspage Qt's Modules + \contentspage All Qt Modules + \previouspage All Qt Modules \nextpage QtGui \ingroup modules @@ -116,7 +116,7 @@ /*! \module QtGui \title QtGui Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtCore \nextpage QtNetwork \ingroup modules @@ -135,7 +135,7 @@ /*! \module QtMultimedia \title QtMultimedia Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtCore \nextpage QtNetwork \ingroup modules @@ -159,7 +159,7 @@ /*! \module QtNetwork \title QtNetwork Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtMultimedia \nextpage QtOpenGL \ingroup modules @@ -184,7 +184,7 @@ /*! \module QtOpenGL \title QtOpenGL Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtNetwork \nextpage QtOpenVG \ingroup modules @@ -236,7 +236,7 @@ \module QtOpenVG \title QtOpenVG Module \since 4.6 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtOpenGL \nextpage QtScript \ingroup modules @@ -291,7 +291,7 @@ \module QtScript \title QtScript Module \since 4.3 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtOpenVG \nextpage QtScriptTools \ingroup modules @@ -321,7 +321,7 @@ \module QtScriptTools \title QtScriptTools Module \since 4.5 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtScript \nextpage QtSql \ingroup modules @@ -350,7 +350,7 @@ /*! \module QtSql \title QtSql Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtScript \nextpage QtSvg \ingroup modules @@ -373,7 +373,7 @@ \module QtSvg \title QtSvg Module \since 4.1 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtSql \nextpage QtWebKit \ingroup modules @@ -428,7 +428,7 @@ /*! \module QtXml \title QtXml Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtSvg \nextpage QtXmlPatterns \ingroup modules @@ -458,7 +458,7 @@ \module QtXmlPatterns \title QtXmlPatterns Module \since 4.4 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtXml \nextpage Phonon Module \ingroup modules @@ -533,7 +533,7 @@ \page phonon-module.html \module Phonon \title Phonon Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtXmlPatterns \nextpage Qt3Support \ingroup modules @@ -604,7 +604,7 @@ /*! \module Qt3Support \title Qt3Support Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage Phonon Module \nextpage QtDesigner \ingroup modules @@ -645,7 +645,7 @@ /*! \module QtDesigner \title QtDesigner Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage Qt3Support \nextpage QtUiTools \ingroup modules @@ -676,7 +676,7 @@ \module QtUiTools \title QtUiTools Module \since 4.1 - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtDesigner \nextpage QtHelp \ingroup modules @@ -716,7 +716,7 @@ /*! \module QtHelp \title QtHelp Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtUiTools \nextpage QtTest \ingroup modules @@ -779,7 +779,7 @@ /*! \module QtTest \title QtTest Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtHelp \nextpage QAxContainer \ingroup modules @@ -809,7 +809,7 @@ /*! \module QAxContainer \title QAxContainer Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtTest \nextpage QAxServer \ingroup modules @@ -859,7 +859,7 @@ /*! \module QAxServer \title QAxServer Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QAxContainer \nextpage QtDBus module \ingroup modules @@ -909,7 +909,7 @@ /*! \module QtDBus \title QtDBus module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QAxServer \ingroup modules diff --git a/doc/src/platforms/emb-install.qdoc b/doc/src/platforms/emb-install.qdoc index e23cc1b..9cd3fad 100644 --- a/doc/src/platforms/emb-install.qdoc +++ b/doc/src/platforms/emb-install.qdoc @@ -42,10 +42,10 @@ /*! \page qt-embedded-install.html - \title Installing Qt for Embedded Linux + \title Installing Qt on Embedded Linux \ingroup qt-embedded-linux \ingroup installation - \brief How to install Qt for Embedded Linux. + \brief How to install Qt on Embedded Linux. This document describes how to install \l{Qt for Embedded Linux} in your development environment: diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index 20f0933..e79b2f4 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -401,6 +401,19 @@ */ /*! + \page platform-notes-symbian.html + \title Platform Notes - Symbian + \contentspage Platform Notes + + This page contains information about the Symbian platforms Qt is currently known + to run on. More information about the combinations of platforms and compilers + supported by Qt can be found on the \l{Supported Platforms} page. + + For information about mixing exceptions with symbian leaves, + see \l{Exception Safety with Symbian} +*/ + +/*! \page platform-notes-embedded-linux.html \title Platform Notes - Embedded Linux \contentspage Platform Notes diff --git a/doc/src/platforms/winsystem.qdoc b/doc/src/platforms/winsystem.qdoc index 5afa1f7..c20973b 100644 --- a/doc/src/platforms/winsystem.qdoc +++ b/doc/src/platforms/winsystem.qdoc @@ -51,8 +51,8 @@ appropriate \c{#ifdef} directives (see below). Qt provides a few low-level global functions for fine-tuning - applications on specific platforms. See \l{Special-Purpose Global - Functions Exported by Qt} for details. + applications on specific platforms. See \l{Platform-Specific + Functions} for details. \tableofcontents diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 5c2642e..3258586 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -78,6 +78,28 @@ The following features have been added to Qt since the first release of Qt 4: + In Qt 4.5: + \list + \o The WebKit browser engine included with Qt has been + upgraded to the latest upstream (trunk) version of WebKit, + bringing the latest features and improvements to Qt applications. + \o Qt for Mac OS X has been substantially rewritten to use + Apple's Cocoa API, enabling Qt applications to be deployed on + 64-bit Macintosh hardware. + \o The QtXmlPatterns module has been extended to cover XSLT, a + transformation language for XML documents. + \o Qt Script introduced its debugger, + providing error reporting for scripts, and to let users track down + bugs in their own scripts. + \o Qt 4.5 includes support for writing rich text documents as + OpenDocument files via the newly-introduced QTextDocumentWriter + class. + \o Qt Linguist can load and edit multiple translation + files simultaneously. + \o Support for ARGB top-level widgets (i.e., translucent + windows). + \endlist + In Qt 4.4: \list \o \l{QtWebkit Module}{Qt WebKit integration}, making it possible for developers @@ -87,8 +109,8 @@ \o \l{QtXmlPatterns Module}{XQuery and XPath} support, providing facilities for XML processing beyond that supported by the QtXml module. \o Support for embedded widgets in \l{Graphics View} scenes. - \o The \l{QtConcurrent} framework for concurrent programming using Qt paradigms and - threading features. + \o The \l{Threading and Concurrent Programming}{QtConcurrent framework} for + concurrent programming using Qt paradigms and threading features. \o An \l{QtHelp Module}{improved help system} that can be used in conjunction with Qt Assistant or as an independent help resource manager. \o Printing system improvements, including the QPrinterInfo, QPrintPreviewWidget @@ -435,6 +457,157 @@ */ /*! + \page qt4-6-intro.html + \title What's New in Qt 4.6 + + Qt 4.6 provides many improvements and enhancements over the + previous releases in the Qt 4 series. This document covers the + most important features in this release, separated by category. + + A comprehensive list of changes between Qt 4.5 and Qt 4.6 is + included in the \c changes-4.6.0 file + \l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available + online}. A \l{Known Issues in %VERSION%}{list of known issues} + for this release is also available. + + Changes between this release and the previous release are provided + in the \c{changes-%VERSION%} file (also + \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}). + + A list of other Qt 4 features can be found on the \bold{\l{What's + New in Qt 4}} page. + + \bold{Highlights} + + \tableofcontents + + \section1 Animation Framework + + The animation framework helps build highly animated, + high-performance GUIs without the hassle of managing complex + structures, timers, and easing curves, not to mention the large + state graphs that all animated GUIs tend to be full of. + + The framework makes it easy to animate \l{QObject}s, including + QWidgets, by allowing Qt properties to be animated. It also allows + creating custom animations and interpolation functions. Graphics + views are not left out--one can animate \l{QGraphicsWidget}s, + which inherits from QObject (and thereby enables properties). + + Animations are controlled using easing curves and can be grouped + together. This enables animations of arbitrary complexity. + + The API is easy to grasp with functions such as start(), stop(), + pause(), and currentTime(). Here is an image from one of the + examples that come with the framework: + + \image whatsnewanimatedtiles.png + + The animation framework also plugs into the new Qt Statemachine by + allowing an animation to be played when transitions are triggered. + The state machine framework is introduced in 4.6 and is described + below. + + \section1 State Machine Framework + + The state machine framework provides a robust state chart + implementation based on Harel statecharts and SCXML. Qt's API lets + you construct such state graphs and execute them. The key benefits + of a state machine are: + + \list + \o Simplify complex application semantics. + \o Use of states to reduce code bloat. + \o Use states to improve maintainability. + \o Makes event-driven programming robust and more + reusable. + \endlist + + It is especially the last item here that makes using a state + machine worthwhile. A key characteristic of event-driven systems + (such as Qt applications) is that behavior often depends not only + on the last or current event, but also the events that preceded + it. With statecharts, this information is easy to express. + + The framework fits neatly into Qt by allowing transitions to + trigger on signals and \l{QEvent}s. By inserting animations into + the state machine, it is also easier to use the framework for + animating GUIs, for instance. + + \section1 Multi-touch & Gestures + + The new multi-touch and gestures support enables user interaction + with more than one finger, and combines sequential touch inputs to + a 'gesture'. + + \image gestures.png + + The main benefits of this new functionality are: + + \list + \o Allow users to interact with applications in better ways. + \o Simplify finger-based interaction with UI components. + \o Allowing common basic gestures and multi-touch + gestures. + \o Enable extensibility. + \endlist + + \section1 DOM access API + + Web pages and XML both have very complex document object models. + The W3C selector API provides a very simple way to access and + manipulate such structures. This API makes it intuitive to access + DOM, helps reuse CSS selector knowledge, and gives little + maintenance or footprint overhead. + + \code + QWebElement document = frame->documentElement(); + QList<QWebElement> allSpans = document.findAll("span"); + QList<QWebElement> introSpans = document.findAll("p.intro span"); + \endcode + + \section1 Qt3D enablers + + As more of Qt, and more of the applications built on Qt go 3D, + API's should be provided to simplify this. Mainly, the new API + aims to make it more easy to create 3D applications with OpenGL. + It will also unify the Qt OpenGL codebase, and enable + cross-platform 3D codebase. + + The main features of the Qt3D enablers are currently: Math + primitives for matrix multiplication, vectors, quaternions + (client-side), and API for vertex and fragment shaders, GLSL/ES. + Future research will, among other things include stencils, +scissors, vertex buffers and arrays, texture manipulation, and + geometry shaders. + + \section1 Performance Optimizations + + As always, Qt continuously strive to optimize its performance. + For this release, we have: + + \list + \o Rewritten the QGraphicsView rendering algorithm. + \o Made QPixmapCache support efficient Key datastructure. + \o Reduced overhead in QNetworkAccessManager. + \o Added the QContiguousCache class, which provides efficient caching of + contiguous data. + \o Removed Win9x support. + \endlist + + \section1 Multimedia Audio Services + + Qt 4.6 comes with new classes for handling audio. These classes + provide low-level access to the system's audio system. By + specifying the audio format (QAudioFormat) and supplying audio + data through a QIODevice, you get direct access to the + functionality of the sound device. The API also comes with + functions to query audio devices for which audio formats they + support. + +*/ + +/* \page qt4-5-intro.html \title What's New in Qt 4.5 @@ -563,7 +736,7 @@ \section1 Improved Network Proxy Support Qt's networking classes have been updated with - \l{Network Programming#Support for Network Proxies}{improved proxy support}. + \l{QtNetwork Module#Support for Network Proxies}{improved proxy support}. This includes improved integration with system proxy settings and the added ability to handle non-trivial proxy cases. diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc new file mode 100644 index 0000000..24f7817 --- /dev/null +++ b/doc/src/s60-introduction.qdoc @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page s60-with-qt-introduction.html + + \title S60 - Introduction to using Qt + \brief An introduction to Qt for S60 developers. + \ingroup howto + \ingroup qts60 + + \tableofcontents + + \section1 Required tools + + See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60. + + \section1 Installing Qt and running demos + + Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how + to install Qt using binary package and how to build and run Qt demos. + + Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using + using source package and how to build and run the Qt demos. + + \section1 Building your own applications + + If you are new to Qt development, have a look at \l{How to Learn Qt}. + In general, the difference between developing a + Qt application on S60 compared to any of the other platforms supported + by Qt is not that big. + + Once you have crated a \c .pro file for your project, generate the + Carbide specific \c Bld.inf and \c .mmp files this way: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 0 + + For more information on how to use qmake have a look at the \l + {qmake Tutorial}. + + Now you can build the Qt on S60 application with standard build + tools. By default, running \c make will produce binaries for the + emulator. However, S60 comes with several alternative build targets, + as shown in the table below: + + \table + \row \o \c debug-winscw \o Build debug binaries for the emulator (default). + It is currently not possible to build release + binaries for the emulator. + \row \o \c debug-gcce \o Build debug binaries for hardware using GCCE. + \row \o \c release-gcce \o Build release binaries for hardware using GCCE. + \row \o \c debug-armv5 \o Build debug binaries for hardware using RVCT. + \row \o \c release-armv5 \o Build release binaries for hardware using RVCT. + \row \o \c run \o Run the emulator binaries from the build directory. + \endtable + + The following lines perform a debug build for the emulator + and deploy all the needed files: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 1 + + To work on your project in Carbide, simply import the \c .pro file + by right clicking on the project explorer and executing "Import...". + + \section1 Installing your own applications + + To install your own applications on hardware, Qt comes with a tool called + \c createpackage. When used on the \c .pkg files created by qmake, it + will produce a signed \c .sis file that can be installed to the device. For + example: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2 + + If you want to install the program immediately, make sure that the device + is connected to the computer in "PC Suite" mode, and run \c createpackage + with the \c -i switch, like this: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 3 +*/ diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc index 5fcf8b2..2973f09 100644 --- a/doc/src/scripting/scripting.qdoc +++ b/doc/src/scripting/scripting.qdoc @@ -1224,44 +1224,6 @@ for it, evaluate the script, and finally restore the old context. \endlist - \section2 Nested Functions and the Scope Chain - - This is an advanced topic; feel free to skip it. - - A nested function can be used to "capture" the execution context in which a - nested function object is created; this is typically referred to as creating - a \e closure. When, at some later time, the nested function is invoked, it - can access the variables that were created when the enclosing function was - invoked. This can perhaps best be illustrated through a small example: - - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 70 - - The \c{counter()} function initializes a local variable to zero, - and returns a nested function. The nested function increments - the "outer" variable and returns its new value. The variable - persists over function calls, as shown in the following example: - - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 71 - - The \c{counter()} function can be implemented as a native function, too - \mdash or rather, as a pair of native functions: One for the outer and - one for the inner. The definition of the outer function is as follows: - - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 72 - - The function creates a local variable and initializes it to zero. - Then it wraps the inner native function, and sets the scope of - the resulting function object to be the activation object associated - with this (the outer) function call. The inner function accesses - the "outer" activation through the scope of the callee: - - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 73 - - It is also possible to have a hybrid approach, where the outer function - is a native function and the inner function is defined by a script: - - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 74 - \section2 Property Getters and Setters A script object property can be defined in terms of a getter/setter diff --git a/doc/src/snippets/code/doc_src_appicon.qdoc b/doc/src/snippets/code/doc_src_appicon.qdoc index c8883fe..c763a68 100644 --- a/doc/src/snippets/code/doc_src_appicon.qdoc +++ b/doc/src/snippets/code/doc_src_appicon.qdoc @@ -21,3 +21,7 @@ kde-config --path icon //! [4] gnome-config --datadir //! [4] + +//! [5] +ICON = myapp.svg +//! [5] diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index e35dad9..489016d 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -125,3 +125,41 @@ setcepaths wincewm50pocket-msvc2005 //! [22] nmake //! [22] + + +//! [23] +cd \Qt\%VERSION% +configure -platform win32-mwc -xplatform symbian-abld +//! [23] + + +//! [24] +make debug-winscw +//! [24] + +//! [25] +cd examples +qmake +make +cd ..\demos +qmake +make +//! [25] + +//! [27] +make run +//! [27] + +//! [28] +make release-armv5 +//! [28] + +//! [29] +cd src\s60installs +createpackage -i qt_libs_armv5_urel.pkg <certificate file> <certificate key file> +//! [29] + +//! [30] +cd embedded\fluidlauncher +createpackage -i fluidlauncher_armv5_urel.pkg +//! [30] diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 82c710d..64dc559 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -809,5 +809,122 @@ CONFIG(debug, debug|release) { //! [127] //! [128] -DEPLOYMENT_PLUGIN += qjpeg +customplugin.sources = customimageplugin.dll +customplugin.sources += c:\myplugins\othercustomimageplugin.dll +customplugin.path = imageformats +dynamiclibrary.sources = mylib.dll helper.exe +dynamiclibrary.path = \sys\bin +globalplugin.sources = someglobalimageplugin.dll +globalplugin.path = \resource\qt\plugins\imageformats +DEPLOYMENT += customplugin dynamiclibrary globalplugin //! [128] + +//! [129] +TARGET.EPOCALLOWDLLDATA = 1 +//! [129] + +//! [130] +TARGET.EPOCHEAPSIZE = 10000 10000000 +TARGET.EPOCSTACKSIZE = 0x8000 +//! [130] + +//! [131] +QMAKE_CXXFLAGS.CW += -O2 +QMAKE_CXXFLAGS.ARMCC += -O0 +//! [131] + +//! [132] +TARGET.UID2 = 0x00000001 +TARGET.UID3 = 0x00000002 +TARGET.SID = 0x00000003 +TARGET.VID = 0x00000004 +//! [132] + +//! [133] +TARGET.CAPABILITY += AllFiles +//! [133] + +//! [134] +TARGET.CAPABILITY = ALL -TCB +//! [134] + +//! [135] +TARGET.EPOCHEAPSIZE = 10000 10000000 +//! [135] + +//! [136] +TARGET.EPOCSTACKSIZE = 0x8000 +//! [136] + +//! [137] +MMP_RULES += "DEFFILE hello.def" +//! [137] + +//! [138] +myBlock = \ +"START RESOURCE foo.rss" \ +"TARGET bar" \ +"TARGETPATH private\10001234" \ +"HEADER" \ +"LANG 01" \ +"UID 0x10002345 0x10003456" \ +"END" + +MMP_RULES += myBlock +//! [138] + +//! [139] +myIfdefBlock = \ +"$${LITERAL_HASH}ifdef WINSCW" \ +"DEFFILE hello_winscw.def" \ +"$${LITERAL_HASH}endif" + +MMP_RULES += myIfdefBlock +//! [139] + +//! [140] +somelib.sources = somelib.dll +somelib.path = \sys\bin +somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ + "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" +justdep.pkg_prerules = "(0xAAAABBBB), 0, 2, 0, {\"My Framework\"}" +DEPLOYMENT += somelib justdep +//! [140] + +//! [141] +default_deployment.pkg_prerules = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}" +//! [141] + +//! [142] +DEPLOYMENT_PLUGIN += qjpeg +//! [142] + +//! [143] +myextension = \ + "start extension myextension" \ + "$${LITERAL_HASH}if defined(WINSCW)" \ + "option MYOPTION foo" \ + "$${LITERAL_HASH}endif" \ + "option MYOPTION bar" \ + "end" +BLD_INF_RULES.prj_extensions += myextension +//! [143] + +//! [144] +RSS_RULES += "hidden = KAppIsHidden;" +//! [144] + +//! [145] +myrssrules = \ + "hidden = KAppIsHidden;" \ + "launch = KAppLaunchInBackground;" \ +RSS_RULES += myrssrules +//! [145] + +//! [146] +BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include <platform_paths.hrh>" \ + "rom/my.iby APP_LAYER_PUBLIC_EXPORT_PATH(my.iby)" \ + "inc/myheader.h mycomp/myheader.h" \ + ":zip my_api.zip my_api" +//! [146] diff --git a/doc/src/snippets/code/doc_src_s60-introduction.qdoc b/doc/src/snippets/code/doc_src_s60-introduction.qdoc new file mode 100644 index 0000000..ff1d159 --- /dev/null +++ b/doc/src/snippets/code/doc_src_s60-introduction.qdoc @@ -0,0 +1,16 @@ +//! [0] + qmake +//! [0] + + +//! [1] + make debug-winscw +//! [1] + +//! [2] + createpackage wiggly_gcce_udeb.pkg +//! [2] + +//! [3] + createpackage -i wiggly_gcce_udeb.pkg +//! [3] diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp new file mode 100644 index 0000000..b625eb2 --- /dev/null +++ b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp @@ -0,0 +1,103 @@ +//! [0] +void myFunction(bool useSubClass) +{ + MyClass *p = useSubClass ? new MyClass() : new MySubClass; + QIODevice *device = handsOverOwnership(); + + if (m_value > 3) { + delete p; + delete device; + return; + } + + try { + process(device); + } + catch (...) { + delete p; + delete device; + throw; + } + + delete p; + delete device; +} +//! [0] + +//! [1] +void myFunction(bool useSubClass) +{ + // assuming that MyClass has a virtual destructor + QScopedPointer<MyClass> p(useSubClass ? new MyClass() : new MySubClass); + QScopedPointer<QIODevice> device(handsOverOwnership()); + + if (m_value > 3) + return; + + process(device); +} +//! [1] + +//! [2] + const QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer<const QWidget> p(new QWidget()); + + QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer<QWidget> p(new QWidget()); + + QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer<QWidget> p(new QWidget()); + + const QWidget *p = new QWidget(); + // is equivalent to: + QScopedPointer<const QWidget> p(new QWidget()); + +//! [2] + +//! [3] +if (scopedPointer) { + ... +} +//! [3] + +//! [4] +class MyPrivateClass; // forward declare MyPrivateClass + +class MyClass +{ +private: + QScopedPointer<MyPrivateClass> privatePtr; // QScopedPointer to forward declared class + +public: + MyClass(); // OK + inline ~MyClass() {} // VIOLATION - Destructor must not be inline + +private: + Q_DISABLE_COPY(MyClass) // OK - copy constructor and assignment operators + // are now disabled, so the compiler won't implicitely + // generate them. +}; +//! [4] + +//! [5] +// this QScopedPointer deletes its data using the delete[] operator: +QScopedPointer<int, QScopedPointerArrayDeleter<int> > arrayPointer(new int[42]); + +// this QScopedPointer frees its data using free(): +QScopedPointer<int, QScopedPointerPodDeleter<int> > podPointer(reinterpret_cast<int *>(malloc(42))); + +// this struct calls "myCustomDeallocator" to delete the pointer +struct ScopedPointerCustomDeleter +{ + static inline void cleanup(MyCustomClass *pointer) + { + myCustomDeallocator(pointer); + } +}; + +// QScopedPointer using a custom deleter: +QScopedPointer<MyCustomClass, ScopedPointerCustomDeleter> customPointer(new MyCustomClass); +//! [5] diff --git a/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp b/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp new file mode 100644 index 0000000..6265c80 --- /dev/null +++ b/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp @@ -0,0 +1,33 @@ +//! [0] +MyGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +{ + // Fully opaque; draw directly without going through a pixmap. + if (qFuzzyCompare(m_opacity, 1)) { + source->draw(painter); + return; + } + ... +} +//! [0] + +//! [1] +MyGraphicsEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +{ + ... + QPoint offset; + if (source->isPixmap()) { + // No point in drawing in device coordinates (pixmap will be scaled anyways). + const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); + ... + painter->drawPixmap(offset, pixmap); + } else { + // Draw pixmap in device coordinates to avoid pixmap scaling; + const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); + painter->setWorldTransform(QTransform()); + ... + painter->drawPixmap(offset, pixmap); + } + ... +} +//! [1] + diff --git a/doc/src/snippets/qprocess-environment/main.cpp b/doc/src/snippets/qprocess-environment/main.cpp index a143bf8..0fa0896 100644 --- a/doc/src/snippets/qprocess-environment/main.cpp +++ b/doc/src/snippets/qprocess-environment/main.cpp @@ -57,10 +57,10 @@ process.start("myapp"); { //! [1] QProcess process; -QHash<QString, QString> env = QProcess::systemEnvironmentHash(); +QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("TMPDIR", "C:\\MyApp\\temp"); // Add an environment variable -env["PATH"] += ";C:\\Bin"; -process.setEnvironment(env); +env.insert("PATH", env.value("Path") + ";C:\\Bin"); +process.setProcessEnvironment(env); process.start("myapp"); //! [1] } diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc new file mode 100644 index 0000000..9183ba7 --- /dev/null +++ b/doc/src/symbian-exceptionsafety.qdoc @@ -0,0 +1,241 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page symbianexceptionsafety.html + \title Exception Safety with Symbian + \ingroup qts60 + \brief A guide to integrating exception safety in Qt with Symbian. + + The following sections describe how Qt code can interoperate with Symbian's + exception safety system. + + \tableofcontents + + \section1 What the problem is + + Qt and Symbian have different exception systems. Qt works with standard C++ + exceptions, whereas Symbian has its TRAP/Leave/CleanupStack system. So, what would + happen if you mix the two systems? It could go wrong in a number of ways. + + Clean-up ordering would be different between the two. When Symbian code + leaves, the clean-up stack is cleaned up before anything else happens. After + that, the objects on the call stack would be cleaned up as with a normal + exception. So if there are any dependencies between stack-based and + objects owned by the clean-up stack, there could be problems due to this + ordering. + + Symbian's \c XLeaveException, which is used when Symbian implements leaves as + exceptions, is not derived from \c std::exception, so would not be caught in + Qt catch statements designed to catch \c std::exception. + + Qt's and standard C++'s \c std::exception derived exceptions result in program + termination if they fall back to a Symbian TRAP. + + These problems can be solved with barrier macros and helper functions that + will translate between the two exception systems. Use them, in Qt code, + whenever calling into or being called from Symbian code. + + \section1 Qt calls to Symbian + + When calling Symbian leaving functions from Qt code, we want to translate + Symbian leaves to standard C++ exceptions. The following help is provided: + + \list + \o \l qt_symbian_throwIfError() takes a Symbian + error code and throws an appropriate exception to represent it. + This will do nothing if the error code is not in fact an error. The + function is equivalent to Symbian's \c User::LeaveIfError. + \o \l q_check_ptr() takes a pointer and throws a std::bad_alloc + exception if it is 0, otherwise the pointer is returned. This can be + used to check the success of a non-throwing allocation, eg from + \c malloc(). The function is equivalent to Symbian's \c + User::LeaveIfNull. + \o \l QT_TRAP_THROWING() takes a Symbian leaving + code fragment f and runs it under a trap harness converting any resulting + error into an exception. + \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert + leaves to error codes. + \endlist + + \code + HBufC* buf=0; + // this will throw a std::bad_alloc because we've asked for too much memory + QT_TRAP_THROWING(buf = HBufC::NewL(100000000)); + + _LIT(KStr,"abc"); + TInt pos = KStr().Locate('c'); + // pos is a good value, >= 0, so no exception is thrown + qt_symbian_throwIfError(pos); + + pos = KStr().Locate('d'); + // pos == KErrNotFound, so this throws an exception + qt_symbian_throwIfError(pos); + + // we are asking for a lot of memory, HBufC::New may return NULL, so check it + HBufC *buffer = q_check_ptr(HBufC::New(1000000)); + \endcode + + \section2 Be careful with new and CBase + + When writing Qt code, \c new will normally throw a \c std::bad_alloc if the + allocation fails. However this may not happen if the object being created + has its own \c {operator new}. For example, CBase and derived classes have + their own \c {operator new} which returns 0 and the \c {new(ELeave)} + overload for a leaving \c {operator new}, neither of which does what we want. + When using 2-phase construction of CBase derived objects, use \c new and + \l q_check_ptr(). + + \oldcode + CFbsBitmap* fbsBitmap = new(ELeave) CFbsBitmap; + \newcode + CFbsBitmap* fbsBitmap = q_check_ptr(new CFbsBitmap); + \endcode + + \section1 Qt called from Symbian + + When Qt code is called from Symbian, we want to translate standard C++ + exceptions to Symbian leaves or error codes. The following help is + provided: + + \list + \o \l qt_symbian_exception2Error() - + this takes a standard exception and gives an appropriate Symbian + error code. If no mapping is known for the exception type, + \c KErrGeneral is returned. + \o \l qt_symbian_exception2LeaveL() - + this takes a standard exception and generates an appropriate Symbian + leave. + \o \l QT_TRYCATCH_ERROR() - this macro + takes the standard C++ code fragment \c f, catches any std::exceptions + thrown from it, and sets err to the corresponding Symbian error code. + err is set to \c KErrNone otherwise. + \o \l QT_TRYCATCH_LEAVING() - this macro takes the + standard C++ code fragment \c f, catches any std::exceptions thrown from + it, and throws a corresponding Symbian leave. + \endlist + + \code + TInt DoTickL() // called from an active object RunL, ie Symbian leaves expected + { + // without the translation to Symbian Leave, we get a USER:0 panic + QT_TRYCATCH_LEAVING({ + int* x = new int[100000000]; // compiled as Qt code, will throw std::bad_alloc + delete [] x; + }); + return 0; + } + \endcode + + \section1 Common sense things + + Try to minimise the interleaving of Symbian and Qt code, every switch + requires a barrier. Grouping the code styles in different blocks will + minimise the problems. For instance, examine the following code. + + \code + 1. TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + 2. QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + 3. filepath = QDir::toNativeSeparators(filepath); + 4. m_playUtility->OpenFileL(qt_QString2TPtrC(filepath))); + \endcode + + Line 1 starts a Symbian leave handling block, which is good because it + also uses a Symbian leave generating function. + + Line 2 creates a \l QString, uses \l QFileInfo and various member functions. + These could all throw exceptions, which is not good inside a \c TRAP block. + + Line 3 is unclear as to whether it might throw an exception, but since + it's dealing with strings it probably does, again bad. + + Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP, + but it also uses a helper function to convert string types. In this case + the helper function may cause an unwelcome exception. + + We could rewrite this with nested exception translations, but it's much + easier to refactor it. + + \code + QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + filepath = QDir::toNativeSeparators(filepath); + TPtrC filepathPtr(qt_QString2TPtrC(filepath)); + TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + m_playUtility->OpenFileL(filepathPtr)); + \endcode + + Now the exception generating functions are separated from the leaving + functions. + + \section1 Advanced technique + When using Symbian APIs in Qt code, you may find that Symbian leaving + code and Qt exception throwing code are just too mixed up to have + them interoperate through barriers. In some circumstances you can allow + code to both leave and throw exceptions. But you must be aware of the + following issues: + + \list + \o Depending on whether a leave or exception is thrown, or a normal + exit happens, the cleanup order will vary. If the code leaves, + cleanup stack cleanup will happen first. On an exception however, + cleanup stack cleanup will happen last. + \o There must not be any destructor dependencies between different + code styles. That is, you must not have symbian objects using Qt + objects in their destructors, and vice versa. This is because the + cleanup order varies, and may result in objects being used after + they are deleted. + \o The cleanup stack must not refer to any stack based object. For + instance, in Symbian you may use \c CleanupClosePushL() to push + stack based R-classes onto the cleanup stack. However if the + stack has unwound due to an exception before the cleanup stack + cleanup happens, stack based objects will now be invalid. + Instead of using the cleanup stack, consider Symbian's new + \c LManagedHandle<> (or a custom cleanup object) to tie R-class + cleanup to the stack. + \o Mixed throwing code must be called within both a TRAP and a + try/catch harness. Standard exceptions must not propagate to + the TRAP and cleanup stack cleanup will only happen if a leave + is thrown, so the correct pattern is either \c {TRAPD(err, + QT_TRYCATCH_LEAVING( f ));} or \c {QT_TRAP_THROWING( + QT_TRYCATCH_LEAVING( f ));}, depending if you want an error + code or exception as a result. + \endlist +*/ |