Eneboo - Documentación para desarrolladores
|
The QString class provides an abstraction of Unicode text and the classic C '\0'-terminated char array. Más...
#include <qstring.h>
Tipos públicos | |
enum | SectionFlags { SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08, SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08 } |
enum | SectionFlags { SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08, SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08 } |
Métodos públicos | |
QString () | |
QString (QChar) | |
QString (const QString &) | |
QString (const QByteArray &) | |
QString (const QChar *unicode, uint length) | |
QString (const char *str) | |
QString (const std::string &) | |
~QString () | |
QString & | operator= (const QString &) |
QString & | operator= (const char *) |
QString & | operator= (const std::string &) |
QString & | operator= (const QCString &) |
QString & | operator= (QChar c) |
QString & | operator= (char c) |
bool | isNull () const |
bool | isEmpty () const |
uint | length () const |
void | truncate (uint pos) |
QString & | fill (QChar c, int len=-1) |
QString | copy () const |
QString | arg (long a, int fieldWidth=0, int base=10) const |
QString | arg (ulong a, int fieldWidth=0, int base=10) const |
QString | arg (Q_LLONG a, int fieldwidth=0, int base=10) const |
QString | arg (Q_ULLONG a, int fieldwidth=0, int base=10) const |
QString | arg (int a, int fieldWidth=0, int base=10) const |
QString | arg (uint a, int fieldWidth=0, int base=10) const |
QString | arg (short a, int fieldWidth=0, int base=10) const |
QString | arg (ushort a, int fieldWidth=0, int base=10) const |
QString | arg (double a, int fieldWidth=0, char fmt= 'g', int prec=-1) const |
QString | arg (char a, int fieldWidth=0) const |
QString | arg (QChar a, int fieldWidth=0) const |
QString | arg (const QString &a, int fieldWidth=0) const |
QString | arg (const QString &a1, const QString &a2) const |
QString | arg (const QString &a1, const QString &a2, const QString &a3) const |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4) const |
QString & | sprintf (const char *format,...) |
int | find (QChar c, int index=0, bool cs=TRUE) const |
int | find (char c, int index=0, bool cs=TRUE) const |
int | find (const QString &str, int index=0, bool cs=TRUE) const |
int | find (const QRegExp &, int index=0) const |
int | find (const char *str, int index=0) const |
int | findRev (QChar c, int index=-1, bool cs=TRUE) const |
int | findRev (char c, int index=-1, bool cs=TRUE) const |
int | findRev (const QString &str, int index=-1, bool cs=TRUE) const |
int | findRev (const QRegExp &, int index=-1) const |
int | findRev (const char *str, int index=-1) const |
int | contains (QChar c, bool cs=TRUE) const |
int | contains (char c, bool cs=TRUE) const |
int | contains (const char *str, bool cs=TRUE) const |
int | contains (const QString &str, bool cs=TRUE) const |
int | contains (const QRegExp &) const |
QString | section (QChar sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (char sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const char *in_sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const QString &in_sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const QRegExp ®, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | left (uint len) const |
QString | right (uint len) const |
QString | mid (uint index, uint len=0xffffffff) const |
QString | leftJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | rightJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | lower () const |
QString | upper () const |
QString | stripWhiteSpace () const |
QString | simplifyWhiteSpace () const |
QString & | insert (uint index, const QString &) |
QString & | insert (uint index, const QByteArray &) |
QString & | insert (uint index, const char *) |
QString & | insert (uint index, const QChar *, uint len) |
QString & | insert (uint index, QChar) |
QString & | insert (uint index, char c) |
QString & | append (char) |
QString & | append (QChar) |
QString & | append (const QString &) |
QString & | append (const QByteArray &) |
QString & | append (const char *) |
QString & | append (const std::string &) |
QString & | prepend (char) |
QString & | prepend (QChar) |
QString & | prepend (const QString &) |
QString & | prepend (const QByteArray &) |
QString & | prepend (const char *) |
QString & | prepend (const std::string &) |
QString & | remove (uint index, uint len) |
QString & | remove (const QString &) |
QString & | remove (const QString &, bool cs) |
QString & | remove (QChar c) |
QString & | remove (char c) |
QString & | remove (const char *) |
QString & | remove (const QRegExp &) |
QString & | replace (uint index, uint len, const QString &) |
QString & | replace (uint index, uint len, const QChar *, uint clen) |
QString & | replace (uint index, uint len, QChar) |
QString & | replace (uint index, uint len, char c) |
QString & | replace (QChar c, const QString &) |
QString & | replace (QChar c, const QString &, bool) |
QString & | replace (char c, const QString &after) |
QString & | replace (char c, const QString &after, bool cs) |
QString & | replace (const QString &, const QString &) |
QString & | replace (const QString &, const QString &, bool) |
QString & | replace (const QRegExp &, const QString &) |
QString & | replace (QChar, QChar) |
short | toShort (bool *ok=0, int base=10) const |
ushort | toUShort (bool *ok=0, int base=10) const |
int | toInt (bool *ok=0, int base=10) const |
uint | toUInt (bool *ok=0, int base=10) const |
long | toLong (bool *ok=0, int base=10) const |
ulong | toULong (bool *ok=0, int base=10) const |
Q_LLONG | toLongLong (bool *ok=0, int base=10) const |
Q_ULLONG | toULongLong (bool *ok=0, int base=10) const |
float | toFloat (bool *ok=0) const |
double | toDouble (bool *ok=0) const |
QString & | setNum (short, int base=10) |
QString & | setNum (ushort, int base=10) |
QString & | setNum (int, int base=10) |
QString & | setNum (uint, int base=10) |
QString & | setNum (long, int base=10) |
QString & | setNum (ulong, int base=10) |
QString & | setNum (Q_LLONG, int base=10) |
QString & | setNum (Q_ULLONG, int base=10) |
QString & | setNum (float, char f='g', int prec=6) |
QString & | setNum (double, char f='g', int prec=6) |
void | setExpand (uint index, QChar c) |
QString & | operator+= (const QString &str) |
QString & | operator+= (const QByteArray &str) |
QString & | operator+= (const char *str) |
QString & | operator+= (const std::string &) |
QString & | operator+= (QChar c) |
QString & | operator+= (char c) |
QChar | at (uint i) const |
QChar | operator[] (int i) const |
QCharRef | at (uint i) |
QCharRef | operator[] (int i) |
QChar | constref (uint i) const |
QChar & | ref (uint i) |
const QChar * | unicode () const |
const char * | ascii () const |
const char * | latin1 () const |
QCString | utf8 () const |
QCString | local8Bit () const |
bool | operator! () const |
operator const char * () const | |
operator std::string () const | |
const unsigned short * | ucs2 () const |
QString & | setUnicode (const QChar *unicode, uint len) |
QString & | setUnicodeCodes (const ushort *unicode_as_ushorts, uint len) |
QString & | setAscii (const char *, int len=-1) |
QString & | setLatin1 (const char *, int len=-1) |
int | compare (const QString &s) const |
int | localeAwareCompare (const QString &s) const |
void | compose () |
const char * | data () const |
bool | startsWith (const QString &str) const |
bool | startsWith (const QString &str, bool cs) const |
bool | endsWith (const QString &str) const |
bool | endsWith (const QString &str, bool cs) const |
void | setLength (uint newLength) |
uint | capacity () const |
void | reserve (uint minCapacity) |
void | squeeze () |
bool | simpleText () const |
bool | isRightToLeft () const |
QString () | |
QString (QChar) | |
QString (const QString &) | |
QString (const QByteArray &) | |
QString (const QChar *unicode, uint length) | |
QString (const char *str) | |
QString (const std::string &) | |
~QString () | |
QString & | operator= (const QString &) |
QString & | operator= (const char *) |
QString & | operator= (const std::string &) |
QString & | operator= (const QCString &) |
QString & | operator= (QChar c) |
QString & | operator= (char c) |
bool | isNull () const |
bool | isEmpty () const |
uint | length () const |
void | truncate (uint pos) |
QString & | fill (QChar c, int len=-1) |
QString | copy () const |
QString | arg (long a, int fieldWidth=0, int base=10) const |
QString | arg (ulong a, int fieldWidth=0, int base=10) const |
QString | arg (Q_LLONG a, int fieldwidth=0, int base=10) const |
QString | arg (Q_ULLONG a, int fieldwidth=0, int base=10) const |
QString | arg (int a, int fieldWidth=0, int base=10) const |
QString | arg (uint a, int fieldWidth=0, int base=10) const |
QString | arg (short a, int fieldWidth=0, int base=10) const |
QString | arg (ushort a, int fieldWidth=0, int base=10) const |
QString | arg (double a, int fieldWidth=0, char fmt= 'g', int prec=-1) const |
QString | arg (char a, int fieldWidth=0) const |
QString | arg (QChar a, int fieldWidth=0) const |
QString | arg (const QString &a, int fieldWidth=0) const |
QString | arg (const QString &a1, const QString &a2) const |
QString | arg (const QString &a1, const QString &a2, const QString &a3) const |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4) const |
QString & | sprintf (const char *format,...) |
int | find (QChar c, int index=0, bool cs=TRUE) const |
int | find (char c, int index=0, bool cs=TRUE) const |
int | find (const QString &str, int index=0, bool cs=TRUE) const |
int | find (const QRegExp &, int index=0) const |
int | find (const char *str, int index=0) const |
int | findRev (QChar c, int index=-1, bool cs=TRUE) const |
int | findRev (char c, int index=-1, bool cs=TRUE) const |
int | findRev (const QString &str, int index=-1, bool cs=TRUE) const |
int | findRev (const QRegExp &, int index=-1) const |
int | findRev (const char *str, int index=-1) const |
int | contains (QChar c, bool cs=TRUE) const |
int | contains (char c, bool cs=TRUE) const |
int | contains (const char *str, bool cs=TRUE) const |
int | contains (const QString &str, bool cs=TRUE) const |
int | contains (const QRegExp &) const |
QString | section (QChar sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (char sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const char *in_sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const QString &in_sep, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | section (const QRegExp ®, int start, int end=0xffffffff, int flags=SectionDefault) const |
QString | left (uint len) const |
QString | right (uint len) const |
QString | mid (uint index, uint len=0xffffffff) const |
QString | leftJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | rightJustify (uint width, QChar fill=' ', bool trunc=FALSE) const |
QString | lower () const |
QString | upper () const |
QString | stripWhiteSpace () const |
QString | simplifyWhiteSpace () const |
QString & | insert (uint index, const QString &) |
QString & | insert (uint index, const QByteArray &) |
QString & | insert (uint index, const char *) |
QString & | insert (uint index, const QChar *, uint len) |
QString & | insert (uint index, QChar) |
QString & | insert (uint index, char c) |
QString & | append (char) |
QString & | append (QChar) |
QString & | append (const QString &) |
QString & | append (const QByteArray &) |
QString & | append (const char *) |
QString & | append (const std::string &) |
QString & | prepend (char) |
QString & | prepend (QChar) |
QString & | prepend (const QString &) |
QString & | prepend (const QByteArray &) |
QString & | prepend (const char *) |
QString & | prepend (const std::string &) |
QString & | remove (uint index, uint len) |
QString & | remove (const QString &) |
QString & | remove (const QString &, bool cs) |
QString & | remove (QChar c) |
QString & | remove (char c) |
QString & | remove (const char *) |
QString & | remove (const QRegExp &) |
QString & | replace (uint index, uint len, const QString &) |
QString & | replace (uint index, uint len, const QChar *, uint clen) |
QString & | replace (uint index, uint len, QChar) |
QString & | replace (uint index, uint len, char c) |
QString & | replace (QChar c, const QString &) |
QString & | replace (QChar c, const QString &, bool) |
QString & | replace (char c, const QString &after) |
QString & | replace (char c, const QString &after, bool cs) |
QString & | replace (const QString &, const QString &) |
QString & | replace (const QString &, const QString &, bool) |
QString & | replace (const QRegExp &, const QString &) |
QString & | replace (QChar, QChar) |
short | toShort (bool *ok=0, int base=10) const |
ushort | toUShort (bool *ok=0, int base=10) const |
int | toInt (bool *ok=0, int base=10) const |
uint | toUInt (bool *ok=0, int base=10) const |
long | toLong (bool *ok=0, int base=10) const |
ulong | toULong (bool *ok=0, int base=10) const |
Q_LLONG | toLongLong (bool *ok=0, int base=10) const |
Q_ULLONG | toULongLong (bool *ok=0, int base=10) const |
float | toFloat (bool *ok=0) const |
double | toDouble (bool *ok=0) const |
QString & | setNum (short, int base=10) |
QString & | setNum (ushort, int base=10) |
QString & | setNum (int, int base=10) |
QString & | setNum (uint, int base=10) |
QString & | setNum (long, int base=10) |
QString & | setNum (ulong, int base=10) |
QString & | setNum (Q_LLONG, int base=10) |
QString & | setNum (Q_ULLONG, int base=10) |
QString & | setNum (float, char f='g', int prec=6) |
QString & | setNum (double, char f='g', int prec=6) |
void | setExpand (uint index, QChar c) |
QString & | operator+= (const QString &str) |
QString & | operator+= (const QByteArray &str) |
QString & | operator+= (const char *str) |
QString & | operator+= (const std::string &) |
QString & | operator+= (QChar c) |
QString & | operator+= (char c) |
QChar | at (uint i) const |
QChar | operator[] (int i) const |
QCharRef | at (uint i) |
QCharRef | operator[] (int i) |
QChar | constref (uint i) const |
QChar & | ref (uint i) |
const QChar * | unicode () const |
const char * | ascii () const |
const char * | latin1 () const |
QCString | utf8 () const |
QCString | local8Bit () const |
bool | operator! () const |
operator const char * () const | |
operator std::string () const | |
const unsigned short * | ucs2 () const |
QString & | setUnicode (const QChar *unicode, uint len) |
QString & | setUnicodeCodes (const ushort *unicode_as_ushorts, uint len) |
QString & | setAscii (const char *, int len=-1) |
QString & | setLatin1 (const char *, int len=-1) |
int | compare (const QString &s) const |
int | localeAwareCompare (const QString &s) const |
void | compose () |
const char * | data () const |
bool | startsWith (const QString &str) const |
bool | startsWith (const QString &str, bool cs) const |
bool | endsWith (const QString &str) const |
bool | endsWith (const QString &str, bool cs) const |
void | setLength (uint newLength) |
uint | capacity () const |
void | reserve (uint minCapacity) |
void | squeeze () |
bool | simpleText () const |
bool | isRightToLeft () const |
Métodos públicos estáticos | |
static QString | number (long, int base=10) |
static QString | number (ulong, int base=10) |
static QString | number (Q_LLONG, int base=10) |
static QString | number (Q_ULLONG, int base=10) |
static QString | number (int, int base=10) |
static QString | number (uint, int base=10) |
static QString | number (double, char f='g', int prec=6) |
static QString | fromAscii (const char *, int len=-1) |
static QString | fromLatin1 (const char *, int len=-1) |
static QString | fromUtf8 (const char *, int len=-1) |
static QString | fromLocal8Bit (const char *, int len=-1) |
static QString | fromUcs2 (const unsigned short *ucs2) |
static int | compare (const QString &s1, const QString &s2) |
static int | localeAwareCompare (const QString &s1, const QString &s2) |
static QString | number (long, int base=10) |
static QString | number (ulong, int base=10) |
static QString | number (Q_LLONG, int base=10) |
static QString | number (Q_ULLONG, int base=10) |
static QString | number (int, int base=10) |
static QString | number (uint, int base=10) |
static QString | number (double, char f='g', int prec=6) |
static QString | fromAscii (const char *, int len=-1) |
static QString | fromLatin1 (const char *, int len=-1) |
static QString | fromUtf8 (const char *, int len=-1) |
static QString | fromLocal8Bit (const char *, int len=-1) |
static QString | fromUcs2 (const unsigned short *ucs2) |
static int | compare (const QString &s1, const QString &s2) |
static int | localeAwareCompare (const QString &s1, const QString &s2) |
Atributos públicos | |
QT_STATIC_CONST QString | null |
Amigas | |
class | QConstString |
class | QTextStream |
class | QDeepCopy< QString > |
Q_EXPORT QDataStream & | operator>> (QDataStream &, QString &) |
Q_EXPORT QDataStream & | operator>> (QDataStream &, QString &) |
Funciones relacionadas | |
(Observar que estas no son funciones miembro.) | |
bool | operator== (const QString &s1, const QString &s2) |
bool | operator== (const QString &s1, const char *s2) |
bool | operator== (const char *s1, const QString &s2) |
bool | operator!= (const QString &s1, const QString &s2) |
bool | operator!= (const QString &s1, const char *s2) |
bool | operator!= (const char *s1, const QString &s2) |
bool | operator< (const QString &s1, const char *s2) |
bool | operator< (const char *s1, const QString &s2) |
bool | operator<= (const QString &s1, const char *s2) |
bool | operator<= (const char *s1, const QString &s2) |
bool | operator> (const QString &s1, const char *s2) |
bool | operator> (const char *s1, const QString &s2) |
bool | operator>= (const QString &s1, const char *s2) |
bool | operator>= (const char *s1, const QString &s2) |
const QString | operator+ (const QString &s1, const QString &s2) |
const QString | operator+ (const QString &s1, const char *s2) |
const QString | operator+ (const char *s1, const QString &s2) |
const QString | operator+ (const QString &s, char c) |
const QString | operator+ (char c, const QString &s) |
QDataStream & | operator<< (QDataStream &s, const QString &str) |
The QString class provides an abstraction of Unicode text and the classic C '\0'-terminated char array.
QString uses implicit sharing, which makes it very efficient and easy to use.
In all of the QString methods that take {const
char *} parameters, the {const
char *} is interpreted as a classic C-style '\0'-terminated ASCII string. It is legal for the {const
char *} parameter to be 0. If the {const
char *} is not '\0'-terminated, the results are undefined. Functions that copy classic C strings into a QString will not copy the terminating '\0' character. The QChar array of the QString (as returned by unicode()) is generally not terminated by a '\0'. If you need to pass a QString to a function that requires a C '\0'-terminated string use latin1().
QString::null A QString that has not been assigned to anything is null, i.e. both the length and data pointer is 0. A QString that references the empty string ("", a single '\0' char) is empty. Both null and empty QStrings are legal parameters to the methods. Assigning {(const char *) 0} to QString gives a null QString. For convenience,
QString::null
is a null QString. When sorting, empty strings come first, followed by non-empty strings, followed by null strings. We recommend using {if ( !str.isNull() )} to check for a non-null string rather than
{if ( !str )}; see operator!() for an explanation.
Note that if you find that you are mixing usage of QCString, QString, and QByteArray, this causes lots of unnecessary copying and might indicate that the true nature of the data you are dealing with is uncertain. If the data is '\0'-terminated 8-bit data, use QCString; if it is unterminated (i.e. contains '\0's) 8-bit data, use QByteArray; if it is text, use QString.
Lists of strings are handled by the QStringList class. You can split a string into a list of strings using QStringList::split(), and join a list of strings into a single string with an optional separator using QStringList::join(). You can obtain a list of strings from a string list that contain a particular substring or that match a particular regex using QStringList::grep().
Note for C programmers
Due to C++'s type system and the fact that QString is implicitly shared, QStrings can be treated like ints or other simple base types. For example:
QString boolToString( bool b ) { QString result; if ( b ) result = "True"; else result = "False"; return result; }
The variable, result, is an auto variable allocated on the stack. When return is called, because we're returning by value, The copy constructor is called and a copy of the string is returned. (No actual copying takes place thanks to the implicit sharing, see below.)
Throughout Qt's source code you will encounter QString usages like this:
The 'copying' of input to output is almost as fast as copying a pointer because behind the scenes copying is achieved by incrementing a reference count. QString (like all Qt's implicitly shared classes) operates on a copy-on-write basis, only copying if an instance is actually changed.
If you wish to create a deep copy of a QString without losing any Unicode information then you should use QDeepCopy.
SectionDefault Empty fields are counted, leading and trailing separators are not included, and the separator is compared case sensitively.
SectionSkipEmpty Treat empty fields as if they don't exist, i.e. they are not considered as far as start and end are concerned.
SectionIncludeLeadingSep Include the leading separator (if any) in the result string.
SectionIncludeTrailingSep Include the trailing separator (if any) in the result string.
SectionCaseInsensitiveSeps Compare the separator case-insensitively.
Any of the last four values can be OR-ed together to form a flag.
QString::QString | ( | ) | [inline] |
Constructs a null string, i.e. both the length and data pointer are 0.
QString::QString | ( | QChar | ch | ) |
Constructs a string of length one, containing the character ch.
QString::QString | ( | const QString & | s | ) |
Constructs an implicitly shared copy of s. This is very fast since it only involves incrementing a reference count.
QString::QString | ( | const QByteArray & | ba | ) |
Constructs a string that is a deep copy of ba interpreted as a classic C string.
Constructs a string that is a deep copy of the first length characters in the QChar array.
If unicode and length are 0, then a null string is created.
If only unicode is 0, the string is empty but has length characters of space preallocated: QString expands automatically anyway, but this may speed up some cases a little. We recommend using the plain constructor and setLength() for this purpose since it will result in more readable code.
QString::QString | ( | const char * | str | ) |
Constructs a string that is a deep copy of str, interpreted as a classic C string. The encoding is assumed to be Latin-1, unless you change it using QTextCodec::setCodecForCStrings().
If str is 0, then a null string is created.
This is a cast constructor, but it is perfectly safe: converting a Latin-1 {const char *} to QString preserves all the information. You can disable this constructor by defining
QT_NO_CAST_ASCII
when you compile your applications. You can also make QString objects by using setLatin1(), fromLatin1(), fromLocal8Bit(), and fromUtf8(). Or whatever encoding is appropriate for the 8-bit data you have.
QString::QString | ( | const std::string & | str | ) |
Constructs a string that is a deep copy of str.
This is the same as fromAscii(str).
QString::~QString | ( | ) | [inline] |
Destroys the string and frees the string's data if this is the last reference to the string.
QString::QString | ( | ) |
QString::QString | ( | QChar | ) |
QString::QString | ( | const QString & | ) |
QString::QString | ( | const QByteArray & | ) |
QString::QString | ( | const char * | str | ) |
QString::QString | ( | const std::string & | ) |
QString::~QString | ( | ) |
QString & QString::append | ( | char | ch | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends character ch to the string and returns a reference to the result.
Equivalent to operator+=().
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends character ch to the string and returns a reference to the result.
Equivalent to operator+=().
Appends str to the string and returns a reference to the result.
string = "Test"; string.append( "ing" ); // string == "Testing"
Equivalent to operator+=().
QString & QString::append | ( | const QByteArray & | str | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the result.
Equivalent to operator+=().
QString & QString::append | ( | const char * | str | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the result.
Equivalent to operator+=().
QString & QString::append | ( | const std::string & | str | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the result.
Equivalent to operator+=().
QString& QString::append | ( | char | ) |
QString& QString::append | ( | const QByteArray & | ) |
QString& QString::append | ( | const char * | ) |
QString& QString::append | ( | const std::string & | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. The fieldWidth value specifies the minimum amount of space that a is padded to. A positive value will produce a right-aligned number, whereas a negative value will produce a left-aligned number.
a is expressed in base base, which is 10 by default and must be between 2 and 36.
The '%' can be followed by an 'L', in which case the sequence is replaced with a localized representation of a. The conversion uses the default locale. The default locale is determined from the system's locale settings at application startup. It can be changed using QLocale::setDefault(). The 'L' flag is ignored if base is not 10.
QString str; str = QString( "Decimal 63 is %1 in hexadecimal" ) .arg( 63, 0, 16 ); // str == "Decimal 63 is 3f in hexadecimal" QLocale::setDefault(QLocale::English, QLocale::UnitedStates); str = QString( "%1 %L2 %L3" ) .arg( 12345 ) .arg( 12345 ) .arg( 12345, 0, 16 ); // str == "12345 12,345 3039"
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. arg-formats
Argument a is formatted according to the fmt format specified, which is 'g' by default and can be any of the following:
Format Meaning e
format as [-]9.9e[+|-]999 E
format as [-]9.9E[+|-]999 f
format as [-]9.9 g
use e
or f
format, whichever is the most concise G
use E
or f
format, whichever is the most concise
With 'e', 'E', and 'f', prec is the number of digits after the decimal point. With 'g' and 'G', prec is the maximum number of significant digits (trailing zeroes are omitted).
double d = 12.34; QString ds = QString( "'E' format, precision 3, gives %1" ) .arg( d, 0, 'E', 3 ); // ds == "'E' format, precision 3, gives 1.234E+01"
The 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is assumed to be in the Latin-1 character set.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This function will return a string that replaces the lowest numbered occurrence of %1
, %2
, ..., %9
with a.
The fieldWidth value specifies the minimum amount of space that a is padded to. A positive value will produce right-aligned text, whereas a negative value will produce left-aligned text.
The following example shows how we could create a 'status' string when processing a list of files:
QString status = QString( "Processing file %1 of %2: %3" ) .arg( i ) // current file's number .arg( total ) // number of files to process .arg( fileName ); // current file's name
It is generally fine to use filenames and numbers as we have done in the example above. But note that using arg() to construct natural language sentences does not usually translate well into other languages because sentence structure and word order often differ between languages.
If there is no place marker (%1
, %2
, etc.), a warning message (qWarning()) is output and the result is undefined.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This is the same as str.arg(a1).arg(a2), except that the strings are replaced in one pass. This can make a difference if a1 contains e.g. {%1}:
QString QString::arg | ( | const QString & | a1, |
const QString & | a2, | ||
const QString & | a3, | ||
const QString & | a4 | ||
) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This is the same as calling str.arg(a1).arg(a2).arg(a3), except that the strings are replaced in one pass.
QString QString::arg | ( | const QString & | a1, |
const QString & | a2, | ||
const QString & | a3, | ||
const QString & | a4 | ||
) | const [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This is the same as calling str.arg(a1).arg(a2).arg(a3).arg(a4), except that the strings are replaced in one pass.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. a is expressed in base base, which is 10 by default and must be between 2 and 36. If base is 10, the 'L' syntax can be used to produce localized strings.
const char * QString::ascii | ( | ) | const |
Returns an 8-bit ASCII representation of the string.
If a codec has been set using QTextCodec::codecForCStrings(), it is used to convert Unicode to 8-bit char. Otherwise, this function does the same as latin1().
const char* QString::ascii | ( | ) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. The function returns a reference to the character at index i. The resulting reference can then be assigned to, or used immediately, but it will become invalid once further modifications are made to the original string.
If i is beyond the length of the string then the string is expanded with QChar::null.
uint QString::capacity | ( | ) | const [inline] |
uint QString::capacity | ( | ) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Lexically compares this string with s and returns an integer less than, equal to, or greater than zero if it is less than, equal to, or greater than s.
Lexically compares s1 with s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.
The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings with QString::localeAwareCompare().
int a = QString::compare( "def", "abc" ); // a > 0 int b = QString::compare( "abc", "def" ); // b < 0 int c = QString::compare( "abc", "abc" ); // c == 0
void QString::compose | ( | ) |
Applies possible ligatures to a QString. Useful when composition-rich text requires rendering with glyph-poor fonts, but it also makes compositions such as QChar(0x0041) ('A') and QChar(0x0308) (Unicode accent diaresis), giving QChar(0x00c4) (German A Umlaut).
void QString::compose | ( | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the number of times the string str occurs in the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the number of times str occurs in the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
This function counts overlapping strings, so in the example below, there are two instances of "ana" in "bananas".
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the number of times the regexp, rx, matches in the string.
This function counts overlapping matches, so in the example below, there are four instances of "ana" or "ama".
QString QString::copy | ( | ) | const |
QString QString::copy | ( | ) | const [inline] |
In Qt 2.0 and later, all calls to this function are needless. Just remove them.
const char * QString::data | ( | ) | const [inline] |
Returns a pointer to a '\0'-terminated classic C string.
In Qt 1.x, this returned a char* allowing direct manipulation of the string as a sequence of bytes. In Qt 2.x where QString is a Unicode string, char* conversion constructs a temporary string, and hence direct character operations are meaningless.
const char* QString::data | ( | ) | const [inline] |
Returns TRUE if the string ends with s; otherwise returns FALSE.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
QString str( "Bananas" ); str.endsWith( "anas" ); // returns TRUE str.endsWith( "pple" ); // returns FALSE
Finds the first match of the regular expression rx, starting from position index. If index is -1, the search starts at the last character; if -2, at the next to last character and so on. (See findRev() for searching backwards.)
Returns the position of the first match of rx or -1 if no match was found.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Equivalent to find(QString(str), index).
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Finds the first occurrence of the character c, starting at position index. If index is -1, the search starts at the last character; if -2, at the next to last character and so on. (See findRev() for searching backwards.)
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Returns the position of c or -1 if c could not be found.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Find character c starting from position index.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Finds the first occurrence of the string str, starting at position index. If index is -1, the search starts at the last character, if it is -2, at the next to last character and so on. (See findRev() for searching backwards.)
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Returns the position of str or -1 if str could not be found.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Finds the first occurrence of the character c, starting at position index and searching backwards. If the index is -1, the search starts at the last character, if it is -2, at the next to last character and so on.
Returns the position of c or -1 if c could not be found.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
QString string( "bananas" ); int i = string.findRev( 'a' ); // i == 5
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Find character c starting from position index and working backwards.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Finds the first occurrence of the string str, starting at position index and searching backwards. If the index is -1, the search starts at the last character, if it is -2, at the next to last character and so on.
Returns the position of str or -1 if str could not be found.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
QString string("bananas"); int i = string.findRev( "ana" ); // i == 3
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Finds the first match of the regexp rx, starting at position index and searching backwards. If the index is -1, the search starts at the last character, if it is -2, at the next to last character and so on. (See findRev() for searching backwards.)
Returns the position of the match or -1 if no match was found.
Equivalent to findRev(QString(str), index).
Returns the Unicode string decoded from the first len bytes of ascii, ignoring the rest of ascii. If len is -1 then the length of ascii is used. If len is bigger than the length of ascii then it will use the length of ascii.
If a codec has been set using QTextCodec::codecForCStrings(), it is used to convert the string from 8-bit characters to Unicode. Otherwise, this function does the same as fromLatin1().
This is the same as the QString(const char*) constructor, but you can make that constructor invisible if you compile with the define QT_NO_CAST_ASCII
, in which case you can explicitly create a QString from 8-bit ASCII text using this function.
QString str = QString::fromAscii( "123456789", 5 ); // str == "12345"
Returns the Unicode string decoded from the first len bytes of chars, ignoring the rest of chars. If len is -1 then the length of chars is used. If len is bigger than the length of chars then it will use the length of chars.
Returns the Unicode string decoded from the first len bytes of local8Bit, ignoring the rest of local8Bit. If len is -1 then the length of local8Bit is used. If len is bigger than the length of local8Bit then it will use the length of local8Bit.
QString str = QString::fromLocal8Bit( "123456789", 5 ); // str == "12345"
local8Bit is assumed to be encoded in a locale-specific format.
See QTextCodec for more diverse coding/decoding of Unicode strings.
QString QString::fromUcs2 | ( | const unsigned short * | str | ) | [static] |
Constructs a string that is a deep copy of str, interpreted as a UCS2 encoded, zero terminated, Unicode string.
If str is 0, then a null string is created.
static QString QString::fromUcs2 | ( | const unsigned short * | ucs2 | ) | [static] |
Returns the Unicode string decoded from the first len bytes of utf8, ignoring the rest of utf8. If len is -1 then the length of utf8 is used. If len is bigger than the length of utf8 then it will use the length of utf8.
QString str = QString::fromUtf8( "123456789", 5 ); // str == "12345"
See QTextCodec for more diverse coding/decoding of Unicode strings.
QString& QString::insert | ( | uint | index, |
const QByteArray & | |||
) |
Inserts s into the string at position index.
If index is beyond the end of the string, the string is extended with spaces to length index and s is then appended and returns a reference to the string.
QString & QString::insert | ( | uint | index, |
const QByteArray & | s | ||
) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts s into the string at position index and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts s into the string at position index and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts the first len characters in s into the string at position index and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Insert c into the string at position index and returns a reference to the string.
If index is beyond the end of the string, the string is extended with spaces (ASCII 32) to length index and c is then appended.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Insert character c at position index.
bool QString::isEmpty | ( | void | ) | const [inline] |
bool QString::isEmpty | ( | ) | const |
bool QString::isNull | ( | ) | const [inline] |
bool QString::isNull | ( | ) | const |
bool QString::isRightToLeft | ( | ) | const |
bool QString::isRightToLeft | ( | ) | const |
const char * QString::latin1 | ( | ) | const |
Returns a Latin-1 representation of the string. The returned value is undefined if the string contains non-Latin-1 characters. If you want to convert strings into formats other than Unicode, see the QTextCodec classes.
This function is mainly useful for boot-strapping legacy code to use Unicode.
The result remains valid so long as one unmodified copy of the source string exists.
const char* QString::latin1 | ( | ) | const |
Returns a string of length width that contains this string padded by the fill character.
If truncate is FALSE and the length of the string is more than width, then the returned string is a copy of the string.
If truncate is TRUE and the length of the string is more than width, then any characters in a copy of the string after length width are removed, and the copy is returned.
QString s( "apple" ); QString t = s.leftJustify( 8, '.' ); // t == "apple..."
uint QString::length | ( | void | ) | const [inline] |
uint QString::length | ( | ) | const |
QCString QString::local8Bit | ( | ) | const |
Returns the string encoded in a locale-specific format. On X11, this is the QTextCodec::codecForLocale(). On Windows, it is a system-defined encoding. On Mac OS X, this always uses UTF-8 as the encoding.
See QTextCodec for more diverse coding/decoding of Unicode strings.
QCString QString::local8Bit | ( | ) | const |
Compares s1 with s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.
The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.
QString QString::lower | ( | ) | const |
QString QString::lower | ( | ) | const |
Returns a string that contains the len characters of this string, starting at position index.
Returns a null string if the string is empty or index is out of range. Returns the whole string from index if index + len exceeds the length of the string.
A convenience function that returns a string equivalent of the number n to base base, which is 10 by default and must be between 2 and 36. The returned string is in "C" locale.
long a = 63; QString str = QString::number( a, 16 ); // str == "3f" QString str = QString::number( a, 16 ).upper(); // str == "3F"
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. A convenience factory function that returns a string representation of the number n to the base base, which is 10 by default and must be between 2 and 36.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Argument n is formatted according to the f format specified, which is g
by default, and can be any of the following:
Format Meaning e
format as [-]9.9e[+|-]999 E
format as [-]9.9E[+|-]999 f
format as [-]9.9 g
use e
or f
format, whichever is the most concise G
use E
or f
format, whichever is the most concise
With 'e', 'E', and 'f', prec is the number of digits after the decimal point. With 'g' and 'G', prec is the maximum number of significant digits (trailing zeroes are omitted).
double d = 12.34; QString ds = QString( "'E' format, precision 3, gives %1" ) .arg( d, 0, 'E', 3 ); // ds == "1.234E+001"
QString::operator const char * | ( | ) | const [inline] |
Returns ascii(). Be sure to see the warnings documented in the ascii() function. Note that for new code which you wish to be strictly Unicode-clean, you can define the macro QT_NO_ASCII_CAST
when compiling your code to hide this function so that automatic casts are not done. This has the added advantage that you catch the programming error described in operator!().
QString::operator const char * | ( | ) | const [inline] |
QString::operator std::string | ( | ) | const [inline] |
QString::operator std::string | ( | ) | const [inline] |
bool QString::operator! | ( | ) | const [inline] |
Returns TRUE if this is a null string; otherwise returns FALSE.
QString name = getName(); if ( !name ) name = "Rodney";
Note that if you say
QString name = getName(); if ( name ) doSomethingWith(name);
It will call "operator const char*()", which is inefficent; you may wish to define the macro QT_NO_ASCII_CAST
when writing code which you wish to remain Unicode-clean.
When you want the above semantics, use:
bool QString::operator! | ( | ) | const |
QString & QString::operator+= | ( | char | c | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends c to the string and returns a reference to the string.
QString& QString::operator+= | ( | const std::string & | ) |
QString& QString::operator+= | ( | const QByteArray & | str | ) |
QString& QString::operator+= | ( | char | c | ) |
QString& QString::operator+= | ( | const char * | str | ) |
Appends str to the string and returns a reference to the string.
QString & QString::operator+= | ( | const QByteArray & | str | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the string.
QString & QString::operator+= | ( | const char * | str | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the string.
QString & QString::operator+= | ( | const std::string & | str | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends str to the string and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Appends c to the string and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Assigns a deep copy of cstr, interpreted as a classic C string, to this string. Returns a reference to this string.
QString & QString::operator= | ( | const char * | str | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Assigns a deep copy of str, interpreted as a classic C string to this string and returns a reference to this string.
If str is 0, then a null string is created.
QString& QString::operator= | ( | const char * | ) |
QString& QString::operator= | ( | const std::string & | ) |
QString& QString::operator= | ( | char | c | ) |
Sets the string to contain just the single character c.
QString & QString::operator= | ( | char | c | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to contain just the single character c.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Assigns a shallow copy of s to this string and returns a reference to this string. This is very fast because the string isn't actually copied.
QString & QString::operator= | ( | const std::string & | s | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Makes a deep copy of s and returns a reference to the deep copy.
Returns the character at index i, or QChar::null if i is beyond the length of the string.
If the QString is not const (i.e., const QString) or const& (i.e., const QString&), then the non-const overload of operator[] will be used instead.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. The function returns a reference to the character at index i. The resulting reference can then be assigned to, or used immediately, but it will become invalid once further modifications are made to the original string.
If i is beyond the length of the string then the string is expanded with QChar::nulls, so that the QCharRef references a valid (null) character in the string.
The QCharRef internal class can be used much like a constant QChar, but if you assign to it, you change the original string (which will detach itself because of QString's copy-on-write semantics). You will get compilation errors if you try to use the result as anything but a QChar.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts ch at the beginning of the string and returns a reference to the string.
Equivalent to insert(0, ch).
QString & QString::prepend | ( | const std::string & | s | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts s at the beginning of the string and returns a reference to the string.
Equivalent to insert(0, s).
QString & QString::prepend | ( | const QByteArray & | s | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts s at the beginning of the string and returns a reference to the string.
Equivalent to insert(0, s).
QString& QString::prepend | ( | char | ) |
QString & QString::prepend | ( | char | ch | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts ch at the beginning of the string and returns a reference to the string.
Equivalent to insert(0, ch).
QString& QString::prepend | ( | const char * | ) |
QString& QString::prepend | ( | const QByteArray & | ) |
QString& QString::prepend | ( | const std::string & | ) |
QString & QString::prepend | ( | const char * | s | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts s at the beginning of the string and returns a reference to the string.
Equivalent to insert(0, s).
Returns the QChar at index i by reference, expanding the string with QChar::null if necessary. The resulting reference can be assigned to, or otherwise used immediately, but becomes invalid once furher modifications are made to the string.
QString& QString::remove | ( | const char * | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Removes every occurrence of the regular expression rx in the string. Returns a reference to the string.
This is the same as replace(rx, "").
QString & QString::remove | ( | char | c | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Removes every occurrence of the character c in the string. Returns a reference to the string.
This is the same as replace(c, "").
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Removes every occurrence of the character c in the string. Returns a reference to the string.
This is the same as replace(c, "").
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Removes every occurrence of str in the string. Returns a reference to the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
This is the same as replace(str, "", cs).
QString & QString::remove | ( | const char * | str | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Removes every occurrence of str in the string. Returns a reference to the string.
Removes len characters from the string starting at position index, and returns a reference to the string.
If index is beyond the length of the string, nothing happens. If index is within the string, but index + len is beyond the end of the string, the string is truncated at position index.
QString string( "Montreal" ); string.remove( 1, 4 ); // string == "Meal"
QString& QString::remove | ( | char | c | ) | [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces len characters with slen characters of QChar data from s, starting at position index, and returns a reference to the string.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
This is the same as replace(index, len, QChar(c)).
Replaces len characters from the string with s, starting at position index, and returns a reference to the string.
If index is beyond the length of the string, nothing is deleted and s is appended at the end of the string. If index is valid, but index + len is beyond the end of the string, the string is truncated at position index, then s is appended at the end.
QString string( "Say yes!" ); string = string.replace( 4, 3, "NO" ); // string == "Say NO!"
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This is the same as replace(index, len, QString(c)).
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces every occurrence of the character c in the string with after. Returns a reference to the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Example:
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Replaces every occurrence of the character c in the string with after. Returns a reference to the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces every occurrence of the string before in the string with the string after. Returns a reference to the string.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
Example:
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces every occurrence of the regexp rx in the string with after. Returns a reference to the string. For example:
For regexps containing capturing parentheses , occurrences of \1, \2, ..., in after are replaced with {rx}.cap(1), cap(2), ...
QString t = "A <i>bon mot</i>."; t.replace( QRegExp("<i>([^<]*)</i>"), "\\emph{\\1}" ); // t == "A \\emph{bon mot}."
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces every occurrence of c1 with the char c2. Returns a reference to the string.
void QString::reserve | ( | uint | minCapacity | ) |
void QString::reserve | ( | uint | minCapacity | ) |
Ensures that at least minCapacity characters are allocated to the string.
This function is useful for code that needs to build up a long string and wants to avoid repeated reallocation. In this example, we want to add to the string until some condition is true, and we're fairly sure that size is big enough:
QString result; int len = 0; result.reserve(maxLen); while (...) { result[len++] = ... // fill part of the space } result.squeeze();
If maxLen is an underestimate, the worst that will happen is that the loop will slow down.
If it is not possible to allocate enough memory, the string remains unchanged.
Returns a string of length width that contains the fill character followed by the string.
If truncate is FALSE and the length of the string is more than width, then the returned string is a copy of the string.
If truncate is TRUE and the length of the string is more than width, then the resulting string is truncated at position width.
QString string( "apple" ); QString t = string.rightJustify( 8, '.' ); // t == "...apple"
QString QString::section | ( | char | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
QString QString::section | ( | const QRegExp & | reg, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
QString QString::section | ( | const QString & | in_sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
QString QString::section | ( | QChar | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const [inline] |
This function returns a section of the string.
This string is treated as a sequence of fields separated by the character, sep. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left.
The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see {SectionFlags}.
QString csv( "forename,middlename,surname,phone" ); QString s = csv.section( ',', 2, 2 ); // s == "surname" QString path( "/usr/local/bin/myapp" ); // First field is empty QString s = path.section( '/', 3, 4 ); // s == "bin/myapp" QString s = path.section( '/', 3, 3, SectionSkipEmpty ); // s == "myapp"
If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on.
QString csv( "forename,middlename,surname,phone" ); QString s = csv.section( ',', -3, -2 ); // s == "middlename,surname" QString path( "/usr/local/bin/myapp" ); // First field is empty QString s = path.section( '/', -1 ); // s == "myapp"
QString QString::section | ( | char | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
QString QString::section | ( | const char * | in_sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
QString QString::section | ( | const QString & | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This function returns a section of the string.
This string is treated as a sequence of fields separated by the string, sep. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left.
The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see {SectionFlags}.
QString data( "forename**middlename**surname**phone" ); QString s = data.section( "**", 2, 2 ); // s == "surname"
If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on.
QString data( "forename**middlename**surname**phone" ); QString s = data.section( "**", -3, -2 ); // s == "middlename**surname"
QString QString::section | ( | const QRegExp & | reg, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This function returns a section of the string.
This string is treated as a sequence of fields separated by the regular expression, reg. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left.
The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see {SectionFlags}.
QString line( "forename\tmiddlename surname \t \t phone" ); QRegExp sep( "\s+" ); QString s = line.section( sep, 2, 2 ); // s == "surname"
If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on.
QString line( "forename\tmiddlename surname \t \t phone" ); QRegExp sep( "\\s+" ); QString s = line.section( sep, -3, -2 ); // s == "middlename surname"
QString QString::section | ( | QChar | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const |
QString QString::section | ( | const char * | sep, |
int | start, | ||
int | end = 0xffffffff , |
||
int | flags = SectionDefault |
||
) | const [inline] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Sets the character at position index to c and expands the string if necessary, filling with spaces.
This method is redundant in Qt 3.x, because operator[] will expand the string as necessary.
void QString::setLength | ( | uint | newLength | ) |
void QString::setLength | ( | uint | newLen | ) |
Ensures that at least newLen characters are allocated to the string, and sets the length of the string to newLen. Any new space allocated contains arbitrary data.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n, formatted in format f with precision prec, and returns a reference to the string.
The format f can be 'f', 'F', 'e', 'E', 'g' or 'G'. See arg () for an explanation of the formats.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n in base base and returns a reference to the string.
The base is 10 by default and must be between 2 and 36.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n in base base and returns a reference to the string.
The base is 10 by default and must be between 2 and 36.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n in base base and returns a reference to the string.
The base is 10 by default and must be between 2 and 36.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n, formatted in format f with precision prec, and returns a reference to the string.
The format f can be 'f', 'F', 'e', 'E', 'g' or 'G'. See arg () for an explanation of the formats.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n in base base and returns a reference to the string.
The base is 10 by default and must be between 2 and 36.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the string to the printed value of n in base base and returns a reference to the string.
The base is 10 by default and must be between 2 and 36.
Resizes the string to len characters and copies unicode into the string. If unicode is 0, nothing is copied, but the string is still resized to len. If len is zero, then the string becomes a null string.
Resizes the string to len characters and copies unicode_as_ushorts into the string (on some X11 client platforms this will involve a byte-swapping pass).
If unicode_as_ushorts is 0, nothing is copied, but the string is still resized to len. If len is zero, the string becomes a null string.
bool QString::simpleText | ( | ) | const [inline] |
bool QString::simpleText | ( | ) | const [inline] |
QString QString::simplifyWhiteSpace | ( | ) | const |
Returns a string that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space.
Whitespace means any character for which QChar::isSpace() returns TRUE. This includes Unicode characters with decimal values 9 (TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR), and 32 (Space).
QString string = " lots\t of\nwhite space "; QString t = string.simplifyWhiteSpace(); // t == "lots of white space"
QString QString::simplifyWhiteSpace | ( | ) | const |
QString & QString::sprintf | ( | const char * | cformat, |
... | |||
) |
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments. The format string supports all the escape sequences of printf() in the standard C library.
The s escape sequence expects a utf8() encoded string. The format string cformat is expected to be in latin1. If you need a Unicode format string, use arg() instead. For typesafe string building, with full Unicode support, you can use QTextOStream like this:
QString str; QString s = ...; int x = ...; QTextOStream( &str ) << s << " : " << x;
For translations, especially if the strings contains more than one escape sequence, you should consider using the arg() function instead. This allows the order of the replacements to be controlled by the translator, and has Unicode support.
The lc escape sequence expects a unicode character of type ushort (as returned by QChar::unicode()). The ls escape sequence expects a pointer to a zero-terminated array of unicode characters of type ushort (as returned by QString::ucs2()).
QString& QString::sprintf | ( | const char * | format, |
... | |||
) |
void QString::squeeze | ( | ) |
void QString::squeeze | ( | ) |
Squeezes the string's capacity to the current content.
Returns TRUE if the string starts with s; otherwise returns FALSE.
If cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive.
QString str( "Bananas" ); str.startsWith( "Ban" ); // returns TRUE str.startsWith( "Car" ); // returns FALSE
QString QString::stripWhiteSpace | ( | ) | const |
Returns a string that has whitespace removed from the start and the end.
Whitespace means any character for which QChar::isSpace() returns TRUE. This includes Unicode characters with decimal values 9 (TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR) and 32 (Space), and may also include other Unicode characters.
QString string = " white space "; QString s = string.stripWhiteSpace(); // s == "white space"
QString QString::stripWhiteSpace | ( | ) | const |
double QString::toDouble | ( | bool * | ok = 0 | ) | const |
Returns the string converted to a double
value.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
QString string( "1234.56" ); double a = string.toDouble(); // a == 1234.56
The string-to-number functions: toShort() toUShort() toInt() toUInt() toLong() toULong() toLongLong() toULongLong() toFloat() toDouble() can handle numbers represented in various locales. These representations may use different characters for the decimal point, thousands group sepearator and even individual digits. QString's functions try to interpret the string according to the current locale. The current locale is determined from the system at application startup and can be changed by calling QLocale::setDefault(). If the string cannot be interpreted according to the current locale, this function falls back on the "C" locale.
bool ok; double d; QLocale::setDefault(QLocale::C); d = QString( "1234,56" ).toDouble(&ok); // ok == false d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56 QLocale::setDefault(QLocale::German); d = QString( "1234,56" ).toDouble(&ok); // ok == true, d == 1234.56 d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56
Due to the ambiguity between the decimal point and thousands group separator in various locales, these functions do not handle thousands group separators. If you need to convert such numbers, use the corresponding function in QLocale.
bool ok; QLocale::setDefault(QLocale::C); double d = QString( "1,234,567.89" ).toDouble(&ok); // ok == false
double QString::toDouble | ( | bool * | ok = 0 | ) | const |
float QString::toFloat | ( | bool * | ok = 0 | ) | const |
float QString::toFloat | ( | bool * | ok = 0 | ) | const |
Returns the string converted to an int
using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
QString str( "FF" ); bool ok; int hex = str.toInt( &ok, 16 ); // hex == 255, ok == TRUE int dec = str.toInt( &ok, 10 ); // dec == 0, ok == FALSE
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to a long
using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to a {long
long} using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to a short
using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to an {unsigned
int} using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to an {unsigned
long} using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to an {unsigned
long long} using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
Returns the string converted to an {unsigned
short} using base base, which is 10 by default and must be between 2 and 36 or 0. If base is 0, the base is determined automatically using the following rules:
Returns 0 if the conversion fails.
If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE.
Leading and trailing whitespace is ignored by this function.
For information on how string-to-number functions in QString handle localized input, see toDouble().
void QString::truncate | ( | uint | newLen | ) |
If newLen is less than the length of the string, then the string is truncated at position newLen. Otherwise nothing happens.
void QString::truncate | ( | uint | pos | ) |
const unsigned short* QString::ucs2 | ( | ) | const |
const unsigned short * QString::ucs2 | ( | ) | const |
Returns the QString as a zero terminated array of unsigned shorts if the string is not null; otherwise returns zero.
The result remains valid so long as one unmodified copy of the source string exists.
const QChar* QString::unicode | ( | ) | const [inline] |
const QChar * QString::unicode | ( | ) | const [inline] |
Returns the Unicode representation of the string. The result remains valid until the string is modified.
QString QString::upper | ( | ) | const |
QString QString::upper | ( | ) | const |
QCString QString::utf8 | ( | ) | const |
Returns the string encoded in UTF-8 format.
See QTextCodec for more diverse coding/decoding of Unicode strings.
QCString QString::utf8 | ( | ) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is not equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) != 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is not equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) != 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns a string which is the result of concatenating the string s and character c.
Equivalent to {s}.append(c).
Returns a string which is the result of concatenating the string s1 and the string s2.
Equivalent to {s1}.append(s2).
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns a string which is the result of concatenating the string s1 and character s2.
Equivalent to {s1}.append(s2).
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns a string which is the result of concatenating the character s1 and string s2.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns a string which is the result of concatenating the character c and string s.
Equivalent to {s}.prepend(c).
Returns TRUE if s1 is lexically less than s2; otherwise returns FALSE. The comparison is case sensitive.
Equivalent to compare(s1, s2) < 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is lexically less than s2; otherwise returns FALSE. The comparison is case sensitive.
Equivalent to compare(s1, s2) < 0.
QDataStream & operator<< | ( | QDataStream & | s, |
const QString & | str | ||
) | [related] |
Writes the string str to the stream s.
See also Format of the QDataStream operators
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is lexically less than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) <= 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) == 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) == 0.
Returns TRUE if s1 is lexically greater than s2; otherwise returns FALSE. The comparison is case sensitive.
Equivalent to compare(s1, s2) > 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is lexically greater than s2; otherwise returns FALSE. The comparison is case sensitive.
Equivalent to compare(s1, s2) > 0.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns TRUE if s1 is lexically greater than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string.
Equivalent to compare(s1, s2) >= 0.
QDataStream & operator>> | ( | QDataStream & | s, |
QString & | str | ||
) | [friend] |
Reads a string from the stream s into string str.
See also Format of the QDataStream operators
Q_EXPORT QDataStream& operator>> | ( | QDataStream & | , |
QString & | |||
) | [friend] |
QConstString [friend] |
QTextStream [friend] |
QT_STATIC_CONST QString QString::null |