diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-23 12:42:20 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-23 12:42:20 +0900 |
commit | b35e0845dc9b3c8b9a5e52a682c769f383933fae (patch) | |
tree | e4eeca8f6fe0ca87e774be98eabf89b4c7fca347 /tools/linguist/book/linguist-programmer.leaf | |
parent | 1ba13366a7a377d50b9e8df9044ce11d8209f98c (diff) | |
download | tqt3-b35e0845dc9b3c8b9a5e52a682c769f383933fae.tar.gz tqt3-b35e0845dc9b3c8b9a5e52a682c769f383933fae.zip |
Replace QObject, QWidget, QImage, QPair, QRgb, QColor, QChar, QString, QIODevice with TQ* version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tools/linguist/book/linguist-programmer.leaf')
-rw-r--r-- | tools/linguist/book/linguist-programmer.leaf | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/linguist/book/linguist-programmer.leaf b/tools/linguist/book/linguist-programmer.leaf index 31225a6ac..120dab0ff 100644 --- a/tools/linguist/book/linguist-programmer.leaf +++ b/tools/linguist/book/linguist-programmer.leaf @@ -116,7 +116,7 @@ will fall back to using the original source text. \section2 Making the Application Translate User-Visible Strings \index tr() -\index QObject!tr() +\index TQObject!tr() User-visible strings are marked as translation targets by wrapping them in a \c tr() call, for example: @@ -132,11 +132,11 @@ would become \index TQ_OBJECT -All \l QObject subclasses that use the \c TQ_OBJECT macro implement +All \l TQObject subclasses that use the \c TQ_OBJECT macro implement the \c tr() function. Although the \c tr() call is normally made directly since it is -usually called as a member function of a \l QObject subclass, in +usually called as a member function of a \l TQObject subclass, in other cases an explicit class name can be supplied, for example: \code @@ -146,7 +146,7 @@ other cases an explicit class name can be supplied, for example: or \code - QObject::tr("&Quit") + TQObject::tr("&Quit") \endcode \section2 Distinguishing Identical Strings That Require Different @@ -235,11 +235,11 @@ MyClass::tr(): After the comment, all references to \c MyClass::tr() will be understood as meaning \c MyNamespace::MyClass::tr(). -\section2 Translating Text that is Outside of a QObject subclass +\section2 Translating Text that is Outside of a TQObject subclass \section3 Using QApplication::translate() -If the quoted text is not in a member function of a QObject subclass, +If the quoted text is not in a member function of a TQObject subclass, use either the tr() function of an appropriate class, or the QApplication::translate() function directly: @@ -267,7 +267,7 @@ The macros expand to just the text (without the context). Example of TQT_TR_NOOP(): \code - QString FriendlyConversation::greeting( int greet_type ) + TQString FriendlyConversation::greeting( int greet_type ) { static const char* greeting_strings[] = { TQT_TR_NOOP( "Hello" ), @@ -284,12 +284,12 @@ Example of TQT_TRANSLATE_NOOP(): TQT_TRANSLATE_NOOP( "FriendlyConversation", "Goodbye" ) }; - QString FriendlyConversation::greeting( int greet_type ) + TQString FriendlyConversation::greeting( int greet_type ) { return tr( greeting_strings[greet_type] ); } - QString global_greeting( int greet_type ) + TQString global_greeting( int greet_type ) { return tqApp->translate( "FriendlyConversation", greeting_strings[greet_type] ); @@ -370,12 +370,12 @@ was found and contains a translation for "Hello world!", the translation appears; if not, the source text appears. \index tr() -\index QObject!tr() +\index TQObject!tr() -All classes that inherit \l QObject have a \c tr() function. Inside -a member function of a \l QObject class, we simply write \c tr("Hello +All classes that inherit \l TQObject have a \c tr() function. Inside +a member function of a \l TQObject class, we simply write \c tr("Hello world!") instead of \c QPushButton::tr("Hello world!") or \c -QObject::tr("Hello world!"). +TQObject::tr("Hello world!"). \section3 Running the Application in English @@ -573,7 +573,7 @@ texts marked for translation with \c tr() calls and their contexts. \index English Language In \c arrowpad.h we define the \c ArrowPad subclass which is a -subclass of \l QWidget. In the \e {Tutorial 2 Screenshot, English +subclass of \l TQWidget. In the \e {Tutorial 2 Screenshot, English version}, above, the central widget with the four buttons is an \c ArrowPad. @@ -583,7 +583,7 @@ version}, above, the central widget with the four buttons is an \index TQ_OBJECT \index tr() -\index QObject!tr() +\index TQObject!tr() \index Translation Contexts \index Contexts!for Translation @@ -856,7 +856,7 @@ The PrintPanel is defined in \c printpanel.h. \index PrintPanel!in Translation Tutorial -PrintPanel is a \l QWidget. It needs the \c TQ_OBJECT macro for \c +PrintPanel is a \l TQWidget. It needs the \c TQ_OBJECT macro for \c tr() to work properly. The implementation file is \c printpanel.cpp. |