The TranslatableString class is a wrapper for The QString with boolean flag isKey.
More...
#include <translatablestring.h>
|
| static TranslatableString | tr (const QString &source) |
| | tr this method create a string translation wrapper and save translation key for lupdate tool
|
|
| QDataStream & | fromStream (QDataStream &stream) override |
| | fromStream This method should be read all bytes from the stream object and full the current object.
|
| QDataStream & | toStream (QDataStream &stream) const override |
| | fromStream This method should be write all members of the current object to the stream object.
|
| void | saveVersion (char version, QDataStream &stream) const |
| | saveVersion save version of the object to the stream.
|
| char | readVersion (QDataStream &stream) |
| | readVersion read version of the object from the stream.
|
| char | versionHeader (char version, QDataStream &stream) |
| | versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
|
| char | versionHeader (char version, QDataStream &stream) const |
| | versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
|
| template<class T> |
| void | readWrite (QDataStream &stream, const T &data) const |
| | readWrite this method automaticaly choose what we need to-do read or write.
|
| template<class T> |
| void | readWrite (QDataStream &stream, T &data) |
| | readWrite this method automaticaly choose what we need to-do read or write.
|
| template<typename... Args> |
| void | readWritePack (QDataStream &stream, Args &&... args) const |
| | readWritePack - this is a pack write or read from the srting
|
| template<typename... Args> |
| void | readWritePack (QDataStream &stream, Args &&... args) |
| | readWritePack - this is a pack write or read from the srting
|
| virtual int | parsingVersion () const |
| | parsingVersion this method return parsing version of Qt. By Default is 0 (last available parsing). see https://doc.qt.io/qt-6/qdatastream.html#Version-enum
|
| virtual unsigned int | typeId () const |
| | typeId This method return id of type.
|
The TranslatableString class is a wrapper for The QString with boolean flag isKey.
- Note
- ise this class if you want to save text into file and want to get correct translations after reading.
Definition at line 21 of file translatablestring.h.
◆ TranslatableString() [1/5]
| QH::TranslatableString::TranslatableString |
( |
int | data | ) |
|
◆ TranslatableString() [2/5]
| QH::TranslatableString::TranslatableString |
( |
const QString & | data = "", |
|
|
bool | isKey = true ) |
◆ TranslatableString() [3/5]
| QH::TranslatableString::TranslatableString |
( |
const QList< TranslatableString > & | pack | ) |
|
◆ TranslatableString() [4/5]
| QH::TranslatableString::TranslatableString |
( |
const TranslatableString & | | ) |
|
|
default |
◆ TranslatableString() [5/5]
| QH::TranslatableString::TranslatableString |
( |
TranslatableString && | | ) |
|
|
default |
◆ arg() [1/2]
◆ arg() [2/2]
◆ calcCrc32Hash()
| uint32_t QH::TranslatableString::calcCrc32Hash |
( |
| ) |
const |
◆ fromStream()
| QDataStream & QH::TranslatableString::fromStream |
( |
QDataStream & | stream | ) |
|
|
overrideprotectedvirtual |
fromStream This method should be read all bytes from the stream object and full the current object.
- Note
- The implementation of this method should be invoke a method of base class.
- Parameters
-
| stream | This is Qt stream object. |
- Returns
- Qt stream object.
Example of base simple implementation:
QDataStream &ExampleClass::fromStream(QDataStream &stream) const {
stream >> exampleMember;
return stream;
}
virtual QDataStream & toStream(QDataStream &stream) const =0
fromStream This method should be write all members of the current object to the stream object.
Implements QH::StreamBase.
Definition at line 75 of file translatablestring.cpp.
◆ isEmpty()
| bool QH::TranslatableString::isEmpty |
( |
| ) |
const |
◆ isValid()
| bool QH::TranslatableString::isValid |
( |
| ) |
const |
|
override |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
◆ rawText()
| const QString & QH::TranslatableString::rawText |
( |
| ) |
const |
rawText return raw key source.
- Returns
- source text (key if object created with the qtTrId method)
Definition at line 61 of file translatablestring.cpp.
◆ setArgs()
setArgs this method set args for translation.
- Parameters
-
| newArgs | this is a list of args. |
- Returns
- this object.
Definition at line 97 of file translatablestring.cpp.
◆ text()
| QString QH::TranslatableString::text |
( |
| ) |
const |
◆ toStream()
| QDataStream & QH::TranslatableString::toStream |
( |
QDataStream & | stream | ) |
const |
|
overrideprotectedvirtual |
fromStream This method should be write all members of the current object to the stream object.
- Note
- The implementation of this method should be invoke a method of base class.
- Parameters
-
| stream | This is Qt stream object. |
- Returns
- Qt stream object.
Example of base simple implementation:
QDataStream &ExampleClass::toStream(QDataStream &stream) const {
stream << exampleMember;
return stream;
}
Implements QH::StreamBase.
Definition at line 86 of file translatablestring.cpp.
◆ tr()
tr this method create a string translation wrapper and save translation key for lupdate tool
- Parameters
-
| source | this is text source. |
- Returns
Definition at line 71 of file translatablestring.cpp.
The documentation for this class was generated from the following files: