From 95f52ed1f9a1b3049e6862cb466754931c1d760d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 4 Oct 2010 13:45:46 +0200 Subject: Doc: Made a number of fixes to the documentation. --- doc/src/bughowto.qdoc | 2 +- doc/src/examples/customtypesending.qdoc | 17 ++++++++---- doc/src/examples/qml-examples.qdoc | 31 ++++++++++++++++++++++ doc/src/frameworks-technologies/threads.qdoc | 4 --- doc/src/modules.qdoc | 4 +++ doc/src/snippets/code/doc_src_linguist-manual.qdoc | 10 +++++++ doc/src/snippets/sqldatabase/sqldatabase.cpp | 2 +- src/corelib/plugin/qsystemlibrary.cpp | 4 +-- src/gui/kernel/qwidget.cpp | 10 +++---- 9 files changed, 66 insertions(+), 18 deletions(-) diff --git a/doc/src/bughowto.qdoc b/doc/src/bughowto.qdoc index a833e00..568c34e 100644 --- a/doc/src/bughowto.qdoc +++ b/doc/src/bughowto.qdoc @@ -51,7 +51,7 @@ compiled with \o Reliable and clear description on how to reproduce the problem \endlist - + If possible, please provide a test written using the QtTest module as this will improve the procedure of reproducing your problem and allow the developers to address the issue in a more efficient way. diff --git a/doc/src/examples/customtypesending.qdoc b/doc/src/examples/customtypesending.qdoc index 2c32154..c4f262b 100644 --- a/doc/src/examples/customtypesending.qdoc +++ b/doc/src/examples/customtypesending.qdoc @@ -34,10 +34,6 @@ \image customtypesending-example.png - Contents: - - \tableofcontents - \section1 Overview In the \l{Custom Type Example}, we showed how to integrate custom types @@ -51,7 +47,7 @@ a \c Window class containing signals and slots whose signatures include \c Message arguments. - \section1 The Window Class Definition + \section1 The Window and Message Class Definitions We define a simple \c Window class with a signal and public slot that allow a \c Message object to be sent via a signal-slot connection: @@ -64,6 +60,17 @@ instance in the \c thisMessage private variable which holds the actual message to be sent. + The \c Message class is defined in the following way: + + \snippet examples/tools/customtypesending/message.h custom type definition + + The type is declared to the meta-type system with the Q_DECLARE_METATYPE() + macro: + + \snippet examples/tools/customtypesending/message.h custom type meta-type declaration + + This will make the type available for use in direct signal-slot connections. + \section1 The Window Class Implementation The \c Window constructor sets up a user interface containing a text diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index 745baa3..2985e0a 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -236,6 +236,37 @@ This example shows how to enable text translation in QML. \image qml-i18n-example.png + + \section1 Introduction + + The QML runtime automatically loads a translation from the i18n subdirectory + of the root QML file, based on the system language. The translations are + held in QM files that must be generated from TS files. + + \section1 Updating Translations + + The \c{.ts} files are created and updated by running: + + \code + lupdate i18n.qml -ts i18n/base.ts + \endcode + + If no translation file exists, one will be created. If a file already exists, + it will be updated to contain the latest strings from the QML file. + + Translations for new languages are created by copying \c{i18n/base.ts} to + \c{i18n/qml_.ts} The TS files can then be edited with + \l{Qt Linguist Manual}{Qt Linguist}: + + \code + linguist i18n/qml_fr.ts + \endcode + + The run-time translation files are then generated by running: + + \code + lrelease i18n/*.ts + \endcode */ /*! diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc index 405997a..4f7c7bf 100644 --- a/doc/src/frameworks-technologies/threads.qdoc +++ b/doc/src/frameworks-technologies/threads.qdoc @@ -324,10 +324,6 @@ post events to objects that "live" in other threads. This is possible because each thread is allowed to have its own event loop. - - Topics: - - \tableofcontents \section1 QObject Reentrancy diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index d3c33d9..11b50c3 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -665,6 +665,10 @@ \brief The QtHelp module provides classes for integrating online documentation in applications. + The classes and tools supplied with Qt to enable developers to include + online help and documentation in their applications are described in + more detail in \l{The Qt Help Framework} overview document. + To include the definitions of the module's classes, use the following directive: 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 + 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/sqldatabase/sqldatabase.cpp b/doc/src/snippets/sqldatabase/sqldatabase.cpp index abe2a67..a027a84 100644 --- a/doc/src/snippets/sqldatabase/sqldatabase.cpp +++ b/doc/src/snippets/sqldatabase/sqldatabase.cpp @@ -280,7 +280,7 @@ QVariant MyModel::data(const QModelIndex &item, int role) const void QSqlTableModel_snippets() { //! [24] - QSqlTableModel *model = new QSqlTableModel; + QSqlTableModel *model = new QSqlTableModel(parentObject, database); model->setTable("employee"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->select(); diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp index eeb142b..568b398 100644 --- a/src/corelib/plugin/qsystemlibrary.cpp +++ b/src/corelib/plugin/qsystemlibrary.cpp @@ -57,8 +57,8 @@ The search order is the same as the order in DLL Safe search mode Windows, except that we don't search: * The current directory - * The 16-bit system directory. (normally c:\windows\system) - * The Windows directory. (normally c:\windows) + * The 16-bit system directory. (normally \c{c:\windows\system}) + * The Windows directory. (normally \c{c:\windows}) This means that the effective search order is: 1. Application path. diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dc0dbf4..2f85cd0 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -728,9 +728,9 @@ void QWidget::setAutoFillBackground(bool enabled) \list \i mouseMoveEvent() is called whenever the mouse moves while a mouse button is held down. This can be useful during drag and drop - operations. If you call setMouseTracking(true), you get mouse move - events even when no buttons are held down. (See also the \l{Drag - and Drop} guide.) + operations. If you call \l{setMouseTracking()}{setMouseTracking}(true), + you get mouse move events even when no buttons are held down. + (See also the \l{Drag and Drop} guide.) \i keyReleaseEvent() is called whenever a key is released and while it is held down (if the key is auto-repeating). In that case, the widget will receive a pair of key release and key press event for @@ -8664,8 +8664,8 @@ bool QWidget::event(QEvent *event) /*! This event handler can be reimplemented to handle state changes. - The state being changed in this event can be retrieved through event \a - event. + The state being changed in this event can be retrieved through the \a event + supplied. Change events include: QEvent::ToolBarChange, QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange, -- cgit v0.12