Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos
Referencia de la Clase QTranslatorMessage

The QTranslatorMessage class contains a translator message and its properties. Más...

#include <qtranslator.h>

Diagrama de herencias de QTranslatorMessage
MetaTranslatorMessage MetaTranslatorMessage

Lista de todos los miembros.

Tipos públicos

enum  Prefix {
  NoPrefix, Hash, HashContext, HashContextSourceText,
  HashContextSourceTextComment, NoPrefix, Hash, HashContext,
  HashContextSourceText, HashContextSourceTextComment
}
enum  Prefix {
  NoPrefix, Hash, HashContext, HashContextSourceText,
  HashContextSourceTextComment, NoPrefix, Hash, HashContext,
  HashContextSourceText, HashContextSourceTextComment
}

Métodos públicos

 QTranslatorMessage ()
 QTranslatorMessage (const char *context, const char *sourceText, const char *comment, const QString &translation=QString::null)
 QTranslatorMessage (QDataStream &)
 QTranslatorMessage (const QTranslatorMessage &m)
QTranslatorMessageoperator= (const QTranslatorMessage &m)
uint hash () const
const char * context () const
const char * sourceText () const
const char * comment () const
void setTranslation (const QString &translation)
QString translation () const
void write (QDataStream &s, bool strip=FALSE, Prefix prefix=HashContextSourceTextComment) const
Prefix commonPrefix (const QTranslatorMessage &) const
bool operator== (const QTranslatorMessage &m) const
bool operator!= (const QTranslatorMessage &m) const
bool operator< (const QTranslatorMessage &m) const
bool operator<= (const QTranslatorMessage &m) const
bool operator> (const QTranslatorMessage &m) const
bool operator>= (const QTranslatorMessage &m) const
 QTranslatorMessage ()
 QTranslatorMessage (const char *context, const char *sourceText, const char *comment, const QString &translation=QString::null)
 QTranslatorMessage (QDataStream &)
 QTranslatorMessage (const QTranslatorMessage &m)
QTranslatorMessageoperator= (const QTranslatorMessage &m)
uint hash () const
const char * context () const
const char * sourceText () const
const char * comment () const
void setTranslation (const QString &translation)
QString translation () const
void write (QDataStream &s, bool strip=FALSE, Prefix prefix=HashContextSourceTextComment) const
Prefix commonPrefix (const QTranslatorMessage &) const
bool operator== (const QTranslatorMessage &m) const
bool operator!= (const QTranslatorMessage &m) const
bool operator< (const QTranslatorMessage &m) const
bool operator<= (const QTranslatorMessage &m) const
bool operator> (const QTranslatorMessage &m) const
bool operator>= (const QTranslatorMessage &m) const

Descripción detallada

The QTranslatorMessage class contains a translator message and its properties.

This class is of no interest to most applications. It is useful for translation tools such as Qt Linguist. It is provided simply to make the API complete and regular.

For a QTranslator object, a lookup key is a triple (context, {source text}, comment) that uniquely identifies a message. An extended key is a quadruple (hash, context, {source text}, comment), where hash is computed from the source text and the comment. Unless you plan to read and write messages yourself, you need not worry about the hash value.

QTranslatorMessage stores this triple or quadruple and the relevant translation if there is any.

Ver también:
QTranslator

Documentación de las enumeraciones miembro de la clase

Let (h, c, s, m) be the extended key. The possible prefixes are

NoPrefix no prefix Hash only (h) HashContext only (h, c) HashContextSourceText only (h, c, s) HashContextSourceTextComment the whole extended key, (h, c, s, m)

Ver también:
write() commonPrefix()
Valores de enumeraciones:
NoPrefix 
Hash 
HashContext 
HashContextSourceText 
HashContextSourceTextComment 
NoPrefix 
Hash 
HashContext 
HashContextSourceText 
HashContextSourceTextComment 
Valores de enumeraciones:
NoPrefix 
Hash 
HashContext 
HashContextSourceText 
HashContextSourceTextComment 
NoPrefix 
Hash 
HashContext 
HashContextSourceText 
HashContextSourceTextComment 

Documentación del constructor y destructor

QTranslatorMessage::QTranslatorMessage ( )

Constructs a translator message with the extended key (0, 0, 0, 0) and QString::null as translation.

QTranslatorMessage::QTranslatorMessage ( const char *  context,
const char *  sourceText,
const char *  comment,
const QString translation = QString::null 
)

Constructs an translator message with the extended key (h, context, sourceText, comment), where h is computed from sourceText and comment, and possibly with a translation.

QTranslatorMessage::QTranslatorMessage ( QDataStream stream)

Constructs a translator message read from the stream. The resulting message may have any combination of content.

Ver también:
QTranslator::save()
QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage m)

Constructs a copy of translator message m.

QTranslatorMessage::QTranslatorMessage ( )
QTranslatorMessage::QTranslatorMessage ( const char *  context,
const char *  sourceText,
const char *  comment,
const QString translation = QString::null 
)
QTranslatorMessage::QTranslatorMessage ( QDataStream )
QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage m)

Documentación de las funciones miembro

const char * QTranslatorMessage::comment ( ) const [inline]

Returns the comment for this message (e.g. "File|Save").

Atención:
This may return 0 if the QTranslator object is stripped (compressed).
const char* QTranslatorMessage::comment ( ) const [inline]
QTranslatorMessage::Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage m) const

Returns the widest lookup prefix that is common to this translator message and to message m.

For example, if the extended key is for this message is (71, "PrintDialog", "Yes", "Print?") and that for m is (71, "PrintDialog", "No", "Print?"), this function returns HashContext.

Ver también:
write()
Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage ) const
const char * QTranslatorMessage::context ( ) const [inline]

Returns the context for this message (e.g. "MyDialog").

Atención:
This may return 0 if the QTranslator object is stripped (compressed).
const char* QTranslatorMessage::context ( ) const [inline]
uint QTranslatorMessage::hash ( ) const [inline]
uint QTranslatorMessage::hash ( ) const [inline]

Returns the hash value used internally to represent the lookup key. This value is zero only if this translator message was constructed from a stream containing invalid data.

The hashing function is unspecified, but it will remain unchanged in future versions of Qt.

bool QTranslatorMessage::operator!= ( const QTranslatorMessage m) const [inline]

Returns TRUE if the extended key of this object is different from that of m; otherwise returns FALSE.

bool QTranslatorMessage::operator!= ( const QTranslatorMessage m) const [inline]
bool QTranslatorMessage::operator< ( const QTranslatorMessage m) const

Returns TRUE if the extended key of this object is lexicographically before than that of m; otherwise returns FALSE.

bool QTranslatorMessage::operator< ( const QTranslatorMessage m) const
bool QTranslatorMessage::operator<= ( const QTranslatorMessage m) const [inline]

Returns TRUE if the extended key of this object is lexicographically before that of m or if they are equal; otherwise returns FALSE.

bool QTranslatorMessage::operator<= ( const QTranslatorMessage m) const [inline]
QTranslatorMessage& QTranslatorMessage::operator= ( const QTranslatorMessage m)
QTranslatorMessage & QTranslatorMessage::operator= ( const QTranslatorMessage m)

Assigns message m to this translator message and returns a reference to this translator message.

bool QTranslatorMessage::operator== ( const QTranslatorMessage m) const

Returns TRUE if the extended key of this object is equal to that of m; otherwise returns FALSE.

bool QTranslatorMessage::operator== ( const QTranslatorMessage m) const
bool QTranslatorMessage::operator> ( const QTranslatorMessage m) const [inline]
bool QTranslatorMessage::operator> ( const QTranslatorMessage m) const [inline]

Returns TRUE if the extended key of this object is lexicographically after that of m; otherwise returns FALSE.

bool QTranslatorMessage::operator>= ( const QTranslatorMessage m) const [inline]

Returns TRUE if the extended key of this object is lexicographically after that of m or if they are equal; otherwise returns FALSE.

bool QTranslatorMessage::operator>= ( const QTranslatorMessage m) const [inline]
void QTranslatorMessage::setTranslation ( const QString translation) [inline]
void QTranslatorMessage::setTranslation ( const QString translation) [inline]

Sets the translation of the source text to translation.

Ver también:
translation()
const char * QTranslatorMessage::sourceText ( ) const [inline]

Returns the source text of this message (e.g. "&Save").

Atención:
This may return 0 if the QTranslator object is stripped (compressed).
const char* QTranslatorMessage::sourceText ( ) const [inline]
QString QTranslatorMessage::translation ( ) const [inline]
QString QTranslatorMessage::translation ( ) const [inline]

Returns the translation of the source text (e.g., "&Sauvegarder").

Ver también:
setTranslation()
void QTranslatorMessage::write ( QDataStream stream,
bool  strip = FALSE,
Prefix  prefix = HashContextSourceTextComment 
) const

Writes this translator message to the stream. If strip is FALSE (the default), all the information in the message is written. If strip is TRUE, only the part of the extended key specified by prefix is written with the translation (HashContextSourceTextComment by default).

Ver también:
commonPrefix()
void QTranslatorMessage::write ( QDataStream s,
bool  strip = FALSE,
Prefix  prefix = HashContextSourceTextComment 
) const

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'