diff options
Diffstat (limited to 'doc')
27 files changed, 429 insertions, 58 deletions
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index f43e22e..8503f4e 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -566,7 +566,7 @@ An enumeration type consists of a set of named values. - An enumeration value may be specifed as either a string: + An enumeration value may be specified as either a string: \qml Text { horizontalAlignment: "AlignRight" } \endqml diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc index 9f84ee6..27c8f58 100644 --- a/doc/src/declarative/example-slideswitch.qdoc +++ b/doc/src/declarative/example-slideswitch.qdoc @@ -35,7 +35,7 @@ The code for this example can be found in the \c $QTDIR/examples/declarative/ui- \section1 Overview -The elements that composed the switch are: +The elements that compose the switch are: \list \o a \c on property (the interface to interact with the switch), diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 4b4e05e..80b6e72 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -190,7 +190,7 @@ The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's QML can set properties of types that are more complex than basic intrinsics like integers and strings. Properties can also be object pointers, Qt interface -pointers, lists of object points, and lists of Qt interface pointers. As QML +pointers, lists of object pointers, and lists of Qt interface pointers. As QML is typesafe it ensures that only valid types are assigned to these properties, just like it does for primitive types. diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index 8d3c667..2481440 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -640,7 +640,12 @@ QDesktopServices::DataLocation. The first form is useful for collections that are used in a "mobile" way, e.g. carried around on a USB stick. - + \row + \o \c{<enableFullTextSearchFallback>} + \o This tag describes the ability to fallback and use the full text + search if a keyword can't be found in the index. This functionality + can be used while remote controlling \QA. To make it available for + remote control set the tag value to \c{true}. \endtable In addition to those \QA specific tags, the tags for generating and registering diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 9695d84..1c5d903 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -247,8 +247,7 @@ Normally, variables are used to contain whitespace-separated lists of values. However, it is sometimes necessary to specify values containing - spaces. These must be quoted by using the - \l{qmake Function Reference#quote-string}{quote()} function in the following way: + spaces. These must be quoted by using double quotes: \snippet doc/src/snippets/qmake/quoting.pro 0 @@ -256,9 +255,7 @@ the variable. A similar approach is used to deal with paths that contain spaces, particularly when defining the \l{qmake Variable Reference#INCLUDEPATH}{INCLUDEPATH} and - \l{qmake Variable Reference#LIBS}{LIBS} variables for the Windows platform. - In cases like these, the \l{qmake Function Reference#quote(string)}{quote()} - function can be used in the following way: + \l{qmake Variable Reference#LIBS}{LIBS} variables for the Windows platform: \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces @@ -1658,9 +1655,7 @@ To specify a path containing spaces, quote the path using the technique mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} - document. For example, paths with spaces can be specified on Windows - and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()} - function in the following way: + document. \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces @@ -1722,9 +1717,7 @@ To specify a path containing spaces, quote the path using the technique mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} - document. For example, paths with spaces can be specified on Windows - and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()} - function in the following way: + document. \snippet doc/src/snippets/qmake/spaces.pro quoting library paths with spaces @@ -1900,8 +1893,17 @@ \target PWD \section1 PWD - This variable contains the full path leading to the directory where - the \l {qmake}{ \c qmake} project file (project.pro) is located. + The \c PWD variable specifies the full path leading to the directory + containing the current file being parsed. This can be useful + to refer to files within the source tree when writing project files to + support shadow builds. + + See also \l{#_PRO_FILE_PWD_}{_PRO_FILE_PWD_}. + + \note IN_PWD is an alias for PWD. + + \note Function calls have no effect on the value of PWD. PWD will refer to + the path of the calling file. \target OUT_PWD \section1 OUT_PWD @@ -2725,6 +2727,13 @@ value of this variable is typically handled by \l {qmake}{ \c qmake}or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \section1 QMAKE_LN_SHLIB + + This variable contains the command to execute when creating a link + to a shared library. The + value of this variable is typically handled by \c qmake or + \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \section1 QMAKE_POST_LINK This variable contains the command to execute after linking the TARGET @@ -2739,12 +2748,14 @@ executed, additionally some backends will not support this - mostly only Makefile backends. - \section1 QMAKE_LN_SHLIB + \section1 QMAKE_PROJECT_NAME - This variable contains the command to execute when creating a link - to a shared library. The - value of this variable is typically handled by \l {qmake}{ \c qmake}or - \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \e {This is used for Visual Studio project files only.} + + This variable determines the name of the project when generating project + files for IDEs. The default value is the target name. The value of this + variable is typically handled by \l {qmake}{ \c qmake} and rarely needs + to be modified. \section1 QMAKE_MAC_SDK @@ -3389,6 +3400,19 @@ \tableofcontents{2} + \section1 packagesExist(packages) + + Uses the PKGCONFIG mechanism to determine whether or not the given packages + exist at the time of project parsing. + + This can be useful to optionally enable or disable features. For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 157 + + And then, in the code: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 158 + \section1 basename(variablename) Returns the basename of the file specified. For example: @@ -3582,10 +3606,7 @@ \section1 quote(string) Converts a whole \e string into a single entity and returns the result. - Newlines, carriage returns, and tabs can be specified in the string - with \\n \\r and \\t. The return value does not contain either single - or double quotation marks unless you explicitly include them yourself, - but will be placed into a single entry (for literal expansion). + This is just a fancy way of enclosing the string into double quotes. \section1 replace(string, old_string, new_string) diff --git a/doc/src/examples/customtype.qdoc b/doc/src/examples/customtype.qdoc index 963cac5..326d1d4 100644 --- a/doc/src/examples/customtype.qdoc +++ b/doc/src/examples/customtype.qdoc @@ -117,7 +117,7 @@ \snippet examples/tools/customtype/main.cpp storing a custom value - Alternatively, the qVariantFromValue() and qVariantSetValue() functions + Alternatively, the QVariant::fromValue() and qVariantSetValue() functions can be used if you are using a compiler without support for member template functions. diff --git a/doc/src/examples/multicastreceiver.qdoc b/doc/src/examples/multicastreceiver.qdoc new file mode 100644 index 0000000..9c4dda4 --- /dev/null +++ b/doc/src/examples/multicastreceiver.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/multicastreceiver + \title Multicast Receiver Example + + The Multicast Receiever example shows how to receive information that is + sent to a multicast group. + + \image multicastreceiver-example.png +*/ diff --git a/doc/src/examples/multicastsender.qdoc b/doc/src/examples/multicastsender.qdoc new file mode 100644 index 0000000..be5fb6a --- /dev/null +++ b/doc/src/examples/multicastsender.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/multicastsender + \title Multicast Sender Example + + The Multicast Sender example shows how to send information to multiple + clients in a multicast group. + + \image multicastsender-example.png +*/ diff --git a/doc/src/examples/wheel.qdoc b/doc/src/examples/wheel.qdoc new file mode 100644 index 0000000..992aba6 --- /dev/null +++ b/doc/src/examples/wheel.qdoc @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example scroller/wheel + \title Wheel Scroller Example + + The Wheel Scroller Example shows how to use QScroller, QScrollEvent + and QScrollPrepareEvent to implement smooth scrolling for a + custom Widget. + + \section1 Basics + + The QScroller class is the main part of the smooth scrolling + mechanism in Qt. It keeps track of the current scroll position and + speed and updates the object through events. + QScroller will get touch events via the QFlickGesture. + It will query the target object through a QScrollPrepareEvent for + the scroll area and other information. + QScroller will send QScrollEvents to inform the target object about + the current scroll position. + The target object (usually a QWidget or a QGraphicsObject) will + then need to update it's graphical representation to reflect the + new scroll position. + + \section1 The Wheel Widget class + + To demonstrate how to use the QScroller we implement a QWidget that + looks and works like the wheel of a slot machine. + The wheel can be started via touch events and will continue getting + slower. + Additionally the wheel should appear as if no border exists (which + would seem unnatural) and the scrolling should snap to center one + item. + + In the widget we need to grab the QFlickGesture. The gesture itself + will setAcceptTouchEvents for us, so we don't need to do that here. + + \snippet examples/scroller/wheel/wheelwidget.cpp 0 + + The widget will get gesture events but in addition we also will + get the events from QScroller. + We will need to accept the QScrollPrepareEvent to indicate that + a scrolling should really be started from the given position. + + \snippet examples/scroller/wheel/wheelwidget.cpp 1 + + We should call all three set functions form QScrollPrepareEvent. + + \list + \o \c setViewportSize to indicate our viewport size. Actually the + given code could be improved by giving our size minus the borders. + \o \c setMaxContentPos to indicate the maximum values for the scroll + position. The minimum values are implicitely set to 0. + In our example we give a very high number here and hope that the user + is not patient enough to scroll until the very end. + \o \c setContentPos to indicate the current scroll position. + We give a position in the middle of the huge scroll area. + Actually we give this position every time a new scroll is started so + the user will only reach the end if he continuously scrolls in one + direction which is not very likely. + \endlist + + The handling of the QScrollEvent is a lengthly code not fully shown here. + \snippet examples/scroller/wheel/wheelwidget.cpp 2 + + In principle it does three steps. + \list + \o It calculates and updates the current scroll position as given by + QScroller. + \o It repaints the widget so that the new position is shown. + \o It centers the item as soon as the scrolling stopps. + \endlist + + The following code does the centering. + \snippet examples/scroller/wheel/wheelwidget.cpp 3 + + We check if the scrolling is finished which is indicated in the + QScrollEvent by the \c isLast flag. + We then check if the item is not already centered and if not start a new + scroll by calling QScroller::scrollTo. + + As you can see the QScroller can be used for other things besides simple + scroll areas. +*/ diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 296e032..ad97836 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -474,6 +474,8 @@ \o \l{network/bearercloud}{Bearer Cloud}\raisedaster \o \l{network/bearermonitor}{Bearer Monitor} \o \l{network/securesocketclient}{Secure Socket Client} + \o \l{network/multicastreceiver}{Multicast Receiver} + \o \l{network/multicastsender}{Multicast Sender} \endlist Examples marked with an asterisk (*) are fully documented. diff --git a/doc/src/images/multicastreceiver-example.png b/doc/src/images/multicastreceiver-example.png Binary files differnew file mode 100644 index 0000000..8de11cd --- /dev/null +++ b/doc/src/images/multicastreceiver-example.png diff --git a/doc/src/images/multicastsender-example.png b/doc/src/images/multicastsender-example.png Binary files differnew file mode 100644 index 0000000..a619b04 --- /dev/null +++ b/doc/src/images/multicastsender-example.png diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc index 540dda9..61ff2c5 100644 --- a/doc/src/network-programming/qtnetwork.qdoc +++ b/doc/src/network-programming/qtnetwork.qdoc @@ -257,8 +257,13 @@ QUdpSocket::readDatagram() to read the datagram. The \l{network/broadcastsender}{Broadcast Sender} and - \l{network/broadcastreceiver}{Broadcast Receiver} examples show - how to write a UDP sender and a UDP receiver using Qt. + \l{network/broadcastreceiver}{Broadcast Receiver} examples show how to + write a UDP sender and a UDP receiver using Qt. + + QUdpSocket also supports multicasting. The + \l{network/multicastsender}{Multicast Sender} and + \l{network/multicastreceiver}{Multicast Receiver} examples show how to use + write UDP multicast clients. \section1 Resolving Host Names using QHostInfo diff --git a/doc/src/platforms/platform-notes-rtos.qdoc b/doc/src/platforms/platform-notes-rtos.qdoc index 776f510..be63063 100644 --- a/doc/src/platforms/platform-notes-rtos.qdoc +++ b/doc/src/platforms/platform-notes-rtos.qdoc @@ -245,3 +245,112 @@ some regressions were spotted in QDateTime computation around year 0 and year 1970, which have been tracked back to faulty time zone data on some QNX versions. */ + +/*! + \page platform-notes-integrity.html + \title Platform Notes - INTEGRITY + \contentspage Platform Notes + \target INTEGRITY + + \note INTEGRITY is a community supported platform. See the + \l{Supported Platforms} page for more information. + + This page contains information about the Qt for INTEGRITY port. More + information about the combinations of platforms and compilers supported + by Qt can be found on the \l{Supported Platforms} page. + + Note that Qt for INTEGRITY is currently based on \l{Qt for Embedded Linux}, + which contains its own windowing system. + + Qt for INTEGRITY contains experimental screen and input drivers based on the + gh_FB Framebuffer API for graphics, a Connection-based mouse and keyboard + support. For information about these drivers, please refer to Green Hills + Software standard support. + + \tableofcontents + + \section1 Supported Versions + + Qt has been tested on INTEGRITY 10 on various PowerPC, ARM and x86 targets. + On some platforms a native graphics FrameBuffer driver is available and has + then been used for testing. On all other platforms, the default FrameBuffer + VNC driver is used. + + \section1 Limitations + + Some of Qt's functionality is currently not available on INTEGRITY: + + \table + \header \o Function \o Notes + \row \o QProcess + \o Not implemented. Volunteers welcome. + \row \o QSharedMemory + \o Not available - INTEGRITY doesn't support SYSV style shared memory. + \row \o QSystemSemaphore + \o Not available - INTEGRITY doesn't support SYSV style system semaphores. + \row \o QWS Multi Process + \o QT_NO_QWS_MULTIPROCESS is always on due to missing shared memory support. + \row \o Phonon + \o There is no standard audio backend. + \row \o Qt3Support + \o The Qt3Support library is not available on INTEGRITY. + \row \o QtScript + \o Not available - INTEGRITY's mmap() doesn't support allocating memory. + \endtable + + \section1 Build Instructions + + Qt for INTEGRITY can be built on either a Linux or Windows (with cygwin) host. + In both cases, a standard installation of INTEGRITY is required, with the + addition of the FrameBuffer API. + + Example configure line for cross-compiling Qt for INTEGRITY for an + ARM INTEGRITY target: + + \code + ./configure --hostprefix=$PWD -embedded integrity -xplatform unsupported/qws/integrity-arm-cxarm -static -qt-kbd-integrity -qt-mouse-integrity -no-mouse-linuxtp -no-mouse-pc -no-kbd-tty -qt-gfx-integrityfb -no-qt3support -no-gfx-linuxfb -no-glib -no-openssl -no-largefile -little-endian -arch integrity -prefix / -opensource -no-feature-QWS_MULTIPROCESS -no-feature-SHAREDMEMORY -no-feature-PROCESS -no-feature-SYSTEMSEMAPHORE -no-feature-PRINTER -no-feature-QWS_QPF2 -no-scripttools + \endcode + + \list + \o \c{--hostprefix=$PWD} - specifies the current directory as the base source for Qt + \o \c{-arch integrity} - sets the architecture to INTEGRITY (for atomic operations) + \o \c{-embedded integrity} - builds the embedded version of Qt and sets the architecture to INTEGRITY + \o \c{-xplatform unsupported/qws/integrity-arm-cxarm} - selects the arm-cxarm mkspec for INTEGRITY + \o \c{-static} - specifies a static build of Qt + \o \c{-no-gfx-linuxfb}, \c{-no-mouse-linuxtp}, \c{-no-mouse-pc} and \c{-no-kbd-tty} are Linux specific and won't work on INTEGRITY + \o \c{-no-qt3support} - required since the Qt3 support classes are not supported on INTEGRITY + \o \c{-no-exceptions} - reduces the size of the library by disabling exception support + \o \c{-no-openssl} - disable support for OpenSSL + \o \c{-no-glib} - disable support for unavailable Glib + \o \c{-no-largefile} - disable support for large (> 2TB) files + \o \c{-no-scripttools} - disable support for QtScript tools + \o \c{-qt-gfx-integrity} - enables the experimental gh_FB based display driver + \o \c{-qt-mouse-integrity} - enables the experimental Connection-based mouse driver + \o \c{-qt-kbd-integrity} - enables the experimental Connection-based keyboard driver + \endlist + + The above script will generate MULTI .gpj Project files, not Makefiles. The + main benefit of using these project files is automatic dependency checking, + but this also provides an organization known to INTEGRITY customers. + For Qt libraries, the top-level file is projects.gpj. + + \section1 General Notes + + \list + \o Before you run the above configure line, you may want to modify the values + of INTEGRITY_DIR and INTEGRITY_BSP in unsupported/qws/integrity-arm-cxarm/qmake.conf. + If you do not do this, you will have to modify the resulting generated projects.gpj + + \o GIF support is currently not enabled. + + \o Default .int files are generated. You may want to modify the amount of heap assigned + to each example by modifying the HeapSize declaration in the specific example .int file. + + \o Some of the tools, examples and demos do not compile due to dependencies on QProcess + or other classes that are not available on INTEGRITY. + + \endlist + + \section1 Platform Regressions + +*/ diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index 862d22b..a3960c3 100644 --- a/doc/src/porting/porting4.qdoc +++ b/doc/src/porting/porting4.qdoc @@ -2374,8 +2374,8 @@ pointer to a QObjectList. See also the comments on QObjectList below. - Use QObject::findChildren() (or qFindChildren() if you need MSVC 6 - compatibility) instead of QObject::queryList(). For example: + Use QObject::findChildren() instead of QObject::queryList(). + For example: \snippet doc/src/snippets/code/doc_src_porting4.qdoc 18 diff --git a/doc/src/snippets/accessibilityslidersnippet.cpp b/doc/src/snippets/accessibilityslidersnippet.cpp index 843cd1f..cb4347e 100644 --- a/doc/src/snippets/accessibilityslidersnippet.cpp +++ b/doc/src/snippets/accessibilityslidersnippet.cpp @@ -227,7 +227,7 @@ QVariant QAccessibleAbstractSlider::invokeMethodEx(Method method, int child, con case ListSupportedMethods: { QSet<QAccessible::Method> set; set << ListSupportedMethods; - return qVariantFromValue(set | qvariant_cast<QSet<QAccessible::Method> >( + return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >( QAccessibleWidgetEx::invokeMethodEx(method, child, params))); } default: diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 1a87566..5aaa2b0 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -250,12 +250,12 @@ export PATH //! [38] cd /home/user/qt/%VERSION% -./configure -platform linux-g++ -xplatform symbian/linux-armcc +./configure -platform linux-g++ -xplatform symbian-armcc //! [38] //! [39] cd /home/user/qt/%VERSION% -./configure -platform linux-g++ -xplatform symbian/linux-gcce -no-webkit +./configure -platform linux-g++ -xplatform symbian-gcce -no-webkit //! [39] //! [40] diff --git a/doc/src/snippets/code/doc_src_porting4.qdoc b/doc/src/snippets/code/doc_src_porting4.qdoc index 730f71f..14c708a 100644 --- a/doc/src/snippets/code/doc_src_porting4.qdoc +++ b/doc/src/snippets/code/doc_src_porting4.qdoc @@ -165,7 +165,7 @@ while (i.hasNext()) { //! [18] -QList<QWidget *> myWidgets = qFindChildren<QWidget *>(myParent); +QList<QWidget *> myWidgets = myParent->findChildren<QWidget *>(); //! [18] diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index fb71e39..a35a3d9 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -193,15 +193,15 @@ DEFINES += USE_MY_STUFF QT_DLL //! [28] -myFiles.sources = path\*.png +myFiles.files = path\*.png DEPLOYMENT += myFiles //! [28] //! [29] -myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* +myFiles.files = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device -someother.sources = C:\additional\files\* +someother.files = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother //! [29] @@ -849,12 +849,12 @@ CONFIG(debug, debug|release) { //! [127] //! [128] -customplugin.sources = customimageplugin.dll -customplugin.sources += c:\myplugins\othercustomimageplugin.dll +customplugin.files = customimageplugin.dll +customplugin.files += c:\myplugins\othercustomimageplugin.dll customplugin.path = imageformats -dynamiclibrary.sources = mylib.dll helper.exe +dynamiclibrary.files = mylib.dll helper.exe dynamiclibrary.path = \sys\bin -globalplugin.sources = someglobalimageplugin.dll +globalplugin.files = someglobalimageplugin.dll globalplugin.path = \resource\qt\plugins\imageformats DEPLOYMENT += customplugin dynamiclibrary globalplugin //! [128] @@ -923,7 +923,7 @@ MMP_RULES += myIfdefBlock //! [139] //! [140] -somelib.sources = somelib.dll +somelib.files = somelib.dll somelib.path = \sys\bin somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" @@ -1021,7 +1021,7 @@ DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_dep //! [155] default_bin_deployment.flags += FILERUN RUNINSTALL -dep_note.sources = install_note.txt +dep_note.files = install_note.txt dep_note.flags = FILETEXT TEXTEXIT DEPLOYMENT += dep_note //! [155] @@ -1029,3 +1029,15 @@ DEPLOYMENT += dep_note //! [156] DEPLOYMENT.display_name = My Qt App //! [156] + +//! [157] +packagesExist(sqlite3 QtNetwork QtDeclarative) { + DEFINES += USE_FANCY_UI +} +//! [157] + +//! [158] +#ifdef USE_FANCY_UI + // Use the fancy UI, as we have extra packages available +#endif +//! [158] diff --git a/doc/src/snippets/code/doc_src_qtscript.qdoc b/doc/src/snippets/code/doc_src_qtscript.qdoc index a168d5b..1ba097a 100644 --- a/doc/src/snippets/code/doc_src_qtscript.qdoc +++ b/doc/src/snippets/code/doc_src_qtscript.qdoc @@ -964,7 +964,7 @@ QScriptValue constructXmlStreamReader(QScriptContext *context, QScriptEngine *en XmlStreamReaderPointer pointer(reader); // store the shared pointer in the script object that we are constructing - return engine->newVariant(context->thisObject(), qVariantFromValue(pointer)); + return engine->newVariant(context->thisObject(), QVariant::fromValue(pointer)); } //! [93] diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp index 5919c01..cf40f9a 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp @@ -86,3 +86,38 @@ beginMoveRows(parent, 2, 2, parent, 0); //! [9] beginMoveRows(parent, 2, 2, parent, 4); //! [9] + + +//! [10] +class CustomDataProxy : public QSortFilterProxyModel +{ + Q_OBJECT +public: + CustomDataProxy(QObject *parent) + : QSortFilterProxyModel(parent) + { + } + + ... + + QVariant data(const QModelIndex &index, int role) + { + if (role != Qt::BackgroundRole) + return QSortFilterProxyModel::data(index, role); + + if (m_customData.contains(index.row())) + return m_customData.value(index.row()); + return QSortFilterProxyModel::data(index, role); + } + +private slots: + void resetInternalData() + { + m_customData.clear(); + } + +private: + QHash<int, QVariant> m_customData; +}; +//! [10] + diff --git a/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp b/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp index a57d722..8b1bcbf 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp @@ -132,5 +132,5 @@ return QVariant::fromValue(s); //! [8] QObject *object = getObjectFromSomewhere(); -QVariant data = qVariantFromValue(object); +QVariant data = QVariant::fromValue(object); //! [8] diff --git a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp index 6d22734..84eb1cd 100644 --- a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp +++ b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp @@ -46,3 +46,7 @@ if (child) { delete child; } //! [0] + +//! [1] +typedef QAccessibleInterface* myFactoryFunction(const QString &key, QObject *); +//! [1] diff --git a/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp b/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp index d446af7..dd5cd5b 100644 --- a/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp +++ b/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp @@ -163,7 +163,7 @@ break; default: if (v.userType() == qMetaTypeId<QXmlName>()) { - QXmlName n = qVariantValue<QXmlName>(v); + QXmlName n = qvariant_cast<QXmlName>(v); // process QXmlName n... } else { diff --git a/doc/src/snippets/qmake/spaces.pro b/doc/src/snippets/qmake/spaces.pro index 544ef05..614d4c5 100644 --- a/doc/src/snippets/qmake/spaces.pro +++ b/doc/src/snippets/qmake/spaces.pro @@ -1,9 +1,9 @@ #! [quoting library paths with spaces] -win32:LIBS += $$quote(C:/mylibs/extra libs/extra.lib) -unix:LIBS += $$quote(-L/home/user/extra libs) -lextra +win32:LIBS += "C:/mylibs/extra libs/extra.lib" +unix:LIBS += "-L/home/user/extra libs" -lextra #! [quoting library paths with spaces] #! [quoting include paths with spaces] -win32:INCLUDEPATH += $$quote(C:/mylibs/extra headers) -unix:INCLUDEPATH += $$quote(/home/user/extra headers) +win32:INCLUDEPATH += "C:/mylibs/extra headers" +unix:INCLUDEPATH += "/home/user/extra headers" #! [quoting include paths with spaces] diff --git a/doc/src/snippets/threads/threads.cpp b/doc/src/snippets/threads/threads.cpp index 31f325d..5661757 100644 --- a/doc/src/snippets/threads/threads.cpp +++ b/doc/src/snippets/threads/threads.cpp @@ -93,15 +93,12 @@ private: typedef int SomeClass; //! [7] -QThreadStorage<QCache<QString, SomeClass> *> caches; +QThreadStorage<QCache<QString, SomeClass> > caches; void cacheObject(const QString &key, SomeClass *object) //! [7] //! [8] { - if (!caches.hasLocalData()) - caches.setLocalData(new QCache<QString, SomeClass>); - - caches.localData()->insert(key, object); + caches.localData().insert(key, object); } void removeFromCache(const QString &key) @@ -110,7 +107,7 @@ void removeFromCache(const QString &key) if (!caches.hasLocalData()) return; - caches.localData()->remove(key); + caches.localData().remove(key); } //! [9] diff --git a/doc/src/xml-processing/xml-patterns.qdoc b/doc/src/xml-processing/xml-patterns.qdoc index d0b6485..1c8c90c 100644 --- a/doc/src/xml-processing/xml-patterns.qdoc +++ b/doc/src/xml-processing/xml-patterns.qdoc @@ -415,7 +415,7 @@ slight-of-hand using the \l{QMetaType} {Qt metatype system}. We must modify our example to use a couple of template functions, a friend of QMetaType (qMetaTypeId<T>()) and a friend of QVariant - (qVariantValue<T>()): + (qvariant_cast<T>()): \snippet doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp 6 |