summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets')
-rw-r--r--doc/src/snippets/code/doc_src_linguist-manual.qdoc6
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc2
-rw-r--r--doc/src/snippets/code/doc_src_qthelp.qdoc6
-rw-r--r--doc/src/snippets/code/src_corelib_global_qglobal.cpp24
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qobject.cpp9
5 files changed, 39 insertions, 8 deletions
diff --git a/doc/src/snippets/code/doc_src_linguist-manual.qdoc b/doc/src/snippets/code/doc_src_linguist-manual.qdoc
index ce3b997..5697300 100644
--- a/doc/src/snippets/code/doc_src_linguist-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_linguist-manual.qdoc
@@ -42,7 +42,7 @@ Options:
-pluralonly
Only include plural form messages.
-silent
- Don't explain what is being done.
+ Do not explain what is being done.
-version
Display the version of lupdate and exit.
//! [4]
@@ -55,14 +55,14 @@ Usage:
Options:
-help Display this information and exit
-compress
- Compress the .qm files
+ Compress the QM files
-nounfinished
Do not include unfinished translations
-removeidentical
If the translated text is the same as
the source text, do not include the message
-silent
- Don't explain what is being done
+ Do not explain what is being done
-version
Display the version of lrelease and exit
//! [5]
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index edb66bc..82c710d 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -689,7 +689,7 @@ qmake -o Makefile hello.pro
//! [115]
-qmake -tp vc -o hello.dsp hello.pro
+qmake -tp vc hello.pro
//! [115]
diff --git a/doc/src/snippets/code/doc_src_qthelp.qdoc b/doc/src/snippets/code/doc_src_qthelp.qdoc
index 11d231f..949e2a5 100644
--- a/doc/src/snippets/code/doc_src_qthelp.qdoc
+++ b/doc/src/snippets/code/doc_src_qthelp.qdoc
@@ -92,8 +92,7 @@ if (links.count()) {
</keywords>
<files>
<file>classic.css</file>
- <file>index.html</file>
- <file>doc.html</file>
+ <file>*.html</file>
</files>
</filterSection>
</QtHelpProject>
@@ -154,8 +153,7 @@ if (links.count()) {
...
<files>
<file>classic.css</file>
- <file>index.html</file>
- <file>doc.html</file>
+ <file>*.html</file>
</files>
...
//! [13]
diff --git a/doc/src/snippets/code/src_corelib_global_qglobal.cpp b/doc/src/snippets/code/src_corelib_global_qglobal.cpp
index 287181a..50052c3 100644
--- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp
+++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp
@@ -358,6 +358,30 @@ QString global_greeting(int type)
//! [36]
+//! [qttrid]
+ //% "%n fooish bar(s) found.\n"
+ //% "Do you want to continue?"
+ QString text = qtTrId("qtn_foo_bar", n);
+//! [qttrid]
+
+
+//! [qttrid_noop]
+static const char * const ids[] = {
+ //% "This is the first text."
+ QT_TRID_NOOP("qtn_1st_text"),
+ //% "This is the second text."
+ QT_TRID_NOOP("qtn_2nd_text"),
+ 0
+};
+
+void TheClass::addLabels()
+{
+ for (int i = 0; ids[i]; ++i)
+ new QLabel(qtTrId(ids[i]), this);
+}
+//! [qttrid_noop]
+
+
//! [37]
qWarning("%s: %s", qPrintable(key), qPrintable(value));
//! [37]
diff --git a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
index 5a7c5a7..5c0f80c 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp
@@ -376,6 +376,15 @@ hostNameLabel->setText(tr("Name:"));
QString example = tr("Example");
//! [40]
+//! [meta data]
+//: This is a comment for the translator.
+//= qtn_foo_bar
+//~ loc-layout_id foo_dialog
+//~ loc-blank False
+//~ magic-stuff This might mean something magic.
+QString text = MyMagicClass::tr("Sim sala bim.");
+//! [meta data]
+
//! [explicit tr context]
QString text = QScrollBar::tr("Page up");
//! [explicit tr context]