summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/code')
-rw-r--r--doc/src/snippets/code/doc_src_emb-pointer.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_fdl.qdoc10
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc17
-rw-r--r--doc/src/snippets/code/doc_src_linguist-manual.qdoc10
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc18
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp35
-rw-r--r--doc/src/snippets/code/src_qtestlib_qtestcase.cpp18
7 files changed, 95 insertions, 17 deletions
diff --git a/doc/src/snippets/code/doc_src_emb-pointer.qdoc b/doc/src/snippets/code/doc_src_emb-pointer.qdoc
index d333c90..b051a98 100644
--- a/doc/src/snippets/code/doc_src_emb-pointer.qdoc
+++ b/doc/src/snippets/code/doc_src_emb-pointer.qdoc
@@ -104,6 +104,10 @@ QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
//! [11]
+//! [show permissions]
+ls -l /dev/input/mouse0
+//! [show permissions]
+
//! [12]
chmod a+rw /dev/input/mouse0
//! [12]
diff --git a/doc/src/snippets/code/doc_src_fdl.qdoc b/doc/src/snippets/code/doc_src_fdl.qdoc
index 3c15dfe..b55e663 100644
--- a/doc/src/snippets/code/doc_src_fdl.qdoc
+++ b/doc/src/snippets/code/doc_src_fdl.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 0593567..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]
@@ -301,11 +301,24 @@ make
runonphone -s lib/Qt.sis
//! [47]
+//! [runonphone with device file path]
+runonphone -s lib/Qt.sis -p /dev/ttyUSB1
+//! [runonphone with device file path]
+
//! [48]
cd demos/embedded/fluidlauncher
runonphone -s fluidlauncher.sis fluidlauncher.exe
//! [48]
+//! [make runonphone with options]
+make runonphone "QT_RUN_ON_PHONE_OPTIONS=-p /dev/ttyUSB1"
+//! [make runonphone with options]
+
+//! [make runonphone with preset environment variable]
+export QT_RUN_ON_PHONE_OPTIONS="-p /dev/ttyUSB1"
+make runonphone
+//! [make runonphone with preset environment variable]
+
//! [49]
cd myapp
qmake
diff --git a/doc/src/snippets/code/doc_src_linguist-manual.qdoc b/doc/src/snippets/code/doc_src_linguist-manual.qdoc
index db99120..294afe0 100644
--- a/doc/src/snippets/code/doc_src_linguist-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_linguist-manual.qdoc
@@ -92,8 +92,15 @@ Options:
Usage:
lrelease [options] project-file
lrelease [options] ts-files [-qm qm-file]
+
+lrelease is part of Qt's Linguist tool chain. It can be used as a
+stand-alone tool to convert XML-based translations files in the TS
+format into the 'compiled' QM format used by QTranslator objects.
+
Options:
-help Display this information and exit
+ -idbased
+ Use IDs instead of source strings for message keying
-compress
Compress the QM files
-nounfinished
@@ -101,6 +108,9 @@ Options:
-removeidentical
If the translated text is the same as
the source text, do not include the message
+ -markuntranslated <prefix>
+ If a message has no real translation, use the source text
+ prefixed with the given string instead
-silent
Do not explain what is being done
-version
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/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_qtestlib_qtestcase.cpp b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
index c9bda61..adb0c34 100644
--- a/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/doc/src/snippets/code/src_qtestlib_qtestcase.cpp
@@ -48,7 +48,7 @@ QVERIFY(1 + 1 == 2);
//! [1]
-QVERIFY2(1 + 1 == 2, "A breach in basic arithmetic occured.");
+QVERIFY2(1 + 1 == 2, "A breach in basic arithmetic occurred.");
//! [1]
@@ -230,5 +230,21 @@ widget.show();
QTest::qWaitForWindowShown(&widget);
//! [24]
+//! [25]
+QWidget widget;
+
+QTest::touchEvent(&widget)
+ .press(0, QPoint(10, 10));
+QTest::touchEvent(&widget)
+ .stationary(0)
+ .press(1, QPoint(40, 10));
+QTest::touchEvent(&widget)
+ .move(0, QPoint(12, 12))
+ .move(1, QPoint(45, 5));
+QTest::touchEvent(&widget)
+ .release(0)
+ .release(1);
+//! [25]
+
}