diff options
Diffstat (limited to 'doc')
35 files changed, 808 insertions, 101 deletions
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index ff2b036..4792bba 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -567,7 +567,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 482a292..201ff2b 100644 --- a/doc/src/declarative/example-slideswitch.qdoc +++ b/doc/src/declarative/example-slideswitch.qdoc @@ -33,7 +33,7 @@ This example shows how to create a reusable switch component in QML. The code for this example can be found in the \c $QTDIR/examples/declarative/ui-components/slideswitch directory. -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 019f04a..c417c04 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -194,7 +194,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 103f474..2bc8a34 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -252,8 +252,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 @@ -261,9 +260,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 @@ -1699,9 +1696,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 @@ -1764,9 +1759,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 @@ -1944,8 +1937,17 @@ \target PWD \section1 PWD - This variable contains the full path leading to the directory where - the \l{qmake Manual#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 @@ -2788,6 +2790,13 @@ \l{qmake Manual#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 @@ -2802,12 +2811,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 Manual#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 Manual#qmake}{ \c qmake} and + rarely needs to be modified. \section1 QMAKE_MAC_SDK @@ -3488,6 +3499,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: @@ -3682,10 +3706,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..776c5fa --- /dev/null +++ b/doc/src/examples/multicastreceiver.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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..bfb91a6 --- /dev/null +++ b/doc/src/examples/multicastsender.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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..995ff87 --- /dev/null +++ b/doc/src/examples/wheel.qdoc @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 9a8fcaa..f988d03 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -481,6 +481,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/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc index ffac885..64c5538 100644 --- a/doc/src/legal/3rdparty.qdoc +++ b/doc/src/legal/3rdparty.qdoc @@ -45,6 +45,10 @@ Run \c{configure -help} to see any options that may be available for controlling the use of these libraries. + Modifications, if any, done to the third-party libraries can + normally be found by reviewing the change history of the + corresponding files in the public Qt repository. + \tableofcontents \section1 DES (\c des.cpp) @@ -126,7 +130,7 @@ See \c src/3rdparty/harfbuzz/COPYING for license details. - \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 8 + \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 8c \e{This package contains C software to implement JPEG image compression and decompression. JPEG (pronounced "jay-peg") is a standardized compression @@ -142,6 +146,49 @@ \hr + The authors make NO WARRANTY or representation, either express or implied, + with respect to this software, its quality, accuracy, merchantability, or + fitness for a particular purpose. This software is provided "AS IS", and you, + its user, assume the entire risk as to its quality and accuracy. + + This software is copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding. + All Rights Reserved except as specified below. + + Permission is hereby granted to use, copy, modify, and distribute this + software (or portions thereof) for any purpose, without fee, subject to these + conditions:\br + (1) If any part of the source code for this software is distributed, then this + README file must be included, with this copyright and no-warranty notice + unaltered; and any additions, deletions, or changes to the original files + must be clearly indicated in accompanying documentation.\br + (2) If only executable code is distributed, then the accompanying + documentation must state that "this software is based in part on the work of + the Independent JPEG Group".\br + (3) Permission for use of this software is granted only if the user accepts + full responsibility for any undesirable consequences; the authors accept + NO LIABILITY for damages of any kind. + + These conditions apply to any software derived from or based on the IJG code, + not just to the unmodified library. If you use our work, you ought to + acknowledge us. + + Permission is NOT granted for the use of any IJG author's name or company name + in advertising or publicity relating to this software or products derived from + it. This software may be referred to only as "the Independent JPEG Group's + software". + + We specifically permit and encourage the use of this software as the basis of + commercial products, provided that all warranty or liability claims are + assumed by the product vendor. + + \hr + + The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated. + + \hr + See \c src/3rdparty/libjpeg/README for license details. \section1 MD4 (\c md4.cpp and \c md4.h) @@ -178,51 +225,99 @@ See \c src/3rdparty/libmng/LICENSE for license details. - \section1 PNG Reference Library (\c libpng) version 1.4.0 + \section1 PNG Reference Library (\c libpng) version 1.5.1 \e{Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs.} -- quoted from \c - src/3rdparty/libpng/libpng.txt. + src/3rdparty/libpng/libpng-manual.txt. \hr - copyright (C) 1999 by Willem van Schaik <willem@schaik.com> - - version 1.0 - 1999.10.15 - First version. - - Permission to use, copy, modify, and distribute this software and - its documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and - that both that copyright notice and this permission notice appear in - supporting documentation. This software is provided "as is" without - express or implied warranty. - - \hr - - Copyright (c) 1998-2001 Greg Roelofs. All rights reserved. - - This software is provided "as is," without warranty of any kind, - express or implied. In no event shall the author or contributors - be held liable for any damages arising in any way from the use of - this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute - it freely, subject to the following restrictions: - - 1. Redistributions of source code must retain the above copyright - notice, disclaimer, and this list of conditions. - 2. Redistributions in binary form must reproduce the above copyright - notice, disclaimer, and this list of conditions in the documenta- - tion and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - - This product includes software developed by Greg Roelofs - and contributors for the book, "PNG: The Definitive Guide," - published by O'Reilly and Associates. - + libpng versions 1.2.6, August 15, 2004, through 1.5.1, February 3, 2011, are + Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-1.2.5 + with the following individual added to the list of Contributing Authors + + Cosmin Truta + + libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are + Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-1.0.6 + with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux\br + Eric S. Raymond\br + Gilles Vollant + + and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + + libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-0.96, + with the following individuals added to the list of Contributing Authors: + + Tom Lane\br + Glenn Randers-Pehrson\br + Willem van Schaik + + libpng versions 0.89, June 1996, through 0.96, May 1997, are + Copyright (c) 1996, 1997 Andreas Dilger + Distributed according to the same disclaimer and license as libpng-0.88, + with the following individuals added to the list of Contributing Authors: + + John Bowler\br + Kevin Bracey\br + Sam Bushell\br + Magnus Holmgren\br + Greg Roelofs\br + Tom Tanner + + libpng versions 0.5, May 1995, through 0.88, January 1996, are + Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + + For the purposes of this copyright and license, "Contributing Authors" + is defined as the following set of individuals: + + Andreas Dilger\br + Dave Martindale\br + Guy Eric Schalnat\br + Paul Schmidt\br + Tim Wegner + + The PNG Reference Library is supplied "AS IS". The Contributing Authors + and Group 42, Inc. disclaim all warranties, expressed or implied, + including, without limitation, the warranties of merchantability and of + fitness for any purpose. The Contributing Authors and Group 42, Inc. + assume no liability for direct, indirect, incidental, special, exemplary, + or consequential damages, which may result from the use of the PNG + Reference Library, even if advised of the possibility of such damage. + + Permission is hereby granted to use, copy, modify, and distribute this + source code, or portions hereof, for any purpose, without fee, subject + to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + The Contributing Authors and Group 42, Inc. specifically permit, without + fee, and encourage the use of this source code as a component to + supporting the PNG file format in commercial products. If you use this + source code in a product, acknowledgment is not required but would be + appreciated. + \hr See \c src/3rdparty/libpng/LICENSE for license details. @@ -277,7 +372,7 @@ \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the SQLite web site for further information. - \section1 TIFF Software Distribution (\c libtiff) version 3.8.2 + \section1 TIFF Software Distribution (\c libtiff) version 3.9.2 \e {libtiff is a set of C functions (a library) that support the manipulation of TIFF image files.} -- quoted from \c @@ -406,13 +501,35 @@ See \c src/3rdparty/wintab/wintab.h for license details. - \section1 Data Compression Library (\c zlib) version 1.2.3 + \section1 Data Compression Library (\c zlib) version 1.2.5 \e{zlib is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952} -- quoted from \c src/3rdparty/zlib/README. + \hr + + Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required.\br + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software.\br + 3. This notice may not be removed or altered from any source distribution. + + \hr + See \c src/3rdparty/zlib/README for license details. \section1 JavaScriptCore 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/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index de6eb7f..113ad86 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -602,6 +602,69 @@ problem, it probably is a good idea to turn off precompiled headers. Also, consider filing a bug report with Apple so that they can improve support for this feature. + + \section2 Attributes + The following lists a set of useful attributes that can be used to tweak applications + on Mac: + + Qt::AA_MacPluginApplication, Qt::AA_DontUseNativeMenuBar, Qt::AA_MacDontSwapCtrlAndMeta + Qt::WA_MacNoClickThrough, Qt::WA_MacOpaqueSizeGrip, Qt::WA_MacShowFocusRect, + Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, Qt::WA_MacMiniSize, Qt::WA_MacVariableSize, + Qt::WA_MacBrushedMetal, Qt::WA_MacAlwaysShowToolWindow, Qt::WA_MacFrameworkScaled, + Qt::WA_MacNoShadow, Qt::Sheet, Qt::Drawer, Qt::MacWindowToolBarButtonHint, + QMainWindow::unifiedTitleAndToolBarOnMac + + \section2 Mixing Qt with native code + Two classes are awailable for either adding native Cocoa views/controls + inside a Qt application, or the opposite, embedding Qt into a native + Cocoa application: + + QMacCocoaViewContainer, QMacNativeWidget + + \section3 Using native Cocoa panels + Launching native Cocoa panels from within a Qt application can sometimes + be problematic. The reason is that Qt's event dispatcher is more flexible + than what Cocoa offers, and lets the user spin the event dispatcher (and + running QEventLoop::exec) without having to think about whether or not modal + dialogs are showing on screen (which is a difference to Cocoa). Therefore + we need to do special bookkeeping in Qt to handle this correctly, which + unfortunately make mixing in native panels hard. The best way at the moment + to do this, is to follow the pattern below, where we post the call to the + function with native code rather than calling it directly. Then we now that + Qt has cleanly updated any pending event loop recursions before the native + panel is shown: + + \code + #include <QtGui> + + class NativeProxyObject : public QObject + { + Q_OBJECT + public slots: + void execNativeDialogLater() + { + QMetaObject::invokeMethod(this, "execNativeDialogNow", Qt::QueuedConnection); + } + + void execNativeDialogNow() + { + NSRunAlertPanel(@"A Native dialog", @"", @"OK", @"", @""); + } + + }; + + #include "main.moc" + + int main(int argc, char **argv){ + QApplication app(argc, argv); + NativeProxyObject proxy; + QPushButton button("Show native dialog"); + QObject::connect(&button, SIGNAL(clicked()), &proxy, SLOT(execNativeDialogLater())); + button.show(); + return app.exec(); + } + + \endcode */ /*! diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index ec2886b6..1c11a02 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.cpp 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_porting4.cpp b/doc/src/snippets/code/doc_src_porting4.cpp index 730f71f..14c708a 100644 --- a/doc/src/snippets/code/doc_src_porting4.cpp +++ b/doc/src/snippets/code/doc_src_porting4.cpp @@ -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.pro b/doc/src/snippets/code/doc_src_qmake-manual.pro index e5b749e..ee35b77 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.pro +++ b/doc/src/snippets/code/doc_src_qmake-manual.pro @@ -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] @@ -831,12 +831,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] @@ -905,7 +905,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\"}" @@ -1003,7 +1003,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] @@ -1011,3 +1011,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.cpp b/doc/src/snippets/code/doc_src_qtscript.cpp index 822e6fa..de82029 100644 --- a/doc/src/snippets/code/doc_src_qtscript.cpp +++ b/doc/src/snippets/code/doc_src_qtscript.cpp @@ -544,7 +544,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_global_qglobal.cpp b/doc/src/snippets/code/src_corelib_global_qglobal.cpp index 0b54cef..c79a714 100644 --- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp +++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp @@ -531,3 +531,27 @@ class MyClass : public QObject //! [47] CApaApplication *myApplicationFactory(); //! [47] + +//! [qlikely] + // the condition inside the "if" will be successful most of the times + for (int i = 1; i <= 365; i++) { + if (Q_LIKELY(isWorkingDay(i))) { + ... + } + ... + } +//! [qlikely] + +//! [qunlikely] +bool readConfiguration(const QFile &file) +{ + // We expect to be asked to read an existing file + if (Q_UNLIKELY(!file.exists())) { + qWarning() << "File not found"; + return false; + } + + ... + return true; +} +//! [qunlikely] 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_network_access_qhttpmultipart.cpp b/doc/src/snippets/code/src_network_access_qhttpmultipart.cpp new file mode 100644 index 0000000..9ad2222 --- /dev/null +++ b/doc/src/snippets/code/src_network_access_qhttpmultipart.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE: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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + +QHttpPart textPart; +textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"text\"")); +textPart.setBody("my text"); + +QHttpPart imagePart; +imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); +imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"image\"")); +QFile *file = new QFile("image.jpg"); +file->open(QIODevice::ReadOnly); +imagePart.setBodyDevice(file); +file->setParent(multiPart); // we cannot delete the file now, so delete it with the multiPart + +multiPart->append(textPart); +multiPart->append(imagePart); + +QUrl url("http://my.server.tld"); +QNetworkRequest request(url); + +QNetworkAccessManager manager; +QNetworkReply *reply = manager.post(request, multiPart); +multiPart->setParent(reply); // delete the multiPart with the reply +// here connect signals etc. +//! [0] diff --git a/doc/src/snippets/code/src_network_access_qhttppart.cpp b/doc/src/snippets/code/src_network_access_qhttppart.cpp new file mode 100644 index 0000000..0e2dbea --- /dev/null +++ b/doc/src/snippets/code/src_network_access_qhttppart.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE: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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +Content-Type: text/plain +Content-Disposition: form-data; name="text" + +here goes the body +//! [0] + +//! [1] +QHttpPart textPart; +textPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/plain")); +textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"text\"")); +textPart.setBody("here goes the body"); +//! [1] + +//! [2] +QHttpPart imagePart; +imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); +imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"image\"")); +imagePart.setRawHeader("Content-ID", "my@content.id"); // add any headers you like via setRawHeader() +QFile *file = new QFile("image.jpg"); +file->open(QIODevice::ReadOnly); +imagePart.setBodyDevice(file); +//! [2] + 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/declarative/application.qml b/doc/src/snippets/declarative/application.qml index 06f83f2..fa8cf0b 100644 --- a/doc/src/snippets/declarative/application.qml +++ b/doc/src/snippets/declarative/application.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml index 42ee3da..e6a6fcf 100644 --- a/doc/src/snippets/declarative/focus/focusColumn.qml +++ b/doc/src/snippets/declarative/focus/focusColumn.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml index f490a97..aa1246d 100644 --- a/doc/src/snippets/declarative/states/statechangescript.qml +++ b/doc/src/snippets/declarative/states/statechangescript.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/doc/src/snippets/declarative/webview/webview.qml b/doc/src/snippets/declarative/webview/webview.qml index a986fab..f652369 100644 --- a/doc/src/snippets/declarative/webview/webview.qml +++ b/doc/src/snippets/declarative/webview/webview.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** 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 |