MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QLatin1Constant Class Reference

The QLatin1Constant class holds a Latin 1 string constant More...

 #include <QLatin1Constant>

Public Functions

const char * latin1 () const
bool operator!= ( const QLatin1Constant & other ) const
bool operator== ( const QLatin1Constant & other ) const

Macros

Q_DECLARE_LATIN1_CONSTANT
Q_DEFINE_LATIN1_CONSTANT

Detailed Description

The QLatin1Constant class holds a Latin 1 string constant

Member Function Documentation

const char * QLatin1Constant::latin1 () const

Returns the value of this literal as a C style string (null terminated).

bool QLatin1Constant::operator!= ( const QLatin1Constant & other ) const

Returns false if this QLatin1Constant is the same as other (either same object or same string literal), and true otherwise.

bool QLatin1Constant::operator== ( const QLatin1Constant & other ) const

Returns true if this QLatin1Constant is the same as other (either same object or same string literal), and false otherwise.

Macro Documentation

Q_DECLARE_LATIN1_CONSTANT

This macro, along with the related Q_DEFINE_LATIN1_CONSTANT macro, allows you to describe a "Latin 1 string constant".

The resulting constant can be passed to functions accepting a QLatin1String, a QString, or a QVariant.

The first parameter is the name of the variable to declare. The second parameter is the value of the constant, as a string literal.

For example:

 // in a header file
 Q_DECLARE_LATIN1_CONSTANT(MyConstant, "MYCONSTANT");

The declaration should be paired with a matching Q_DEFINE_LATIN1_CONSTANT with the same arguments to actually define the constant.

See also Q_DEFINE_LATIN1_CONSTANT.

Q_DEFINE_LATIN1_CONSTANT

This macro, along with the related Q_DECLARE_LATIN1_CONSTANT macro, allows you to describe a "Latin 1 string constant".

The resulting constant can be passed to functions accepting a QLatin1String, a QString, or a QVariant.

The first parameter is the name of the variable to define. The second parameter is the value of the constant, as a string literal.

For example:

 // in a header file
 Q_DECLARE_LATIN1_CONSTANT(MyConstant, "MYCONSTANT");

 // in source file
 Q_DEFINE_LATIN1_CONSTANT(MyConstant, "MYCONSTANT");

You can use this macro without the matching DECLARE macro if you are using the constant only in a single compilation unit.

See also Q_DECLARE_LATIN1_CONSTANT.