summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc2
-rw-r--r--doc/src/declarative/extending.qdoc2
-rw-r--r--doc/src/development/assistant-manual.qdoc7
-rw-r--r--doc/src/development/qmake-manual.qdoc18
-rw-r--r--doc/src/examples/customtype.qdoc2
-rw-r--r--doc/src/examples/multicastreceiver.qdoc36
-rw-r--r--doc/src/examples/multicastsender.qdoc36
-rw-r--r--doc/src/examples/wheel.qdoc109
-rw-r--r--doc/src/getting-started/examples.qdoc2
-rw-r--r--doc/src/images/multicastreceiver-example.pngbin0 -> 13042 bytes
-rw-r--r--doc/src/images/multicastsender-example.pngbin0 -> 21092 bytes
-rw-r--r--doc/src/network-programming/qtnetwork.qdoc9
-rw-r--r--doc/src/porting/porting4.qdoc4
-rw-r--r--doc/src/snippets/accessibilityslidersnippet.cpp2
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_porting4.qdoc2
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc18
-rw-r--r--doc/src/snippets/code/doc_src_qtscript.qdoc2
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp35
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qvariant.cpp2
-rw-r--r--doc/src/snippets/code/src_gui_accessible_qaccessible.cpp4
-rw-r--r--doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp2
-rw-r--r--doc/src/snippets/threads/threads.cpp9
-rw-r--r--doc/src/xml-processing/xml-patterns.qdoc2
24 files changed, 273 insertions, 36 deletions
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
index a62f670..bad8bbf 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 ff519f6..3311c82 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -121,7 +121,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 6924767..9dc973d 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 c0ed940..d7a48a3 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -2725,6 +2725,13 @@
value of this variable is typically handled by \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 +2746,13 @@
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 \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 \c qmake and rarely needs to be modified.
\section1 QMAKE_MAC_SDK
diff --git a/doc/src/examples/customtype.qdoc b/doc/src/examples/customtype.qdoc
index 1033038..dbd4f37 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 851e161..5230b7e 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
new file mode 100644
index 0000000..8de11cd
--- /dev/null
+++ b/doc/src/images/multicastreceiver-example.png
Binary files differ
diff --git a/doc/src/images/multicastsender-example.png b/doc/src/images/multicastsender-example.png
new file mode 100644
index 0000000..a619b04
--- /dev/null
+++ b/doc/src/images/multicastsender-example.png
Binary files differ
diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc
index 8b84dcb..6fd58fe 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/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc
index 8b03187..ab0762a 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 466579d..05cbe40 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 2e59db9..bd23462 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 7a39f2e..9ed557c 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 4f74e9c..ab67a3d 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]
diff --git a/doc/src/snippets/code/doc_src_qtscript.qdoc b/doc/src/snippets/code/doc_src_qtscript.qdoc
index 8effdf3..a81029e 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 59e6ae0..07ff2a0 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 472c90e..9a86583 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 8434d81..c5ca441 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] \ No newline at end of file
diff --git a/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp b/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
index 139e0a3..ef5cfb2 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/threads/threads.cpp b/doc/src/snippets/threads/threads.cpp
index d8d1270..d16c398 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 2a38302..006b876 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