Qt 4.8
|
The QString class provides a Unicode character string. More...
#include <qstring.h>
Classes | |
struct | Data |
struct | Null |
Public Types | |
typedef const QChar * | const_iterator |
The QString::const_iterator typedef provides an STL-style const iterator for QString. More... | |
typedef const QChar & | const_reference |
The QString::const_reference typedef provides an STL-style const reference for QString. More... | |
typedef const_iterator | ConstIterator |
Qt-style synonym for QString::const_iterator. More... | |
typedef Data * | DataPtr |
typedef QChar * | iterator |
The QString::iterator typedef provides an STL-style non-const iterator for QString. More... | |
typedef iterator | Iterator |
Qt-style synonym for QString::iterator. More... | |
enum | NormalizationForm { NormalizationForm_D, NormalizationForm_C, NormalizationForm_KD, NormalizationForm_KC } |
This enum describes the various normalized forms of Unicode text. More... | |
typedef QChar & | reference |
The QString::const_reference typedef provides an STL-style reference for QString. More... | |
enum | SectionFlag { SectionDefault = 0x00, SectionSkipEmpty = 0x01, SectionIncludeLeadingSep = 0x02, SectionIncludeTrailingSep = 0x04, SectionCaseInsensitiveSeps = 0x08 } |
This enum specifies flags that can be used to affect various aspects of the section() function's behavior with respect to separators and empty fields. More... | |
enum | SplitBehavior { KeepEmptyParts, SkipEmptyParts } |
This enum specifies how the split() function should behave with respect to empty strings. More... | |
typedef QChar | value_type |
The QString::const_reference typedef provides an STL-style value type for QString. More... | |
Public Functions | |
QString & | append (QChar c) |
QString & | append (const QString &s) |
Appends the string str onto the end of this string. More... | |
QString & | append (const QStringRef &s) |
Appends the given string reference to this string and returns the result. More... | |
QString & | append (const QLatin1String &s) |
QT_ASCII_CAST_WARN QString & | append (const char *s) |
QT_ASCII_CAST_WARN QString & | append (const QByteArray &s) |
QString | arg (qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (qulonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (long a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (ulong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (int a, int fieldWidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (uint a, int fieldWidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (short a, int fieldWidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar. More... | |
QString | arg (ushort a, int fieldWidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (double a, int fieldWidth=0, char fmt='g', int prec=-1, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (char a, int fieldWidth=0, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (QChar a, int fieldWidth=0, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
QString | arg (const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT |
Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1 , %2 , ..., %99 . More... | |
QString | arg (const QString &a1, const QString &a2) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, const QString &a7) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, const QString &a7, const QString &a8) const Q_REQUIRED_RESULT |
QString | arg (const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT |
const QChar | at (int i) const |
Returns the character at the given index position in the string. More... | |
iterator | begin () |
Returns an STL-style iterator pointing to the first character in the string. More... | |
const_iterator | begin () const |
int | capacity () const |
Returns the maximum number of characters that can be stored in the string without forcing a reallocation. More... | |
void | chop (int n) |
Removes n characters from the end of the string. More... | |
void | clear () |
Clears the contents of the string and makes it empty. More... | |
int | compare (const QString &s) const |
int | compare (const QString &s, Qt::CaseSensitivity cs) const |
int | compare (const QLatin1String &other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | compare (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | constBegin () const |
Returns a const STL-style iterator pointing to the first character in the string. More... | |
const QChar * | constData () const |
Returns a pointer to the data stored in the QString. More... | |
const_iterator | constEnd () const |
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list. More... | |
QBool | contains (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QBool | contains (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if this string contains an occurrence of the string str; otherwise returns false. More... | |
QBool | contains (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if this string contains an occurrence of the string reference str; otherwise returns false. More... | |
QBool | contains (const QRegExp &rx) const |
QBool | contains (QRegExp &rx) const |
int | count () const |
int | count (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | count (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns the number of (potentially overlapping) occurrences of the string str in this string. More... | |
int | count (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | count (const QRegExp &) const |
QChar * | data () |
Returns a pointer to the data stored in the QString. More... | |
const QChar * | data () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
DataPtr & | data_ptr () |
void | detach () |
iterator | end () |
Returns an STL-style iterator pointing to the imaginary character after the last character in the string. More... | |
const_iterator | end () const |
bool | endsWith (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if the string ends with s; otherwise returns false. More... | |
bool | endsWith (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (const QLatin1String &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (const QChar &c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QString & | fill (QChar c, int size=-1) |
Sets every character in the string to character ch. More... | |
int | indexOf (QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | indexOf (const QString &s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. More... | |
int | indexOf (const QLatin1String &s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. More... | |
int | indexOf (const QStringRef &s, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | indexOf (const QRegExp &, int from=0) const |
int | indexOf (QRegExp &, int from=0) const |
QString & | insert (int i, QChar c) |
QString & | insert (int i, const QChar *uc, int len) |
QString & | insert (int i, const QString &s) |
Inserts the string str at the given index position and returns a reference to this string. More... | |
QString & | insert (int i, const QLatin1String &s) |
bool | isDetached () const |
bool | isEmpty () const |
Returns true if the string has no characters; otherwise returns false. More... | |
bool | isNull () const |
Returns true if this string is null; otherwise returns false. More... | |
bool | isRightToLeft () const |
Returns true if the string is read right to left. More... | |
bool | isSharedWith (const QString &other) const |
bool | isSimpleText () const |
int | lastIndexOf (QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | lastIndexOf (const QString &s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns the index position of the last occurrence of the string str in this string, searching backward from index position from. More... | |
int | lastIndexOf (const QLatin1String &s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | lastIndexOf (const QStringRef &s, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | lastIndexOf (const QRegExp &, int from=-1) const |
int | lastIndexOf (QRegExp &, int from=-1) const |
QString | left (int n) const Q_REQUIRED_RESULT |
Returns a substring that contains the n leftmost characters of the string. More... | |
QString | leftJustified (int width, QChar fill=QLatin1Char(' '), bool trunc=false) const Q_REQUIRED_RESULT |
Returns a string of size width that contains this string padded by the fill character. More... | |
QStringRef | leftRef (int n) const Q_REQUIRED_RESULT |
Returns a substring reference to the n leftmost characters of the string. More... | |
int | length () const |
Returns the number of characters in this string. More... | |
int | localeAwareCompare (const QString &s) const |
int | localeAwareCompare (const QStringRef &s) const |
QString | mid (int position, int n=-1) const Q_REQUIRED_RESULT |
Returns a string that contains n characters of this string, starting at the specified position index. More... | |
QStringRef | midRef (int position, int n=-1) const Q_REQUIRED_RESULT |
Returns a substring reference to n characters of this string, starting at the specified position. More... | |
QString | normalized (NormalizationForm mode) const Q_REQUIRED_RESULT |
Returns the string in the given Unicode normalization mode. More... | |
QString | normalized (NormalizationForm mode, QChar::UnicodeVersion version) const Q_REQUIRED_RESULT |
Returns the string in the given Unicode normalization mode, according to the given version of the Unicode standard. More... | |
bool | operator!= (const QString &s) const |
Returns true if this string is not equal to string other; otherwise returns false. More... | |
bool | operator!= (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator!= (const char *s) const |
QT_ASCII_CAST_WARN bool | operator!= (const QByteArray &s) const |
QString & | operator+= (QChar c) |
QString & | operator+= (QChar::SpecialCharacter c) |
QString & | operator+= (const QString &s) |
Appends the string other onto the end of this string and returns a reference to this string. More... | |
QString & | operator+= (const QStringRef &s) |
QString & | operator+= (const QLatin1String &s) |
QT_ASCII_CAST_WARN QString & | operator+= (const char *s) |
QT_ASCII_CAST_WARN QString & | operator+= (const QByteArray &s) |
QT_ASCII_CAST_WARN QString & | operator+= (char c) |
bool | operator< (const QString &s) const |
Returns true if this string is lexically less than string other; otherwise returns false. More... | |
bool | operator< (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator< (const char *s) const |
QT_ASCII_CAST_WARN bool | operator< (const QByteArray &s) const |
bool | operator<= (const QString &s) const |
Returns true if this string is lexically less than or equal to string other; otherwise returns false. More... | |
bool | operator<= (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator<= (const char *s2) const |
QT_ASCII_CAST_WARN bool | operator<= (const QByteArray &s) const |
QString & | operator= (QChar c) |
QString & | operator= (const QString &) |
Assigns other to this string and returns a reference to this string. More... | |
QString & | operator= (const QLatin1String &) |
QT_ASCII_CAST_WARN QString & | operator= (const char *ch) |
QT_ASCII_CAST_WARN QString & | operator= (const QByteArray &a) |
QT_ASCII_CAST_WARN QString & | operator= (char c) |
QString & | operator= (const Null &) |
bool | operator== (const QString &s) const |
Returns true if string other is equal to this string; otherwise returns false. More... | |
bool | operator== (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator== (const char *s) const |
QT_ASCII_CAST_WARN bool | operator== (const QByteArray &s) const |
bool | operator> (const QString &s) const |
Returns true if this string is lexically greater than string other; otherwise returns false. More... | |
bool | operator> (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator> (const char *s2) const |
QT_ASCII_CAST_WARN bool | operator> (const QByteArray &s) const |
bool | operator>= (const QString &s) const |
Returns true if this string is lexically greater than or equal to string other; otherwise returns false. More... | |
bool | operator>= (const QLatin1String &s) const |
QT_ASCII_CAST_WARN bool | operator>= (const char *s2) const |
QT_ASCII_CAST_WARN bool | operator>= (const QByteArray &s) const |
const QChar | operator[] (int i) const |
QCharRef | operator[] (int i) |
Returns the character at the specified position in the string as a modifiable reference. More... | |
const QChar | operator[] (uint i) const |
QCharRef | operator[] (uint i) |
QString & | prepend (QChar c) |
QString & | prepend (const QString &s) |
Prepends the string str to the beginning of this string and returns a reference to this string. More... | |
QString & | prepend (const QLatin1String &s) |
QT_ASCII_CAST_WARN QString & | prepend (const char *s) |
QT_ASCII_CAST_WARN QString & | prepend (const QByteArray &s) |
void | push_back (QChar c) |
Appends the given ch character onto the end of this string. More... | |
void | push_back (const QString &s) |
This function is provided for STL compatibility, appending the given other string onto the end of this string. More... | |
void | push_front (QChar c) |
Prepends the given ch character to the beginning of this string. More... | |
void | push_front (const QString &s) |
This function is provided for STL compatibility, prepending the given other string to the beginning of this string. More... | |
QString () | |
Constructs a null string. More... | |
QString (const QChar *unicode, int size) | |
Constructs a string initialized with the first size characters of the QChar array unicode. More... | |
QString (const QChar *unicode) | |
Constructs a string initialized with the characters of the QChar array unicode, which must be terminated with a 0. More... | |
QString (QChar c) | |
Constructs a string of size 1 containing the character ch. More... | |
QString (int size, QChar c) | |
Constructs a string of the given size with every character set to ch. More... | |
QString (const QLatin1String &latin1) | |
Constructs a copy of the Latin-1 string str. More... | |
QString (const QString &) | |
Constructs a copy of other. More... | |
QT_ASCII_CAST_WARN_CONSTRUCTOR | QString (const char *ch) |
Constructs a string initialized with the 8-bit string str. More... | |
QT_ASCII_CAST_WARN_CONSTRUCTOR | QString (const QByteArray &a) |
Constructs a string initialized with the byte array ba. More... | |
QString (const Null &) | |
QString (int size, Qt::Initialization) | |
Constructs a string of the given size without initializing the characters. More... | |
QString & | remove (int i, int len) |
Removes n characters from the string, starting at the given position index, and returns a reference to the string. More... | |
QString & | remove (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
Removes every occurrence of the character ch in this string, and returns a reference to this string. More... | |
QString & | remove (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
Removes every occurrence of the given str string in this string, and returns a reference to this string. More... | |
QString & | remove (const QRegExp &rx) |
Removes every occurrence of the regular expression rx in the string, and returns a reference to the string. More... | |
QString | repeated (int times) const |
Returns a copy of this string repeated the specified number of times. More... | |
QString & | replace (int i, int len, QChar after) |
QString & | replace (int i, int len, const QChar *s, int slen) |
QString & | replace (int i, int len, const QString &after) |
Replaces n characters beginning at index position with the string after and returns a reference to this string. More... | |
QString & | replace (QChar before, QChar after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QString &before, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (QChar c, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (QChar c, const QLatin1String &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QRegExp &rx, const QString &after) |
void | reserve (int size) |
Attempts to allocate memory for at least size characters. More... | |
void | resize (int size) |
Sets the size of the string to size characters. More... | |
QString | right (int n) const Q_REQUIRED_RESULT |
Returns a substring that contains the n rightmost characters of the string. More... | |
QString | rightJustified (int width, QChar fill=QLatin1Char(' '), bool trunc=false) const Q_REQUIRED_RESULT |
Returns a string of size() width that contains the fill character followed by the string. More... | |
QStringRef | rightRef (int n) const Q_REQUIRED_RESULT |
Returns a substring reference to the n rightmost characters of the string. More... | |
QString | section (QChar sep, int start, int end=-1, SectionFlags flags=SectionDefault) const |
This function returns a section of the string. More... | |
QString | section (const QString &in_sep, int start, int end=-1, SectionFlags flags=SectionDefault) const |
QString | section (const QRegExp ®, int start, int end=-1, SectionFlags flags=SectionDefault) const |
QString & | setNum (short, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (ushort, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (int, int base=10) |
Sets the string to the printed value of n in the specified base, and returns a reference to the string. More... | |
QString & | setNum (uint, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (long, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (ulong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (qlonglong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (qulonglong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString & | setNum (float, char f='g', int prec=6) |
Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string. More... | |
QString & | setNum (double, char f='g', int prec=6) |
Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string. More... | |
QString & | setRawData (const QChar *unicode, int size) |
Resets the QString to use the first size Unicode characters in the array unicode. More... | |
QString & | setUnicode (const QChar *unicode, int size) |
Resizes the string to size characters and copies unicode into the string. More... | |
QString & | setUtf16 (const ushort *utf16, int size) |
Resizes the string to size characters and copies unicode into the string. More... | |
QString | simplified () const Q_REQUIRED_RESULT |
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space. More... | |
int | size () const |
Returns the number of characters in this string. More... | |
QStringList | split (const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT |
Splits the string into substrings wherever sep occurs, and returns the list of those strings. More... | |
QStringList | split (const QChar &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QStringList | split (const QRegExp &sep, SplitBehavior behavior=KeepEmptyParts) const Q_REQUIRED_RESULT |
Splits the string into substrings wherever the regular expression rx matches, and returns the list of those strings. More... | |
QString & | sprintf (const char *format,...) |
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments. More... | |
void | squeeze () |
Releases any memory not required to store the character data. More... | |
bool | startsWith (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if the string starts with s; otherwise returns false. More... | |
bool | startsWith (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if the string starts with the string reference s; otherwise returns false. More... | |
bool | startsWith (const QLatin1String &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | startsWith (const QChar &c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
void | swap (QString &other) |
Swaps string other with this string. More... | |
QByteArray | toAscii () const Q_REQUIRED_RESULT |
Returns an 8-bit representation of the string as a QByteArray. More... | |
QString | toCaseFolded () const Q_REQUIRED_RESULT |
Returns the case folded equivalent of the string. More... | |
double | toDouble (bool *ok=0) const |
Returns the string converted to a double value. More... | |
float | toFloat (bool *ok=0) const |
int | toInt (bool *ok=0, int base=10) 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. More... | |
QByteArray | toLatin1 () const Q_REQUIRED_RESULT |
Returns a Latin-1 representation of the string as a QByteArray. More... | |
QByteArray | toLocal8Bit () const Q_REQUIRED_RESULT |
Returns the local 8-bit representation of the string as a QByteArray. More... | |
long | toLong (bool *ok=0, int base=10) const |
Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. More... | |
qlonglong | toLongLong (bool *ok=0, int base=10) const |
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. More... | |
QString | toLower () const Q_REQUIRED_RESULT |
Returns a lowercase copy of the string. More... | |
short | toShort (bool *ok=0, int base=10) const |
Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. More... | |
std::string | toStdString () const |
Returns a std::string object with the data contained in this QString. More... | |
std::wstring | toStdWString () const |
Returns a std::wstring object with the data contained in this QString. More... | |
QVector< uint > | toUcs4 () const Q_REQUIRED_RESULT |
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>. More... | |
uint | toUInt (bool *ok=0, int base=10) const |
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. More... | |
ulong | toULong (bool *ok=0, int base=10) const |
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. More... | |
qulonglong | toULongLong (bool *ok=0, int base=10) const |
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. More... | |
QString | toUpper () const Q_REQUIRED_RESULT |
Returns an uppercase copy of the string. More... | |
ushort | toUShort (bool *ok=0, int base=10) const |
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. More... | |
QByteArray | toUtf8 () const Q_REQUIRED_RESULT |
Returns a UTF-8 representation of the string as a QByteArray. More... | |
int | toWCharArray (wchar_t *array) const |
Fills the array with the data contained in this QString object. More... | |
QString | trimmed () const Q_REQUIRED_RESULT |
Returns a string that has whitespace removed from the start and the end. More... | |
void | truncate (int pos) |
Truncates the string at the given position index. More... | |
const QChar * | unicode () const |
Returns a '\0'-terminated Unicode representation of the string. More... | |
const ushort * | utf16 () const |
Returns the QString as a '\0\'-terminated array of unsigned shorts. More... | |
QString & | vsprintf (const char *format, va_list ap) |
Equivalent method to sprintf(), but takes a va_list ap instead a list of variable arguments. More... | |
~QString () | |
Destroys the string. More... | |
Static Public Functions | |
static int | compare (const QString &s1, const QString &s2) |
static int | compare (const QString &s1, const QString &s2, Qt::CaseSensitivity cs) |
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. More... | |
static int | compare (const QString &s1, const QLatin1String &s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static int | compare (const QLatin1String &s1, const QString &s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static int | compare (const QString &s1, const QStringRef &s2, Qt::CaseSensitivity=Qt::CaseSensitive) |
static QString | fromAscii (const char *, int size=-1) |
Returns a QString initialized with the first size characters from the string str. More... | |
static QString | fromLatin1 (const char *, int size=-1) |
Returns a QString initialized with the first size characters of the Latin-1 string str. More... | |
static QString | fromLocal8Bit (const char *, int size=-1) |
Returns a QString initialized with the first size characters of the 8-bit string str. More... | |
static QString | fromRawData (const QChar *, int size) |
Constructs a QString that uses the first size Unicode characters in the array unicode. More... | |
static QString | fromStdString (const std::string &s) |
Returns a copy of the str string. More... | |
static QString | fromStdWString (const std::wstring &s) |
Returns a copy of the str string. More... | |
static QString | fromUcs4 (const uint *, int size=-1) |
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646-UCS-4 encoded). More... | |
static QString | fromUtf16 (const ushort *, int size=-1) |
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646-UTF-16 encoded). More... | |
static QString | fromUtf8 (const char *, int size=-1) |
Returns a QString initialized with the first size bytes of the UTF-8 string str. More... | |
static QString | fromWCharArray (const wchar_t *, int size=-1) |
Returns a copy of the string, where the encoding of string depends on the size of wchar. More... | |
static int | localeAwareCompare (const QString &s1, const QString &s2) |
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. More... | |
static int | localeAwareCompare (const QString &s1, const QStringRef &s2) |
static QString | number (int, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static QString | number (uint, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static QString | number (long, int base=10) |
Returns a string equivalent of the number n according to the specified base. More... | |
static QString | number (ulong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static QString | number (qlonglong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static QString | number (qulonglong, int base=10) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static QString | number (double, char f='g', int prec=6) |
Returns a string equivalent of the number n, formatted according to the specified format and precision. More... | |
Static Public Variables | |
static const Null | null = { } |
Private Functions | |
void | expand (int i) |
QString | multiArg (int numArgs, const QString **args) const |
QString (Data *dd, int) | |
void | realloc () |
void | realloc (int alloc) |
void | replace_helper (uint *indices, int nIndices, int blen, const QChar *after, int alen) |
void | updateProperties () const |
Static Private Functions | |
static int | compare_helper (const QChar *data1, int length1, const QChar *data2, int length2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static int | compare_helper (const QChar *data1, int length1, QLatin1String s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static void | free (Data *) |
static Data * | fromAscii_helper (const char *str, int size=-1) |
static Data * | fromLatin1_helper (const char *str, int size=-1) |
static int | grow (int) |
static int | localeAwareCompare_helper (const QChar *data1, int length1, const QChar *data2, int length2) |
Properties | |
Data * | d |
Static Private Attributes | |
static QTextCodec * | codecForCStrings |
static Data | shared_empty |
static Data | shared_null |
Friends | |
struct | QAbstractConcatenable |
class | QCFString |
class | QCharRef |
bool | qStringComparisonHelper (const QString &s1, const char *s2) |
bool | qStringComparisonHelper (const QStringRef &s1, const char *s2) |
class | QStringRef |
class | QTextCodec |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator!= (const char *s1, const QString &s2) |
const QString | operator+ (const QString &s1, const QString &s2) |
Returns a string which is the result of concatenating s1 and s2. More... | |
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 ch) |
Returns a string which is the result of concatenating the string s and the character ch. More... | |
const QString | operator+ (char ch, const QString &s) |
Returns a string which is the result of concatenating the character ch and the string s. More... | |
bool | operator< (const char *s1, const QString &s2) |
QDataStream & | operator<< (QDataStream &stream, const QString &string) |
Writes the given string to the specified stream. More... | |
bool | operator<= (const char *s1, const QString &s2) |
bool | operator==operator== (const char *s1, const QString &s2)() |
bool | operator> (const char *s1, const QString &s2) |
bool | operator>= (const char *s1, const QString &s2) |
QDataStream & | operator>> (QDataStream &stream, QString &string) |
Reads a string from the specified stream into the given string. More... | |
The QString class provides a Unicode character string.
QString stores a string of 16-bit QChar, where each QChar corresponds one Unicode 4.0 character. (Unicode characters with code values above 65535 are stored using surrogate pairs, i.e., two consecutive QChar.)
Unicode is an international standard that supports most of the writing systems in use today. It is a superset of US-ASCII (ANSI X3.4-1986) and Latin-1 (ISO 8859-1), and all the US-ASCII/Latin-1 characters are available at the same code positions.
Behind the scenes, QString uses implicit sharing (copy-on-write) to reduce memory usage and to avoid the needless copying of data. This also helps reduce the inherent overhead of storing 16-bit characters instead of 8-bit characters.
In addition to QString, Qt also provides the QByteArray class to store raw bytes and traditional 8-bit '\0'-terminated strings. For most purposes, QString is the class you want to use. It is used throughout the Qt API, and the Unicode support ensures that your applications will be easy to translate if you want to expand your application's market at some point. The two main cases where QByteArray is appropriate are when you need to store raw binary data, and when memory conservation is critical (e.g., with Qt for Embedded Linux).
One way to initialize a QString is simply to pass a const char
to its constructor. For example, the following code creates a QString of size 5 containing the data "Hello":
QString converts the const char *
data into Unicode using the fromAscii() function. By default, fromAscii() treats character above 128 as Latin-1 characters, but this can be changed by calling QTextCodec::setCodecForCStrings().
In all of the QString functions that take const char *
parameters, the const char *
is interpreted as a classic C-style '\0'-terminated string. It is legal for the const char
parameter to be 0.
You can also provide string data as an array of QChar:
QString makes a deep copy of the QChar data, so you can modify it later without experiencing side effects. (If for performance reasons you don't want to take a deep copy of the character data, use QString::fromRawData() instead.)
Another approach is to set the size of the string using resize() and to initialize the data character per character. QString uses 0-based indexes, just like C++ arrays. To access the character at a particular index position, you can use operator[]() . On non-const strings, operator[]() returns a reference to a character that can be used on the left side of an assignment. For example:
For read-only access, an alternative syntax is to use the at() function:
The at() function can be faster than operator[]() , because it never causes a deep copy to occur. Alternatively, use the left(), right(), or mid() functions to extract several characters at a time.
A QString can embed '\0' characters (QChar::Null). The size() function always returns the size of the whole string, including embedded '\0' characters.
After a call to the resize() function, newly allocated characters have undefined values. To set all the characters in the string to a particular value, use the fill() function.
QString provides dozens of overloads designed to simplify string usage. For example, if you want to compare a QString with a string literal, you can write code like this and it will work as expected:
You can also pass string literals to functions that take QStrings as arguments, invoking the QString(const char *) constructor. Similarly, you can pass a QString to a function that takes a const char *
argument using the qPrintable() macro which returns the given QString as a const char *
. This is equivalent to calling <QString>.toLocal8Bit().constData().
QString provides the following basic functions for modifying the character data: append(), prepend(), insert(), replace(), and remove(). For example:
If you are building a QString gradually and know in advance approximately how many characters the QString will contain, you can call reserve(), asking QString to preallocate a certain amount of memory. You can also call capacity() to find out how much memory QString actually allocated.
The replace() and remove() functions' first two arguments are the position from which to start erasing and the number of characters that should be erased. If you want to replace all occurrences of a particular substring with another, use one of the two-parameter replace() overloads.
A frequent requirement is to remove whitespace characters from a string ('\n', '\t', ' ', etc.). If you want to remove whitespace from both ends of a QString, use the trimmed() function. If you want to remove whitespace from both ends and replace multiple consecutive whitespaces with a single space character within the string, use simplified().
If you want to find all occurrences of a particular character or substring in a QString, use the indexOf() or lastIndexOf() functions. The former searches forward starting from a given index position, the latter searches backward. Both return the index position of the character or substring if they find it; otherwise, they return -1. For example, here's a typical loop that finds all occurrences of a particular substring:
QString provides many functions for converting numbers into strings and strings into numbers. See the arg() functions, the setNum() functions, the number() static functions, and the toInt(), toDouble(), and similar functions.
To get an upper- or lowercase version of a string use toUpper() or toLower().
Lists of strings are handled by the QStringList class. You can split a string into a list of strings using the split() function, 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 QRegExp using the QStringList::filter() function.
If you want to see if a QString starts or ends with a particular substring use startsWith() or endsWith(). If you simply want to check whether a QString contains a particular character or substring, use the contains() function. If you want to find out how many times a particular character or substring occurs in the string, use count().
QStrings can be compared using overloaded operators such as operator<() , operator<=() , operator==() , operator>=() , and so on. Note that the comparison is based exclusively on the numeric Unicode values of the characters. It is very fast, but is not what a human would expect; the QString::localeAwareCompare() function is a better choice for sorting user-interface strings.
To obtain a pointer to the actual character data, call data() or constData(). These functions return a pointer to the beginning of the QChar data. The pointer is guaranteed to remain valid until a non-const function is called on the QString.
QString provides the following four functions that return a const char *
version of the string as QByteArray: toAscii(), toLatin1(), toUtf8(), and toLocal8Bit().
To convert from one of these encodings, QString provides fromAscii(), fromLatin1(), fromUtf8(), and fromLocal8Bit(). Other encodings are supported through the QTextCodec class.
As mentioned above, QString provides a lot of functions and operators that make it easy to interoperate with const char *
strings. But this functionality is a double-edged sword: It makes QString more convenient to use if all strings are US-ASCII or Latin-1, but there is always the risk that an implicit conversion from or to const char *
is done using the wrong 8-bit encoding. To minimize these risks, you can turn off these implicit conversions by defining the following two preprocessor symbols:
QT_NO_CAST_FROM_ASCII
disables automatic conversions from C string literals and pointers to Unicode. QT_NO_CAST_TO_ASCII
disables automatic conversion from QString to C strings. One way to define these preprocessor symbols globally for your application is to add the following entry to your qmake Project Files{qmake project file}:
You then need to explicitly call fromAscii(), fromLatin1(), fromUtf8(), or fromLocal8Bit() to construct a QString from an 8-bit string, or use the lightweight QLatin1String class, for example:
Similarly, you must call toAscii(), toLatin1(), toUtf8(), or toLocal8Bit() explicitly to convert the QString to an 8-bit string. (Other encodings are supported through the QTextCodec class.)
%
Note for C Programmers
Due to C++'s type system and the fact that QString is implicitly shared, QStrings may be treated like int
s or other basic types. For example:
The result
variable, is a normal variable allocated on the stack. When return
is called, and 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.
For historical reasons, QString distinguishes between a null string and an empty string. A null string is a string that is initialized using QString's default constructor or by passing (const char *)0 to the constructor. An empty string is any string with size 0. A null string is always empty, but an empty string isn't necessarily null:
All functions except isNull() treat null strings the same as empty strings. For example, toAscii().constData() returns a pointer to a '\0' character for a null string (not a null pointer), and QString() compares equal to QString(""). We recommend that you always use the isEmpty() function and avoid isNull().
In member functions where an argument format can be specified (e.g., arg(), number()), the argument format can be one 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 |
A precision is also specified with the argument format. For the 'e', 'E', and 'f' formats, the precision represents the number of digits after the decimal point. For the 'g' and 'G' formats, the precision represents the maximum number of significant digits (trailing zeroes are omitted).
Using the QString '+'
operator, it is easy to construct a complex string from multiple substrings. You will often write code like this:
There is nothing wrong with either of these string constructions, but there are a few hidden inefficiencies. Beginning with Qt 4.6, you can eliminate them.
First, multiple uses of the '+'
operator usually means multiple memory allocations. When concatenating n substrings, where n > 2, there can be as many as n - 1 calls to the memory allocator.
Second, QLatin1String does not store its length internally but calls qstrlen() when it needs to know its length.
In 4.6, an internal template class QStringBuilder
has been added along with a few helper functions. This class is marked internal and does not appear in the documentation, because you aren't meant to instantiate it in your code. Its use will be automatic, as described below. The class is found in {src/corelib/tools/qstringbuilder.cpp}
if you want to have a look at it.
QStringBuilder
uses expression templates and reimplements the ''
operator so that when you use ''
for string concatenation instead of '+'
, multiple substring concatenations will be postponed until the final result is about to be assigned to a QString. At this point, the amount of memory required for the final result is known. The memory allocator is then called once to get the required space, and the substrings are copied into it one by one.
QLatin1Literal
is a second internal class that can replace QLatin1String, which can't be changed for compatibility reasons. QLatin1Literal
stores its length, thereby saving time when QStringBuilder
computes the amount of memory required for the final string.
Additional efficiency is gained by inlining and reduced reference counting (the QString created from a QStringBuilder
typically has a ref count of 1, whereas QString::append() needs an extra test).
There are three ways you can access this improved method of string construction. The straightforward way is to include QStringBuilder
wherever you want to use it, and use the ''
operator instead of '+'
when concatenating strings:
A more global approach which is the most convenient but not entirely source compatible, is to this define in your .pro file:
and the '+'
will automatically be performed as the QStringBuilder
''
everywhere.
The QString::const_iterator typedef provides an STL-style const iterator for QString.
The QString::const_reference typedef provides an STL-style const reference for QString.
Qt-style synonym for QString::const_iterator.
The QString::iterator typedef provides an STL-style non-const iterator for QString.
Qt-style synonym for QString::iterator.
The QString::const_reference typedef provides an STL-style reference for QString.
The QString::const_reference typedef provides an STL-style value type for QString.
This enum describes the various normalized forms of Unicode text.
Enumerator | |
---|---|
NormalizationForm_D | |
NormalizationForm_C | |
NormalizationForm_KD | |
NormalizationForm_KC |
Definition at line 309 of file qstring.h.
enum QString::SectionFlag |
This enum specifies flags that can be used to affect various aspects of the section() function's behavior with respect to separators and empty fields.
Enumerator | |
---|---|
SectionDefault | |
SectionSkipEmpty | |
SectionIncludeLeadingSep | |
SectionIncludeTrailingSep | |
SectionCaseInsensitiveSeps |
Definition at line 212 of file qstring.h.
This enum specifies how the split() function should behave with respect to empty strings.
Enumerator | |
---|---|
KeepEmptyParts | |
SkipEmptyParts |
Definition at line 299 of file qstring.h.
|
inline |
Constructs a null string.
Null strings are also empty.
Definition at line 879 of file qstring.h.
Referenced by clear(), fromAscii(), fromLatin1(), fromLocal8Bit(), fromRawData(), fromStdWString(), fromUcs4(), fromUtf16(), fromUtf8(), left(), mid(), operator=(), QSettingsKey::originalKeyPosition(), repeated(), right(), section(), simplified(), QStringRef::toString(), and trimmed().
QString::QString | ( | const QChar * | unicode, |
int | size | ||
) |
Constructs a string initialized with the first size characters of the QChar array unicode.
QString makes a deep copy of the string data. The unicode data is copied as is and the Byte Order Mark is preserved if present.
Definition at line 1118 of file qstring.cpp.
|
explicit |
Constructs a string initialized with the characters of the QChar array unicode, which must be terminated with a 0.
QString makes a deep copy of the string data. The unicode data is copied as is and the Byte Order Mark is preserved if present.
Definition at line 1150 of file qstring.cpp.
QString::QString | ( | QChar | c | ) |
Constructs a string of size 1 containing the character ch.
Definition at line 1236 of file qstring.cpp.
QString::QString | ( | int | size, |
QChar | ch | ||
) |
Constructs a string of the given size with every character set to ch.
Definition at line 1182 of file qstring.cpp.
|
inline |
Constructs a copy of the Latin-1 string str.
Definition at line 694 of file qstring.h.
|
inline |
Constructs a copy of other.
This operation takes constant time, because QString is implicitly shared. This makes returning a QString from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes linear time.
Definition at line 725 of file qstring.h.
|
inline |
Constructs a string initialized with the 8-bit string str.
The given const char pointer is converted to Unicode using the fromAscii() function.
You can disable this constructor by defining QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.
Definition at line 419 of file qstring.h.
|
inline |
Constructs a string initialized with the byte array ba.
The given byte array is converted to Unicode using fromAscii(). Stops copying at the first 0 character, otherwise copies the entire byte array.
You can disable this constructor by defining QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.
Definition at line 421 of file qstring.h.
|
inline |
QString::QString | ( | int | size, |
Qt::Initialization | |||
) |
Constructs a string of the given size without initializing the characters.
This is only used in QStringBuilder::toString()
.
Definition at line 1212 of file qstring.cpp.
Definition at line 1777 of file qstring.cpp.
Referenced by _q_escapeIdentifier(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QPrintPreviewDialogPrivate::_q_print(), QFileSystemEngine::absoluteName(), QZipWriter::addDirectory(), QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), QByteArray::append(), QCoreApplication::applicationFilePath(), QPatternist::XQueryTokenizer::attributeAsRaw(), QAccessibleTextWidget::attributes(), QDeclarativeCompiler::buildDynamicMeta(), QScript::callQtMethod(), QPatternist::ColorOutput::colorify(), QPatternist::ColoringMessageHandler::colorifyDescription(), comify(), QMultiScreen::connect(), QScriptDebuggerConsole::consumeInput(), QWindowsLocalCodec::convertToUnicode(), QWindowsLocalCodec::convertToUnicodeCharByChar(), QScriptDebuggerConsolePrivate::createJob(), QAbstractFileEngineIterator::currentFilePath(), QScriptDebuggerLocalsModel::data(), QScriptBreakpointsModel::data(), QLocalePrivate::dateTimeToString(), decimalForm(), QSqlTableModel::deleteRowFromTable(), QSvgText::draw(), QRegExp::escape(), QPatternist::ColorOutputPrivate::escapeCode(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPatternist::CodepointsToStringFN::evaluateSingleton(), exponentForm(), extractEncodingDecl(), QDeclarativeScriptParser::extractMetaData(), QFileSystemModelPrivate::filePath(), QTextBrowserPrivate::findFile(), fixedCharData(), fixedXmlName(), QTest::formatResult(), QTDSDriver::formatValue(), QMYSQLDriver::formatValue(), QScript::functionConnect(), QScript::functionPrint(), QBBSystemLocaleData::getCorrectFormat(), QSslSocketBackendPrivate::getErrorsFromOpenSsl(), QScriptCompleteScriptsJob::handleResponse(), QDeclarativeXMLHttpRequest::headers(), QScriptEngine::importExtension(), QScriptDebuggerLocalsModel::init(), init_platform(), initializeDb(), QTextDocumentPrivate::insert(), QTextDocumentPrivate::insertBlock(), isDirPath(), QSystemLibrary::load(), QFSFileEnginePrivate::longFileName(), QSharedMemoryPrivate::makePlatformSafeKey(), QScriptDebuggerConsoleWidget::message(), QScriptDebugOutputWidget::message(), QScriptErrorLogWidget::message(), QScriptStdMessageHandler::message(), QXlibMime::mimeAtomForFormat(), QFileSystemEngine::nativeAbsoluteFilePath(), QScriptEnginePrivate::newRegExp(), QPatternist::TokenRevealer::nextToken(), QPatternist::XQueryTokenizer::nextToken(), QFileSystemModelPrivate::node(), QPatternist::XQueryTokenizer::normalizeEOL(), QDBusXmlParser::objectTree(), QPSQLDriver::open(), QTemporaryFileEngine::open(), QSqlRelationalTableModel::orderByClause(), QSqlTableModel::orderByClause(), QDeclarativeStyledTextPrivate::parse(), QScriptXmlParser::parse(), parseCSStoXMLAttrs(), QPatternist::PatternPlatform::parseFlags(), QCss::Parser::parseFunction(), parseStopNode(), QTextHtmlParserNode::parseStyleAttribute(), QDeclarativeStyledTextPrivate::parseTag(), QSvgIconEnginePrivate::pmcKey(), QPSQLResult::prepare(), QApplicationPrivate::process_cmdline(), QTextStreamPrivate::putString(), qAppendWhereClause(), qCreateParamString(), QFileSystemIterator::QFileSystemIterator(), qGetTableInfo(), qIsEffectiveTLD(), qQuote(), QScriptDebuggerBackendPrivate::qsassert(), qt_readEscapedFormatString(), qws_dataDir(), qws_fontCacheDir(), readSourceFile(), QSqlRelationalTableModelPrivate::relationField(), QDeclarativeXMLHttpRequest::requestFromUrl(), QGLTextureGlyphCache::resizeTextureData(), QDeclarativeCompiledBindingsPrivate::run(), QSqlRelationalTableModel::selectStatement(), QSqlTableModel::selectStatement(), QPatternist::AbstractDuration::serializeMSeconds(), QPatternist::AbstractDateTime::serializeMSeconds(), QDeclarativeEngineDebugService::setMethodBody(), QUndoAction::setPrefixedText(), QGtkStylePrivate::setupGtkFileChooser(), QFileSystemEngine::slowCanonicalized(), QSettingsPrivate::splitArgs(), QFSCompleter::splitPath(), QSqlDriver::sqlStatement(), QPatternist::YearMonthDuration::stringValue(), QPatternist::Duration::stringValue(), QPatternist::DayTimeDuration::stringValue(), QConfFileSettingsPrivate::syncConfFile(), QPatternist::XsdInstanceReader::text(), QPatternist::XQueryTokenizer::tokenizeStringLiteral(), QProcessEnvironmentPrivate::toList(), QScriptContext::toString(), QHostAddress::toString(), QScriptDebuggerBackendPrivate::trace(), QSqlTableModel::updateRowInTable(), QSpinBoxValidator::validate(), vsprintf(), QXmlStreamWriterPrivate::write(), QXmlStreamWriterPrivate::writeEscaped(), QX11Data::xdndMimeAtomForFormat(), and QPatternist::AbstractDateTime::zoneOffsetToString().
Appends the string str onto the end of this string.
Example:
This is the same as using the insert() function:
The append() function is typically very fast (constant time), because QString preallocates extra space at the end of the string data so it can grow without reallocating the entire string each time.
Definition at line 1701 of file qstring.cpp.
QString & QString::append | ( | const QStringRef & | reference | ) |
Appends the given string reference to this string and returns the result.
Definition at line 9017 of file qstring.cpp.
QString & QString::append | ( | const QLatin1String & | s | ) |
Definition at line 1725 of file qstring.cpp.
|
inline |
Definition at line 436 of file qstring.h.
|
inline |
Definition at line 438 of file qstring.h.
QString QString::arg | ( | qlonglong | a, |
int | fieldwidth = 0 , |
||
int | base = 10 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Definition at line 7186 of file qstring.cpp.
Referenced by QFileDialogPrivate::_q_goToDirectory(), QFtpPrivate::_q_piError(), QMessageBox::aboutQt(), QFileDialog::accept(), QDeclarativeImportsPrivate::add(), QGraphicsAnchorLayoutPrivate::addAnchor_helper(), QLocalServerPrivate::addListener(), RequestAnalyzer::analyze(), QDeclarativeXmlListModelPrivate::append_role(), QPSQLDriverPrivate::appendTables(), arg(), QSharedMemoryPrivate::attach(), QAccessibleTextWidget::attributes(), buildMatchRule(), QDeclarativeObjectMethodScriptClass::callPrecise(), QScript::callQtMethod(), QPatternist::XsdTypeChecker::checkConstrainingFacetsQName(), QUnixPrintWidgetPrivate::checkFields(), checkHRESULT(), QDBusPendingCallPrivate::checkReceivedSignature(), QCoreApplicationPrivate::checkReceiverThread(), QBenchmarkValgrindUtils::cleanup(), QGraphicsWidget::close(), QDeclarativeGestureAreaParser::compile(), QDeclarativeConnectionsParser::compile(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QDeclarativeConnections::connectSignals(), QFile::copy(), QSharedMemory::create(), QSharedMemoryPrivate::create(), QPatternist::XsdSchemaParserContext::createAnonymousName(), createArrayBuffer(), createPixmapDataSync(), QDeclarativeAbstractAnimationPrivate::createProperty(), QLocale::createSeparatedList(), createSequence(), QOutputStrategy::createUniqueImageName(), QScriptDebuggerStackModel::data(), QScriptDebuggerScriptsModel::data(), QScriptBreakpointsModel::data(), QGraphicsSceneBspTree::debug(), QScriptDebuggerPrivate::debuggerEvent(), decodeMSG(), QScript::QObjectDelegate::deleteProperty(), derivedTermValid(), QPatternist::Expression::description(), QSharedMemoryPrivate::detach(), divZeroInvalid(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QMacStylePrivate::drawCombobox(), QWindowsVistaStyle::drawControl(), QGtkStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QMacStylePrivate::drawTableHeader(), QGridLayoutRowInfo::dump(), QGraphicsAnchorLayoutPrivate::dumpGraph(), QSimplex::dumpMatrix(), dumpRecursive(), QPdfEnginePrivate::embedFont(), QKeySequencePrivate::encodeString(), QPatternist::ReplaceFN::errorAtEnd(), QHttpNetworkConnectionPrivate::errorDetail(), QWorkspace::eventFilter(), QPSQLResult::exec(), QScript::QMetaObjectWrapperObject::execute(), QDeclarativeImportedNamespace::find(), QDeclarativeImportsPrivate::find(), QDBusMetaObjectGenerator::findType(), QHttpThreadDelegate::finishedSlot(), QMinimalWindowSurface::flush(), fromScriptValue(), QNetworkAccessFtpBackend::ftpDone(), QScript::functionConnect(), QScript::functionDisconnect(), QSvgPaintEnginePrivate::generateGradientName(), generateInterfaceXml(), generateSubObjectXml(), QNativeWifiEngine::getInterfaceFromId(), QBenchmarkValgrindUtils::getNewestFileName(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QFileIconProviderPrivate::getWinIcon(), QSystemSemaphorePrivate::handle(), QSharedMemoryPrivate::handle(), QDBusConnectionPrivate::handleObjectCall(), idivZeroInvalid(), QDeclarativeImportsPrivate::importExtension(), QDeclarativeImportDatabase::importPlugin(), QLocalSocketPrivate::init(), QPrintPreviewDialogPrivate::init(), init_platform(), QSharedMemoryPrivate::initKey(), QDeclarativeListModel::insert(), QDeclarativeDebugServer::instance(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QLibraryPrivate::isPlugin(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::issueCastError(), QPatternist::XsdSchemaHelper::isValidAttributeUsesExtension(), QPatternist::XsdSchemaHelper::isValidAttributeUsesRestriction(), QPatternist::XsdTypeChecker::isValidString(), jump(), QPlatformIntegrationFactory::keys(), QLocalServer::listen(), QLibraryPrivate::load_sys(), QSystemTrayIconSys::locateSystemTray(), QSharedMemory::lock(), modZeroInvalid(), QTest::mouseEvent(), multiArg(), QPatternist::NCNameConstructor::nameIsXML(), QNetworkAccessCacheBackend::open(), QNetworkAccessFileBackend::open(), QAudioDeviceInfoInternal::open(), QOCIDriver::open(), QAudioInputPrivate::open(), QAudioOutputPrivate::open(), operator<<(), QBenchmarkValgrindUtils::outFileBase(), ParallelAnchorData::ParallelAnchorData(), QDateTimeParser::parse(), QScriptDebuggerAgent::positionChange(), QPSQLResult::prepare(), QHttpNetworkConnectionPrivate::prepareRequest(), QMYSQLDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QDeclarativePixmapReader::processJob(), QDBusAbstractInterfacePrivate::property(), QDeclarativePropertyChangesPrivate::property(), QScript::QObjectDelegate::put(), qax_docuFromName(), QSvgPaintEngine::qbrushToSvg(), qDBusGenerateMetaObjectXml(), qDBusIntrospectObject(), qDBusReplyFill(), qExtractSecurityPolicyFromString(), qMakeError(), QNetworkReplyDataImpl::QNetworkReplyDataImpl(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), QScript::qobjectProtoFuncToString(), QScriptDebuggerBackendPrivate::qsassert(), qt_eval_string(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_menu_merge_text(), qt_parse_pattern(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qTdsErrHandler(), qTdsMsgHandler(), QDeclarativeXmlListModel::queryError(), rasterFallbackWarn(), QAudioInputPrivate::read(), MetaObjectGenerator::readClassInfo(), readImage(), QNetworkAccessFileBackend::readMoreFromFile(), QOCIDriver::record(), QTDSDriver::record(), QPSQLDriver::record(), QDeclarativeListModel::remove(), replacePercentN(), QGraphicsAnchorLayoutPrivate::replaceVertex(), QSslSocketPrivate::resetDefaultCiphers(), QLibraryPrivate::resolve_sys(), QDeclarativeCompiledBindingsPrivate::run(), QSvgPaintEngine::saveGradientStops(), QScript::Lexer::scanRegExp(), QDeclarativeJS::Lexer::scanRegExp(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QSqlRelationalTableModel::selectStatement(), QDBusConnectionPrivate::sendError(), SequentialAnchorData::SequentialAnchorData(), Graph< AnchorVertex, AnchorData >::serializeToDot(), QDeclarativeListModel::set(), QLocalServerPrivate::setError(), QStateMachinePrivate::setError(), QSocks5SocketEnginePrivate::setErrorState(), QSystemSemaphorePrivate::setErrorString(), QLocalSocketPrivate::setErrorString(), QSharedMemoryPrivate::setErrorString(), QMdiSubWindowPrivate::setNewWindowTitle(), QUndoAction::setPrefixedText(), QDeclarativeListModel::setProperty(), AVMediaObject::setSource(), QDirModelPrivate::size(), QFileSystemModelPrivate::size(), standardLibraryErrorString(), QXmlStreamReaderPrivate::startDocument(), QSvgHandler::startElement(), QScript::stringProtoFuncArg(), QHttpThreadDelegate::synchronousFinishedSlot(), QSQLiteDriver::tables(), QAudioDeviceInfoInternal::testSettings(), QAccessibleItemRow::text(), QLocale::toCurrencyString(), QTextHtmlExporter::toHtml(), QBenchmarkContext::toString(), AnchorVertex::toString(), QDate::toString(), QSimplexConstraint::toString(), QHttpResponseHeader::toString(), AnchorData::toString(), QHttpRequestHeader::toString(), QTime::toString(), GraphPath::toString(), translate_color(), translate_dashPattern(), QSharedMemoryPrivate::tryLocker(), QPatternist::XSLTTokenizer::unexpectedContent(), QLibraryPrivate::unload_sys(), QSharedMemory::unlock(), QDeclarativeBinding::update(), QFactoryLoader::updateDir(), QNetworkAccessFileBackend::uploadReadyReadSlot(), QPatternist::XsdValidatingInstanceReader::validate(), QPatternist::MaintainingReader< XSLTTokenLookup >::validateElement(), QScript::variantProtoFuncToString(), vsprintf(), QIBaseResultPrivate::writeArray(), QTextOdfWriter::writeCharacterFormat(), QTextOdfWriter::writeListFormat(), QPatternist::CardinalityVerifier::wrongCardinality(), QPatternist::TypeChecker::wrongType(), and QApplicationPrivate::x11_apply_settings().
QString QString::arg | ( | qulonglong | a, |
int | fieldwidth = 0 , |
||
int | base = 10 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Definition at line 7233 of file qstring.cpp.
|
inline |
Definition at line 747 of file qstring.h.
|
inline |
Definition at line 749 of file qstring.h.
|
inline |
Definition at line 743 of file qstring.h.
|
inline |
Definition at line 745 of file qstring.h.
|
inline |
fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar.
A positive value produces right-aligned text; a negative value produces left-aligned text.
The base must be between 2 and 36, with 8 giving octal, 10 decimal, and 16 hexadecimal numbers.
If fillChar is '0' (the number 0, ASCII 48), the locale's zero is used. For negative numbers, zero padding might appear before the minus sign.
Definition at line 751 of file qstring.h.
|
inline |
Definition at line 753 of file qstring.h.
QString QString::arg | ( | double | a, |
int | fieldWidth = 0 , |
||
char | fmt = 'g' , |
||
int | prec = -1 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Definition at line 7357 of file qstring.cpp.
QString QString::arg | ( | char | a, |
int | fieldWidth = 0 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Definition at line 7322 of file qstring.cpp.
QString QString::arg | ( | QChar | a, |
int | fieldWidth = 0 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Definition at line 7307 of file qstring.cpp.
QString QString::arg | ( | const QString & | a, |
int | fieldWidth = 0 , |
||
const QChar & | fillChar = QLatin1Char(' ') |
||
) | const |
Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1
, %2
, ..., %99
.
fieldWidth specifies the minimum amount of space that argument a shall occupy. If a requires less space than fieldWidth, it is padded to fieldWidth with character fillChar. A positive fieldWidth produces right-aligned text. A negative fieldWidth produces left-aligned text.
This example shows how we might create a status
string for reporting progress while processing a list of files:
First, arg(i)
replaces %1
. Then arg(total)
replaces %2
. Finally, arg(fileName)
replaces %3
.
One advantage of using arg() over sprintf() is that the order of the numbered place markers can change, if the application's strings are translated into other languages, but each arg() will still replace the lowest numbered unreplaced place marker, no matter where it appears. Also, if place marker i
appears more than once in the string, the arg() replaces all of them.
If there is no unreplaced place marker remaining, a warning message is output and the result is undefined. Place marker numbers must be in the range 1 to 99.
Definition at line 6962 of file qstring.cpp.
Definition at line 755 of file qstring.h.
Definition at line 757 of file qstring.h.
|
inline |
Definition at line 759 of file qstring.h.
|
inline |
Definition at line 762 of file qstring.h.
|
inline |
Definition at line 765 of file qstring.h.
|
inline |
Definition at line 768 of file qstring.h.
|
inline |
Definition at line 772 of file qstring.h.
|
inline |
Definition at line 776 of file qstring.h.
|
inline |
Returns the character at the given index position in the string.
The position must be a valid index position in the string (i.e., 0 <= position < size()).
Definition at line 698 of file qstring.h.
Referenced by QFileSystemModelPrivate::_q_fileSystemChanged(), _q_parseUnixDir(), QAbstractSocketPrivate::_q_startConnecting(), QDeclarativeTypeLoader::absoluteFilePath(), QNSOpenSavePanelDelegate::acceptableExtensionsForSave, QSvgIconEngine::addFile(), QPixmapIconEngine::addFile(), QDir::addResourceSearchPath(), QPatternist::XQueryTokenizer::aheadEquals(), QTextHtmlImporter::appendNodeText(), QCoreApplication::applicationFilePath(), QTextHtmlParser::applyAttributes(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QKeySequence::assign(), QStringRef::at(), QTextEngine::atSpace(), QPatternist::DerivedString< TypeToken >::attributeNormalize(), QTextEngine::atWordSeparator(), QLineControl::backspace(), QFileSystemEntry::baseName(), QDeclarativeCompiler::buildDynamicMeta(), canonicalOrderHelper(), QDeclarativeCompiler::checkDynamicMeta(), QDeclarativeCompiler::checkValidId(), QDirModelPrivate::children(), QDir::cleanPath(), QLocalePrivate::codeToScript(), comify(), QDeclarativeConnectionsParser::compile(), QFileSystemEntry::completeBaseName(), QScriptCompletionTaskPrivate::completeScriptExpression(), composeHelper(), QVFbScreen::connect(), QScriptEnginePrivate::convertValue(), QCalendarDateValidator::countRepeat(), countRepeat(), QPatternist::XQueryTokenizer::current(), QPSQLResult::data(), QLocalePrivate::dateTimeToString(), QPatternist::CompressedWhitespace::decompress(), QTextCursor::deletePreviousChar(), QStyledItemDelegate::displayText(), driveSpec(), QAxBase::dynamicCallHelper(), QTextEngine::elidedText(), QTextHtmlExporter::emitBlock(), encodeText(), Qt::escape(), QRegExp::escape(), QPatternist::escape(), QScriptDebuggerCodeView::event(), extractEncodingDecl(), QDeclarativeScriptParser::extractMetaData(), QXmlStreamReaderPrivate::fastScanContentCharList(), QFileSystemEntry::fileName(), QFileSystemEngine::fillMetaData(), QDeclarativeImportedNamespace::find(), QDateTimeParser::findAmPm(), QDateTimeParser::findDay(), findGraphicsFactory(), findGroupFactory(), findInBlock(), QDateTimeParser::findMonth(), findObject(), findStyleFactoryMethod(), findStyleUtilFactoryMethod(), findUtilFactory(), fixedCharData(), fixedXmlName(), fmtDateTime(), QTest::formatResult(), QSqlDriver::formatValue(), QChar::fromAscii(), QPatternist::NamePool::fromClarkName(), fromHex(), QUrl::fromLocalFile(), QDateTime::fromString(), QXmlStreamReaderPrivate::getChar(), QXmlStreamReaderPrivate::getChar_helper(), getFmtString(), QSystemLocalePrivate::getLocaleInfo_qchar(), getMessage(), getNextChar(), QMacInputContext::globalEventProcessor(), QLineControl::hasAcceptableInput(), QTextHtmlParserNode::hasOnlyWhitespace(), QTextHtmlParser::hasPrefix(), hasUnquotedAP(), hasValidSignal(), QScriptSyntaxHighlighter::highlightBlock(), QScriptSyntaxHighlighter::highlightWord(), QDirModel::index(), iniChopTrailingSpaces(), QSettingsPrivate::iniEscapedKey(), QSettingsPrivate::iniEscapedString(), QDeclarativePropertyPrivate::initProperty(), QTextDocumentPrivate::insert_block(), QTextDocumentPrivate::insert_string(), QTextCursor::insertText(), QPatternist::XSLTTokenizer::insideTemplate(), QLineControl::internalDelete(), QLineControl::internalInsert(), QFileSystemEntry::isAbsolute(), isDirPath(), QFileSystemEntry::isDriveRoot(), QPatternist::LangFN::isLangMatch(), isLineSeparatorBlockAfterTable(), QUrl::isParentOf(), QXmlUtils::isPublicID(), QDateTimeEditPrivate::isSeparatorKey(), isSignalPropertyName(), isSupportedSvgFeature(), QPatternist::DerivedString< TypeToken >::isValidName(), QPatternist::DerivedString< TypeToken >::isValidNMTOKEN(), QTest::keyClicks(), QTextControlPrivate::keyPressEvent(), QMenu::keyPressEvent(), QTextEdit::keyPressEvent(), QStringRef::lastIndexOf(), QPatternist::ProcessingInstructionConstructor::leftTrimmed(), QCoreApplication::libraryPaths(), QTranslator::load(), longestCommonPrefix(), QFSFileEnginePrivate::longFileName(), macToQtFormat(), mapToLowerCase(), Qt::mightBeRichText(), QKeySequence::mnemonic(), QTextDocumentPrivate::move(), QTextCursorPrivate::movePosition(), QDeclarativeProperty::name(), QFileSystemEngine::nativeAbsoluteFilePath(), QTextHtmlParser::newNode(), QCssScanner_Generated::next(), QPatternist::ToCodepointsIterator::next(), QTextLineItemIterator::next(), QPatternist::XQueryTokenizer::nextToken(), QFileSystemModelPrivate::node(), QSettingsPrivate::normalizedKey(), QPatternist::XQueryTokenizer::normalizeEOL(), QTextFrame::iterator::operator++(), QTextFrame::iterator::operator--(), operator<<(), QDeclarativeDirParser::parse(), QHttpHeader::parse(), QXmlStreamReaderPrivate::parse(), parseCombinedArgString(), QSvgHandler::parseCSStoXMLAttrs(), QTextHtmlParser::parseEntity(), QPatternist::PatternPlatform::parseFlags(), QDateTimeParser::parseFormat(), QLineControl::parseInputMask(), QDeclarativeBindingCompilerPrivate::parseName(), QDateTimeParser::parseSection(), QFileSystemEntry::path(), QPatternist::XQueryTokenizer::peekAhead(), QXmlStreamReaderPrivate::peekChar(), QPatternist::XQueryTokenizer::peekForColonColon(), QKeyMapper::possibleKeys(), QSqlResult::prepare(), QCss::Scanner::preprocess(), QLineControl::processKeyEvent(), QFtpPI::processReply(), QTextHtmlImporter::processSpecialNodes(), QXmlStreamReaderPrivate::putReplacement(), QXmlStreamReaderPrivate::putReplacementInAttributeValue(), QTextStreamPrivate::putString(), QXmlStreamReaderPrivate::putString(), QXmlStreamReaderPrivate::putStringLiteral(), QChar::QChar(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QDeclarative_isFileCaseCorrect(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), QScript::qobjectProtoFuncFindChild(), qReplacePlaceholderMarkers(), qt_accAmpIndex(), qt_accHotKey(), qt_create_commandline(), qt_format_text(), qt_mac_removeMnemonics(), qt_readEscapedFormatString(), qt_repeatCount(), qt_set_x11_resources(), qt_splitLocaleName(), qt_string_normalize(), qt_strippedText(), readSymLink(), QPSQLDriver::record(), QFactoryLoader::refreshAll(), QTextDocumentPrivate::remove_block(), QTextDocumentPrivate::remove_string(), QCoreApplication::removeLibraryPath(), QLineControl::removeSelectedText(), QItemDelegatePrivate::replaceNewLine(), replacePercentN(), QDirModelPrivate::restorePersistentIndexes(), rotateSlashesDotsAndMiddots(), QTextDocumentPrivate::scan_frames(), QDeclarativeViewSection::sectionString(), QFileDialog::selectFile(), QLineEdit::selectionStart(), QCoreApplication::setApplicationVersion(), QUrlPrivate::setAuthority(), QCalendarDateValidator::setFormat(), QDirPrivate::setPath(), QGtkStylePrivate::setupGtkFileChooser(), QFileSystemEngine::slowCanonicalized(), QSettingsPrivate::splitArgs(), QProcessPrivate::startProcess(), stringContainsNullChar(), QSettingsPrivate::stringListToVariantList(), QScript::stringProtoFuncArg(), QPatternist::AbstractFloat< isDouble >::stringValue(), timeFormatContainsAP(), QPatternist::Tokenizer::tokenToString(), QUrl::toLocalFile(), QUrl::toString(), totalDigitsForDecimal(), QFontEngineXLFD::toUnicode(), translateKeyEventInternal(), tryDriveUNCFallback(), typeNameToXml(), QTextDocumentPrivate::unite(), unquote(), QDeclarativeListViewPrivate::updateCurrentSection(), QLineControl::updateDisplayText(), QKeyMapperPrivate::updateKeyMap(), QLocalePrivate::updateSystemPrivate(), QDateTimeEditPrivate::validateAndInterpret(), QLocalePrivate::validateChars(), QSystemLocalePrivate::winToQtFormat(), QXmlSerializer::writeEscaped(), QXmlStreamWriterPrivate::writeEscaped(), QXmlSerializer::writeEscapedAttribute(), and xpmHash().
|
inline |
Returns an STL-style iterator pointing to the first character in the string.
Definition at line 888 of file qstring.h.
Referenced by containsProhibitedOuptut().
|
inline |
|
inline |
Returns the maximum number of characters that can be stored in the string without forcing a reallocation.
The sole purpose of this function is to provide a means of fine tuning QString's memory usage. In general, you will rarely ever need to call this function. If you want to know how many characters are in the string, call size().
Definition at line 727 of file qstring.h.
Referenced by QOCIResultPrivate::bindValue(), QTextDocumentPrivate::compressPieceTable(), QODBCResult::exec(), and qt_ACE_do().
void QString::chop | ( | int | n | ) |
Removes n characters from the end of the string.
If n is greater than size(), the result is an empty string.
Example:
If you want to remove characters from the beginning of the string, use remove() instead.
Definition at line 4623 of file qstring.cpp.
Referenced by QDeclarativeImportsPrivate::add(), QWindowsFileSystemWatcherEngine::addPaths(), argToString(), buildMatchRule(), QDirModelPrivate::children(), QDir::cleanPath(), QFileSystemEngine::createDirectory(), QPSQLResult::data(), elliditide(), QTextHtmlExporter::emitCharFormatStyle(), QTextHtmlExporter::emitFragment(), QTextHtmlExporter::emitFrameStyle(), QTest::formatResult(), QDateTime::fromString(), getFindData(), QFileSystemEngine::getLinkTarget(), QSQLite2ResultPrivate::init(), intValueHelper(), isDirPath(), jump(), QCss::ValueExtractor::lengthValue(), QCompletionEngine::matchHint(), QDirModelPrivate::name(), QPatternist::TokenRevealer::nextToken(), QFileSystemModelPrivate::node(), QXmlStreamReaderPrivate::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), QCss::Parser::parseFunction(), parseIp6(), parseLength(), QCss::Parser::parseTerm(), QTextDocumentPrivate::plainText(), qt_parsePrintcap(), qt_parseQconfig(), QWizardField::QWizardField(), QFtpPI::readyRead(), QCss::Declaration::realValue(), removeOptionalQuotes(), QWindowsFileSystemWatcherEngine::removePaths(), QDeclarativeImportsPrivate::resolvedUri(), QPluginLoader::setFileName(), setFontSizeFromValue(), setWidthAttribute(), QSqlDriver::sqlStatement(), QSqlDriver::stripDelimitersImplementation(), QDB2Driver::tables(), QIBaseDriver::tables(), QUrl::toString(), translate_dashPattern(), QFileInfoGatherer::translateDriveName(), QCss::Parser::unquotedLexem(), and variantToString().
|
inline |
Clears the contents of the string and makes it empty.
Definition at line 723 of file qstring.h.
Referenced by QUnixPrintWidgetPrivate::_q_btnBrowseClicked(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QPixmapIconEngine::addPixmap(), Maemo::IcdPrivate::addrinfo(), QTextHtmlImporter::appendNodeText(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), QUrlPrivate::canonicalHost(), QProcessPrivate::Channel::Channel(), QDBusObjectPath::check(), QDBusSignature::check(), QScript::SyntaxChecker::checkSyntax(), QSqlTableModelPrivate::clear(), QXmlStreamStringRef::clear(), QFileInfoPrivate::clear(), QTextDocumentPrivate::clear(), QResourcePrivate::clear(), QUrlPrivate::clear(), QRegExpEngineKey::clear(), QAbstractSpinBoxPrivate::clearCache(), QNetworkSessionPrivateImpl::clearConfiguration(), QLabelPrivate::clearContents(), QFtpDTP::clearError(), QFtpPI::clearPendingCommands(), Maemo::IcdPrivate::clearState(), QDBusConnectionPrivate::closeConnection(), QPdfBaseEnginePrivate::closePrintDevice(), QWinInputContext::composition(), QIcdEngine::connectionStateSignalsSlot(), QNativeWifiEngine::connectToId(), QTextStreamPrivate::consume(), QDomImplementation::createDocumentType(), QDBusMetaObject::createMetaObject(), QAxBase::dynamicCallHelper(), QWinInputContext::endComposition(), QDomHandler::endEntity(), fbname(), QTextStreamPrivate::flushWriteBuffer(), fmtDateTime(), QXmlInputSource::fromRawData(), QXmlStreamReaderPrivate::getChar_helper(), getIBaseError(), QLocalSocketPrivate::init(), QDomDocumentTypePrivate::init(), QXmlSimpleReaderPrivate::init(), QXmlStreamReaderPrivate::init(), QCss::Parser::init(), QSharedMemoryPrivate::initKey(), QSettingsPrivate::iniUnescapedStringList(), QSqlDatabasePrivate::invalidateDb(), QLibraryPrivate::isPlugin(), QLibraryPrivate::load_sys(), QWhatsThat::mouseReleaseEvent(), QTextHtmlParser::newNode(), StringSplitter::next(), QDeclarativeXmlListModelPrivate::notifyQueryStarted(), QProcessPrivate::Channel::operator=(), QTextStream::operator>>(), operator>>(), QScriptParser::parse(), QUrlPrivate::parse(), QXmlStreamReaderPrivate::parse(), parseCombinedArgString(), QXmlSimpleReaderPrivate::parseDoctype(), QCss::Parser::parseElementName(), QXmlStreamReaderPrivate::parseError(), QXmlSimpleReaderPrivate::parseExternalID(), parseFontName(), QAuthenticatorPrivate::parseHttpResponse(), parseIp6(), QProcessPrivate::Channel::pipeFrom(), QProcessPrivate::Channel::pipeTo(), QTextStream::pos(), QPSQLResult::prepare(), QDBusConnectionPrivate::prepareHook(), QXmlNamespaceSupport::processName(), qDeallocatePreparedStmt(), qExtractSecurityPolicyFromString(), qGetStringData(), qt_fillFontDef(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), qt_parseQconfig(), qt_split_namespace(), qt_win_get_save_file_name(), QPatternist::XSLTTokenizer::queueTextConstructor(), QConfFileSettingsPrivate::readIniFile(), QMdiSubWindowPrivate::removeBaseWidget(), QWinInputContext::reset(), QTextStreamPrivate::resetReadBuffer(), QLibraryPrivate::resolve_sys(), QUrl::resolved(), Maemo::IcdPrivate::scan(), QFileDialogPrivate::selectFile_sys(), QUrlPrivate::setAuthority(), QDeclarativeJS::Lexer::setCode(), QDBusConnectionPrivate::setConnection(), QUrl::setEncodedFragment(), QUrl::setEncodedPassword(), QUrl::setEncodedPath(), QUrlPrivate::setEncodedUserInfo(), QUrl::setEncodedUserName(), QFilePrivate::setError(), QFont::setFamily(), QLibrary::setLoadHints(), QFont::setStyleHint(), QUrlPrivate::setUserInfo(), QSettingsPrivate::splitArgs(), QFSCompleter::splitPath(), QCompleter::splitPath(), QSqlDriver::sqlStatement(), QFtpPI::startNextCmd(), Maemo::IcdPrivate::state(), Maemo::IcdPrivate::statistics(), QSQLiteDriver::tables(), QLibraryPrivate::unload_sys(), QAuthenticatorPrivate::updateCredentials(), and QNetworkSessionPrivateImpl::updateState().
int QString::compare | ( | const QString & | s | ) | const |
Definition at line 5037 of file qstring.cpp.
Referenced by QFileSystemModelPrivate::_q_fileSystemChanged(), QStringRef::at(), QFontDatabase::bold(), QUnsortedModelEngine::buildIndices(), QFileSystemModelPrivate::caseInsensitiveLessThan(), QPatternist::StringComparator::compare(), QPatternist::CaseInsensitiveStringComparator::compare(), compare(), QLineControl::complete(), QVNCScreen::connect(), QTransformedScreen::connect(), QHttpNetworkConnectionPrivate::copyCredentials(), QTsLibPlugin::create(), QLinuxInputKbdDriver::create(), QLinuxTPMouseDriver::create(), QLinuxInputPlugin::create(), QNetworkAccessFileBackendFactory::create(), QNetworkAccessFtpBackendFactory::create(), declarations(), QFontDatabasePrivate::family(), QSortedModelEngine::filter(), findEncoding(), findObject(), QFontDatabase::font(), QtFontFamily::foundry(), QAudioOutputPrivate::freeBlocks(), QAudioInputPrivate::freeBlocks(), getFontWeight(), QStyleSheetStyle::hasStyleRule(), QTextHtmlParserNode::initializeProperties(), QFontDatabase::isBitmapScalable(), isCacheable(), QPatternist::LangFN::isLangMatch(), QUrl::isLocalFile(), QFontDatabase::isSmoothlyScalable(), QExtendedInformation::isSymLink(), QFontDatabase::italic(), QSortFilterProxyModel::lessThan(), loadFromDatabase(), QTextDocument::loadResource(), QAbstractItemModel::match(), QFileSystemModelPrivate::naturalCompare(), QFileSystemModelPrivate::nodeCaseInsensitiveLessThan(), QSvgStyleSelector::nodeNameEquals(), QAudioDeviceInfoInternal::open(), QAudioInputPrivate::open(), QAudioOutputPrivate::open(), QDirSortItemComparator::operator()(), QFileSystemModelPrivate::QFileSystemNode::operator<(), QStandardItem::operator<(), operator<(), QFileInfo::operator==(), QProcEnvKey::operator==(), QFileSystemModelPrivate::QFileSystemNode::operator==(), QDir::operator==(), QFileSystemModelPrivate::QFileSystemNode::operator>(), QXmlStreamReaderPrivate::parse(), parseBrushValue(), parseColorValue(), QFontDatabase::pointSizes(), qMatchCapStr(), QtPrivate::QStringList_contains(), QTsLibMouseHandler::QTsLibMouseHandler(), QCss::Declaration::rectValue(), registerFont(), QCoreApplication::removeLibraryPath(), QSqlRelationalTableModel::selectStatement(), QPrinter::setOutputFileName(), QFontDatabase::smoothSizes(), QSortedModelEngine::sortOrder(), QFontDatabase::styles(), QAudioDeviceInfoInternal::testSettings(), QDBusConnection::unregisterObject(), QDeclarativeEnginePrivate::urlToLocalFileOrQrc(), QPatternist::NCNameConstructor::validateTargetName(), and QFontDatabase::weight().
int QString::compare | ( | const QString & | s, |
Qt::CaseSensitivity | cs | ||
) | const |
Definition at line 5048 of file qstring.cpp.
int QString::compare | ( | const QLatin1String & | other, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 5075 of file qstring.cpp.
|
inlinestatic |
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.
If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.
Case sensitive 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-visible strings with localeAwareCompare().
Definition at line 352 of file qstring.h.
|
inlinestatic |
|
inlinestatic |
|
inline |
Definition at line 1245 of file qstring.h.
|
inlinestatic |
Definition at line 1247 of file qstring.h.
|
staticprivate |
Definition at line 5059 of file qstring.cpp.
Referenced by compare(), and QStringRef::compare().
|
staticprivate |
Definition at line 5101 of file qstring.cpp.
|
inline |
Returns a const STL-style iterator pointing to the first character in the string.
Definition at line 892 of file qstring.h.
Referenced by QSvgFont::draw(), idFromUrl(), and QFileSystemEntry::isClean().
|
inline |
Returns a pointer to the data stored in the QString.
The pointer can be used to access the characters that compose the string. For convenience, the data is '\0'-terminated.
Note that the pointer remains valid only as long as the string is not modified.
Definition at line 712 of file qstring.h.
Referenced by QTextCopyHelper::appendFragment(), QConcatenable< QString >::appendTo(), QTextEngine::attributes(), QDeclarativeCompiler::buildDynamicMeta(), QTextCodec::canEncode(), QFileSystemEngine::canonicalName(), compare(), QStringRef::compare(), QDeclarativeCompiler::completeComponentBuild(), QTextDocumentPrivate::compressPieceTable(), QAbstractConcatenable::convertFromAscii(), createFileFromTemplate(), QFileSystemEngine::createLink(), QScriptDeclarativeClass::createPersistentIdentifier(), createPolygonNode(), createPolylineNode(), QTextEngine::elidedText(), QAction::event(), QXmlInputSource::fetchData(), QTextCodec::fromUnicode(), QTextEncoder::fromUnicode(), QFileSystemEngine::getLinkTarget(), getText(), localeAwareCompare(), QStringRef::localeAwareCompare(), QLibraryInfo::location(), QFSFileEnginePrivate::nativeOpen(), QStyleSheetStyleSelector::nodeNameEquals(), QByteArray::operator!=(), operator+=(), QByteArray::operator<(), operator<(), operator<<(), QByteArray::operator<=(), QByteArray::operator==(), QByteArray::operator>(), QByteArray::operator>=(), QDeclarativeJS::Parser::parse(), parseAnimateTransformNode(), QDeclarativeStyledTextPrivate::parseAttribute(), QDeclarativeStyledTextPrivate::parseCloseTag(), QDeclarativeStyledTextPrivate::parseEntity(), parsePen(), QDeclarativeStyledTextPrivate::parseTag(), QDeclarativeStyledTextPrivate::parseValue(), QSQLiteResult::prepare(), QXmlNamespaceSupport::processName(), QPatternist::NamespaceSupport::processName(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), QFileSystemIterator::QFileSystemIterator(), qt_ACE_do(), qt_is_idn_enabled(), qt_string_normalize(), qt_u_strToCase(), QTextStreamPrivate::readPtr(), QDeclarativeBindingCompilerPrivate::registerLiteralString(), QFileSystemEngine::removeFile(), QFileSystemEngine::renameFile(), replace(), QDeclarativeCompiler::rewriteBinding(), QTextStreamPrivate::scan(), QAbstractXmlReceiver::sendAsNode(), QCoreApplication::setApplicationVersion(), QColor::setColorFromString(), QWSRegionCommand::setData(), ShaderEffectItem::setFragmentShader(), QDeclarativeTextInput::setPasswordCharacter(), QFileSystemEngine::setPermissions(), ShaderEffectItem::setVertexShader(), QFtpPI::startNextCmd(), QTextBlock::text(), QTextFragment::text(), QTextBlock::textDirection(), toDouble(), QUrl::toPunycode(), toPunycodeHelper(), QTest::toString(), XsdSchemaToken::toToken(), QPatternist::XSLTTokenLookup::toToken(), toUtf8(), QStringRef::toUtf8(), trimRef(), and QXmlSerializer::write().
|
inline |
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list.
Definition at line 898 of file qstring.h.
Referenced by QSvgFont::draw(), and QFileSystemEntry::isClean().
|
inline |
Definition at line 904 of file qstring.h.
Referenced by QHttpPrivate::_q_slotConnected(), QHttpPrivate::_q_slotReadyRead(), QFileDialogPrivate::_q_updateOkButton(), QNSOpenSavePanelDelegate::acceptableExtensionsForSave, QmlApplicationViewerPrivate::adjustPath(), QCoreApplication::applicationFilePath(), QStyleSheetStyleSelector::attribute(), QAudioDeviceInfoInternal::availableDevices(), QUrlPrivate::canonicalHost(), QODBCDriver::cleanup(), QXmlSerializer::comment(), QPatternist::DocumentProjector::comment(), QTransformedScreen::connect(), QConnmanEngine::connectToId(), QPatternist::ProcessingInstructionConstructor::data(), QKeySequencePrivate::decodeString(), QAudioDeviceInfoInternal::defaultOutputDevice(), QConnmanEngine::disconnectFromId(), DumpIDL(), QTextHtmlExporter::emitFontFamily(), QTextHtmlExporter::emitFragment(), QPatternist::MatchesFN::evaluateSingleton(), QMdiSubWindow::eventFilter(), QSortFilterProxyModel::filterAcceptsRow(), QPatternist::Numeric::fromLexical(), QPatternist::DerivedInteger< DerivedType >::fromLexical(), QDateTime::fromString(), QNetworkAccessFtpBackend::ftpRawCommandReply(), QAxScript::functions(), QBBSystemLocaleData::getCorrectFormat(), getFontWeight(), QConnmanManagerInterface::getPathForTechnology(), QGtkStylePrivate::getThemeName(), QScriptSyntaxHighlighter::highlightBlock(), QAxBase::initialize(), QPatternist::XSLTTokenizer::insideTemplate(), QDeclarativeDebugServer::instance(), isBypassed(), isHostExcluded(), QConnmanEngine::isRoamingAllowed(), QDateTimeEditPrivate::isSeparatorKey(), QtFontStyle::Key::Key(), QAxScript::load(), QDeclarativeDebugServerPrivate::loadConnectionPlugin(), QAbstractItemModel::match(), QXlibMime::mimeAtomForFormat(), networkChangeCallback(), QScriptEnginePrivate::newRegExp(), noBlockInString(), QFileSystemModelPrivate::node(), QAudioDeviceInfoInternal::open(), QODBCDriver::open(), QStringRef::operator=(), QHostAddressPrivate::parse(), QDateTimeParser::parse(), parse_locale_tag(), parseIp6(), QHostAddress::parseSubnet(), QGtkStyle::pixelMetric(), QXmlSerializer::processingInstruction(), QPatternist::DocumentProjector::processingInstruction(), QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(), qExtractSecurityPolicyFromString(), qGetODBCVersion(), qIsEffectiveTLD(), QMultiInputContext::QMultiInputContext(), qNtlmPhase3(), QQnxMouseHandler::QQnxMouseHandler(), QtPrivate::QStringList_filter(), qt_aqua_get_known_size(), qt_create_commandline(), qt_format_to_attrib_list(), qt_parseQconfig(), qt_splitLocaleName(), QTextHtmlImporter::QTextHtmlImporter(), QFileSystemModel::setData(), QMdiSubWindowPrivate::setNewWindowTitle(), QDeclarativeValueTypeScriptClass::setProperty(), QDeclarativeObjectScriptClass::setProperty(), QTextBrowserPrivate::setSource(), QMacStyle::sizeFromContents(), QFSCompleter::splitPath(), QProcessPrivate::startDetached(), QXmlStreamReaderPrivate::startDocument(), QUrlPrivate::toEncoded(), totalDigitsForDecimal(), QFontSubset::toType1(), QFileDialogPrivate::typedFiles(), QDeclarativeTextPrivate::updateLayout(), QLabelPrivate::updateShortcut(), QFontDialogPrivate::updateStyles(), QXmlStreamWriter::writeAttribute(), QXmlStreamWriter::writeComment(), QXmlStreamWriter::writeEmptyElement(), QXmlStreamWriter::writeProcessingInstruction(), QXmlStreamWriter::writeStartElement(), and QX11Data::xdndMimeAtomForFormat().
|
inline |
Returns true if this string contains an occurrence of the string str; otherwise returns false.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Example:
Definition at line 900 of file qstring.h.
|
inline |
Returns true if this string contains an occurrence of the string reference str; otherwise returns false.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Definition at line 902 of file qstring.h.
Definition at line 204 of file qstring.h.
Definition at line 209 of file qstring.h.
|
inline |
Definition at line 103 of file qstring.h.
Referenced by QFileDialogPrivate::_q_useNameFilter(), QNSOpenSavePanelDelegate::acceptableExtensionsForSave, QWizardPrivate::addField(), QDir::addResourceSearchPath(), QKeySequence::assign(), QPatternist::AccelTreeBuilder< true >::attribute(), QTextEngine::calculateTabWidth(), QAccessibleLineEdit::characterCount(), QDeclarativeCompiler::checkValidId(), count(), QStyledItemDelegate::displayText(), QMacStyle::drawControl(), QRegExp::escape(), QDeclarativeImportedNamespace::find(), QDateTimeParser::findAmPm(), QTest::formatResult(), QTextHtmlParserNode::hasOnlyWhitespace(), QDirModel::index(), QDeclarativePropertyPrivate::initProperty(), QAxServerBase::Load(), QLibraryPrivate::load_sys(), QFileSystemModelPrivate::naturalCompare(), QPatternist::XQueryTokenizer::nextToken(), QPatternist::XQueryTokenizer::normalizeEOL(), QStringRef::operator=(), parseIp6(), QDeclarativeStringConverters::pointFFromString(), QDeclarativeStringConverters::rectFFromString(), QItemDelegatePrivate::replaceNewLine(), QAxServerBase::Save(), QAccessibleLineEdit::selection(), QDeclarativeStringConverters::sizeFFromString(), subControlLayout(), QDeclarativeBindingCompilerPrivate::subscriptionIndex(), QPatternist::XQueryTokenizer::tokenizeStringLiteral(), totalDigitsForDecimal(), QDeclarativeStringConverters::vector3DFromString(), QXmlStreamWriter::writeAttribute(), QTextOdfWriter::writeBlock(), QXmlStreamWriter::writeEmptyElement(), and QXmlStreamWriter::writeStartElement().
int QString::count | ( | QChar | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3234 of file qstring.cpp.
int QString::count | ( | const QString & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the number of (potentially overlapping) occurrences of the string str in this string.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Definition at line 3220 of file qstring.cpp.
int QString::count | ( | const QStringRef & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3253 of file qstring.cpp.
int QString::count | ( | const QRegExp & | rx | ) | const |
Definition at line 3429 of file qstring.cpp.
|
inline |
Returns a pointer to the data stored in the QString.
The pointer can be used to access and modify the characters that compose the string. For convenience, the data is '\0'-terminated.
Example:
Note that the pointer remains valid only as long as the string is not modified by other means. For read-only access, constData() is faster because it never causes a deep copy to occur.
Definition at line 710 of file qstring.h.
Referenced by append(), arg(), QLocalePrivate::bcp47Name(), canonicalOrderHelper(), QTextDocumentPrivate::compressPieceTable(), QCoreWlanEngine::connectToId(), containsProhibitedOuptut(), QGb18030Codec::convertToUnicode(), QIsciiCodec::convertToUnicode(), QSimpleTextCodec::convertToUnicode(), QLatin15Codec::convertToUnicode(), QGbkCodec::convertToUnicode(), QGb2312Codec::convertToUnicode(), createFileFromTemplate(), decomposeHelper(), QLocalePrivate::doubleToString(), QDragManager::drag(), QPainter::drawText(), escapedKey(), QProcessPrivate::execChild(), QTextStreamPrivate::fillReadBuffer(), QTextStreamPrivate::flushWriteBuffer(), QDir::fromNativeSeparators(), QRawFont::glyphIndexesForString(), QFontMetrics::inFontUcs4(), QFontMetricsF::inFontUcs4(), QSettingsPrivate::iniUnescapedStringList(), insert(), make_widget_eventUPP(), mapToLowerCase(), multiArg(), QResourceRoot::name(), QAxSelect::on_ActiveXList_clicked(), QAxSelect::on_ActiveXList_doubleClicked(), operator+=(), operator<<(), operator>>(), QXmlStreamReaderPrivate::parse(), parse_locale_tag(), parseFontName(), QTextDocumentPrivate::plainText(), QProcessPrivate::processStarted(), QTextStreamPrivate::putString(), qt_ACE_do(), qt_format_text(), qt_nameprep(), qt_string_normalize(), replace(), replaceWithSpace(), QXlibClipboard::sendSelection(), toAscii(), toLatin1_helper(), QDir::toNativeSeparators(), QTextDocument::toPlainText(), toPunycodeHelper(), AnchorVertex::toString(), QTextDecoder::toUnicode(), QCharRef::unicode(), QLineControl::updateDisplayText(), updateValue(), and QFontMetrics::width().
|
inline |
|
inline |
|
inline |
Definition at line 714 of file qstring.h.
Referenced by begin(), QDBusConnectionPrivate::connectSignal(), data(), QDBusConnectionPrivate::disconnectSignal(), end(), QCharRef::operator=(), remove(), replace(), replace_helper(), and toCaseFolded().
|
inline |
Returns an STL-style iterator pointing to the imaginary character after the last character in the string.
Definition at line 894 of file qstring.h.
Referenced by isStringRightToLeft(), lastIndexOfHelper(), multiArg(), qFindString(), repeated(), section(), split(), trimmed(), and updateProperties().
|
inline |
bool QString::endsWith | ( | const QString & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the string ends with s; otherwise returns false.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Definition at line 3796 of file qstring.cpp.
Referenced by QUnixPrintWidgetPrivate::_q_btnBrowseClicked(), _q_parseDosDir(), QDeclarativeImportsPrivate::add(), QFileDialogPrivate::addDefaultSuffixToFiles(), QZipWriter::addDirectory(), QSvgIconEngine::addFile(), QWindowsFileSystemWatcherEngine::addPaths(), QPollingFileSystemWatcherEngine::addPaths(), QDir::cleanPath(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QFileSystemEngine::createDirectory(), QAbstractFileEngineIterator::currentFilePath(), QDeclarativeListModelParser::definesEmptyList(), QSvgText::draw(), QPSPrintEnginePrivate::emitHeader(), errorCodeToString(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QNetworkDiskCache::expire(), familyList(), QFileSystemModelPrivate::filePath(), QFileSystemEngine::fillMetaData(), find_translation(), QTextBrowserPrivate::findFile(), QResourceRoot::findNode(), QDateTime::fromString(), getFindData(), QFileSystemEngine::getLinkTarget(), QDirModel::index(), QSQLite2ResultPrivate::init(), intValueHelper(), isDirPath(), QMYSQLDriver::isIdentifierEscapedImplementation(), QODBCDriver::isIdentifierEscapedImplementation(), QSqlDriver::isIdentifierEscapedImplementation(), QLibrary::isLibrary(), isParentDomain(), QUrl::isParentOf(), isParentPath(), QLibraryPrivate::isPlugin(), QDBusUtil::isValidObjectPath(), jump(), launchWebBrowser(), QCss::ValueExtractor::lengthValue(), QSvgTinyDocument::load(), QTranslator::load(), QSystemLibrary::load(), QAxScriptManager::load(), QLibraryPrivate::load_sys(), loadOpenSslWin32(), QFSFileEnginePrivate::longFileName(), QAbstractItemModel::match(), QDirModelPrivate::name(), QFileSystemModelPrivate::node(), QDBusXmlParser::objectTree(), QNetworkAccessFtpBackend::open(), QStringRef::operator=(), parseAnimateColorNode(), parseAnimateTransformNode(), QTextHtmlParser::parseCloseTag(), parseLength(), QFSCompleter::pathFromIndex(), QFileSystemIterator::QFileSystemIterator(), QIconTheme::QIconTheme(), qmlFilesInDirectory(), QRenderRule::QRenderRule(), qt_create_commandline(), qt_init(), qt_mac_menu_merge_action(), QWizardField::QWizardField(), QCacheItem::read(), readImage(), readLink(), QFtpPI::readyRead(), QCss::Declaration::realValue(), QAxFactory::registerActiveObject(), QNetworkDiskCachePrivate::removeFile(), QWindowsFileSystemWatcherEngine::removePaths(), QDeclarativeImportsPrivate::resolvedUri(), QFileSystemModelPrivate::QFileSystemNode::retranslateStrings(), runningUnderDebugger(), QAxBase::setControl(), QFileDialog::setDirectory(), setFontSizeFromValue(), QDirPrivate::setPath(), setWidthAttribute(), QFSCompleter::splitPath(), QSqlDriver::sqlStatement(), QSettingsPrivate::stringToVariant(), QAbstractSpinBoxPrivate::stripped(), QSqlError::text(), QPollingFileSystemWatcherEngine::timeout(), QUrl::toString(), QFileInfoGatherer::translateDriveName(), QFileSystemModelPrivate::QFileSystemNode::updateIcon(), QSpinBoxValidator::validate(), and QXmlStreamWriter::writeComment().
bool QString::endsWith | ( | const QStringRef & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3816 of file qstring.cpp.
bool QString::endsWith | ( | const QLatin1String & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3826 of file qstring.cpp.
bool QString::endsWith | ( | const QChar & | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3837 of file qstring.cpp.
|
private |
Definition at line 1477 of file qstring.cpp.
Referenced by insert(), and QCharRef::operator=().
Sets every character in the string to character ch.
If size is different from -1 (default), the string is resized to size beforehand.
Example:
Definition at line 4641 of file qstring.cpp.
Referenced by QPatternist::XsdSchemaDebugger::dumpInheritance(), QPatternist::XsdSchemaDebugger::dumpParticle(), int2string(), leftJustified(), QSvgPaintEngine::qbrushToSvg(), rightJustified(), QDateTimeParser::sectionFormat(), QLCDNumber::setDigitCount(), and QLineControl::updateDisplayText().
|
staticprivate |
Definition at line 1311 of file qstring.cpp.
Referenced by operator=(), realloc(), resize(), and ~QString().
|
static |
Returns a QString initialized with the first size characters from the string str.
If size is -1 (default), it is taken to be qstrlen(str).
Note that, despite the name, this function actually uses the codec defined by QTextCodec::setCodecForCStrings() to convert str to Unicode. Depending on the codec, it may not accept valid US-ASCII (ANSI X3.4-1986) input. If no codec has been set, this function does the same as fromLatin1().
Definition at line 4276 of file qstring.cpp.
Referenced by QDateTimeEditPrivate::_q_editorCursorPositionChanged(), QHttpPrivate::_q_slotReadyRead(), QHttpPrivate::_q_slotSendRequest(), QGraphicsAnchorLayoutPrivate::addAnchor_helper(), QBasicUnixFontDatabase::addTTFile(), QFontDatabasePrivate::addTTFile(), append(), QSQLite2Driver::beginTransaction(), QGraphicsWidget::close(), QSQLite2Driver::commitTransaction(), convert(), QAbstractConcatenable::convertFromAscii(), Graph< AnchorVertex, AnchorData >::createEdge(), createSequence(), QLayoutPrivate::createSpacerItem(), QPSQLResult::data(), QGridLayoutRowInfo::dump(), QGraphicsAnchorLayoutPrivate::dumpGraph(), QSimplex::dumpMatrix(), QPatternist::EncodeString::evaluateSingleton(), QRadioButton::event(), QCheckBox::event(), QDB2Result::exec(), QWSSoundServerPrivate::feedDevice(), QSQLite2ResultPrivate::fetchNext(), QSQLite2ResultPrivate::finalize(), QSplitterPrivate::findWidget(), QHttpThreadDelegate::finishedSlot(), QXmlInputSource::fromRawData(), fromStdString(), QSslSocketBackendPrivate::getErrorsFromOpenSsl(), QPSQLDriverPrivate::getPSQLVersion(), getSegments(), QBBVirtualKeyboardBps::handleLocaleEvent(), QPushButtonPrivate::hitButton(), QSQLite2ResultPrivate::init(), QStatusBarPrivate::messageRect(), QGroupBox::mouseReleaseEvent(), QSQLite2Driver::open(), QLatin1String::operator!=(), operator!=(), operator+(), operator+=(), QByteArray::operator<(), operator<(), QLatin1String::operator<(), operator<(), QDebug::operator<<(), operator<<(), QTextStream::operator<<(), QByteArray::operator<=(), operator<=(), QLatin1String::operator<=(), operator<=(), QLatin1String::operator==(), operator==(), QByteArray::operator>(), operator>(), QLatin1String::operator>(), operator>(), QByteArray::operator>=(), operator>=(), QLatin1String::operator>=(), operator>=(), QToolBoxButton::paintEvent(), ParallelAnchorData::ParallelAnchorData(), QHttpNetworkConnectionPrivate::prepareRequest(), prepend(), QBoxLayout::QBoxLayout(), QComboBox::QComboBox(), QCopChannel::QCopChannel(), QDial::QDial(), QDialog::QDialog(), QDoubleValidator::QDoubleValidator(), QFrame::QFrame(), QGridLayout::QGridLayout(), QHBoxLayout::QHBoxLayout(), QImage::QImage(), QIntValidator::QIntValidator(), QLabel::QLabel(), QLineEdit::QLineEdit(), QMainWindow::QMainWindow(), QMenuBar::QMenuBar(), QObject::QObject(), QRegExpValidator::QRegExpValidator(), QScriptValue::QScriptValue(), QScrollBar::QScrollBar(), QSignalMapper::QSignalMapper(), QSizeGrip::QSizeGrip(), QSlider::QSlider(), QSocketNotifier::QSocketNotifier(), QSound::QSound(), QSpinBox::QSpinBox(), qStringComparisonHelper(), qt_get_screen(), QTabWidget::QTabWidget(), qTdsMsgHandler(), QTextBrowser::QTextBrowser(), QTextEdit::QTextEdit(), QTimer::QTimer(), QToolBar::QToolBar(), QToolButton::QToolButton(), QTranslator::QTranslator(), QValidator::QValidator(), QVariant::QVariant(), QVBoxLayout::QVBoxLayout(), QWidget::QWidget(), QWorkspace::QWorkspace(), QWSServer::QWSServer(), QWSSoundServerPrivate::QWSSoundServerPrivate(), QFtpPI::readyRead(), QIBaseResult::record(), Graph< AnchorVertex, AnchorData >::removeEdge(), QGraphicsAnchorLayoutPrivate::replaceVertex(), QSQLite2Result::reset(), QTDSResult::reset(), QLibraryPrivate::resolve_sys(), QSQLite2Driver::rollbackTransaction(), SequentialAnchorData::SequentialAnchorData(), Graph< AnchorVertex, AnchorData >::serializeToDot(), QWSServer::setDefaultKeyboard(), QWSServer::setDefaultMouse(), QAction::setFont(), QAbstractButton::setIconSize(), QImage::setText(), setupDBusInterface(), QMessageBox::setWindowModality(), QGraphicsAnchorLayoutPrivate::simplifyGraph(), QHttpThreadDelegate::synchronousFinishedSlot(), Graph< AnchorVertex, AnchorData >::takeEdge(), QAccessibleItemRow::text(), QImage::text(), QTextHtmlExporter::toHtml(), AnchorVertex::toString(), QSimplexConstraint::toString(), AnchorData::toString(), GraphPath::toString(), QWSSoundServerClient::tryReadCommand(), QFontEngineFTRawFont::updateFamilyNameAndStyle(), and QAbstractSpinBoxPrivate::variantCompare().
|
staticprivate |
Definition at line 4155 of file qstring.cpp.
Referenced by fromAscii().
|
static |
Returns a QString initialized with the first size characters of the Latin-1 string str.
If size is -1 (default), it is taken to be qstrlen(str).
Definition at line 4188 of file qstring.cpp.
Referenced by QUnixPrintWidgetPrivate::_q_btnBrowseClicked(), QScriptDebuggerPrivate::_q_continue(), QScriptDebuggerPrivate::_q_interrupt(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onLineEntered(), QFtpPrivate::_q_piError(), QUnixPrintWidgetPrivate::_q_printerChanged(), QHttpPrivate::_q_slotError(), QHttpPrivate::_q_slotSendRequest(), QScriptDebuggerPrivate::_q_stepInto(), QScriptDebuggerPrivate::_q_stepOut(), QScriptDebuggerPrivate::_q_stepOver(), QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), QAccessibleObject::actionText(), QFontDatabasePrivate::addAppFont(), QZipStreamStrategy::addFile(), QFontDatabasePrivate::addFont(), addKey(), QLocalServerPrivate::addListener(), QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), QPatternist::NamePool::allocateBinding(), QPatternist::NamePool::allocateQName(), QSslCertificate::alternateSubjectNames(), RequestAnalyzer::analyze(), QDBusMarshaller::append(), QPSQLDriverPrivate::appendTables(), QDBusMarshaller::appendVariantInternal(), QCoreApplication::applicationFilePath(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QScriptDebuggerBackend::attachTo(), QStyleSheetStyleSelector::attribute(), QPatternist::AxisStep::axisName(), QDBusMarshaller::beginArray(), QDBusMarshaller::beginMap(), breakpointDataFromScriptValue(), breakpointDataToScriptValue(), QLibraryInfo::buildDate(), QLibraryInfo::buildKey(), bulletChar(), QNetworkAccessAuthenticationManager::cacheCredentials(), QDeclarativeObjectMethodScriptClass::callOverloaded(), QDeclarativeObjectMethodScriptClass::callPrecise(), QScript::callQtMethod(), QUrlPrivate::canonicalHost(), QScriptObjectSnapshot::capture(), QDir::cdUp(), QDBusUtil::checkBusName(), QDBusUtil::checkErrorName(), checkHRESULT(), QDBusUtil::checkInterfaceName(), QDBusUtil::checkMemberName(), QDBusUtil::checkObjectPath(), QCoreApplicationPrivate::checkReceiverThread(), QAxFactory::classID(), classIDL(), QBenchmarkValgrindUtils::cleanup(), QPatternist::ColorOutput::colorify(), QGLShaderPrivate::compile(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QDirectFBScreen::connect(), consoleCommandGroupDataToScriptValue(), consoleCommandToScriptValue(), QScriptDebuggerConsole::consumeInput(), contextInfoToScriptValue(), QScriptDebugger::continueAction(), convert(), convertFlags(), QMacPasteboardMimeVCard::convertFromMime(), QLatin1Codec::convertToUnicode(), QIconvCodec::convertToUnicode(), QLatin15Codec::convertToUnicode(), convertTypes(), QPatternist::XsdSchemaParserContext::createAnonymousName(), createInterfaces(), QScriptDebuggerConsolePrivate::createJob(), QDBusMetaObject::createMetaObject(), QDirectFBScreenPrivate::createPixmapData(), createReadHandlerHelper(), QDBusArgumentPrivate::createSignature(), QOutputStrategy::createUniqueImageName(), QLocale::currencySymbol(), QScriptDebuggerStackModel::data(), QPSQLResult::data(), QScriptDebuggerLocalsModel::data(), QScriptDebuggerScriptsModel::data(), QScriptBreakpointsModel::data(), QGraphicsSceneBspTree::debug(), QScriptDebuggerPrivate::debuggerEvent(), debuggerResponseToScriptValue(), debuggerScriptValuePropertyFromScriptValue(), debuggerScriptValuePropertyToScriptValue(), decodeMSG(), QKeySequencePrivate::decodeString(), QBBEngine::defaultConfiguration(), QFont::defaultFamily(), QScript::QObjectDelegate::deleteProperty(), QPatternist::Expression::description(), QScriptDebuggerBackend::detach(), QPSQLDriverPrivate::detectBackslashEscape(), QPatternist::LocalNameTest::displayName(), QBBEngine::doRequestUpdate(), QLocalePrivate::doubleToString(), QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QPlastiqueStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QStyleHelper::drawDial(), drawEllipse_midpoint_i(), QWindowsVistaStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QTextHtmlExporter::emitBlock(), QTextHtmlExporter::emitFragment(), QKeySequencePrivate::encodeString(), QPatternist::DerivedString< TypeToken >::error(), QRegExp::errorString(), QEgl::errorString(), QXmlDefaultHandler::errorString(), QAxFactory::eventsID(), QPSQLResult::exec(), QPicture::exec(), QScriptDebuggerCommandExecutor::execute(), QScript::QtFunction::execute(), QScript::QMetaObjectWrapperObject::execute(), QAxFactory::exposeToSuperClass(), QScriptEdit::extraAreaPaintEvent(), QGtkStylePrivate::extract_filter(), extractEncodingDecl(), fallbackTheme(), fbname(), QTextStreamPrivate::fillReadBuffer(), QImageTextureGlyphCache::fillTexture(), QScriptDebugger::findInScriptAction(), QGLEngineSharedShaders::findProgramInCache(), QDBusMetaObjectGenerator::findType(), flagCheck(), fontExists(), QTextEditMimeData::formats(), QDB2Driver::formatValue(), QFont::freetypeFace(), QUrl::fromAce(), QNetworkHeadersPrivate::fromHttpDate(), QPatternist::HexBinary::fromLexical(), fromLocal8Bit(), QHostInfoAgent::fromName(), QUrl::fromPunycode(), QScript::functionConnect(), QScript::functionDisconnect(), QScript::functionQsTranslate(), QAxScript::functions(), QSvgPaintEnginePrivate::generateGradientName(), generateInterfaceXml(), generateSubObjectXml(), QScriptDebuggerLocalsModelPrivate::get(), QXmlStreamReaderPrivate::getChar_helper(), QStyleSheetStyle::getDefaultStyleSheet(), QBenchmarkValgrindUtils::getNewestFileName(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertyNames(), QScript::QObjectDelegate::getOwnPropertySlot(), QTextStreamPrivate::getReal(), QGtkStylePrivate::getThemeFont(), QFileIconProviderPrivate::getWinIcon(), QApplicationPrivate::globalEventProcessor(), QBBVirtualKeyboardPps::handleKeyboardInfoMessage(), QPatternist::ColoringMessageHandler::handleMessage(), QDBusConnectionPrivate::handleObjectCall(), QScriptToolTipJob::handleResponse(), QScriptDebuggerShowLineJob::handleResponse(), QAxFactory::hasStockEvents(), if(), imageReadMimeFormats(), imageWriteMimeFormats(), QScriptEngine::importExtension(), QScriptDebuggerLocalsModel::init(), QPrintPreviewDialogPrivate::init(), init_platform(), initFontSubst(), QImageReaderPrivate::initHandler(), QTextHtmlParserNode::initializeProperties(), QApplicationPrivate::initializeWidgetPaletteHash(), QWaylandInputDevice::inputHandleKey(), QDeclarativeDebugServer::instance(), int2string(), QAxFactory::interfaceID(), interfaceNotFoundError(), QAxBase::internalInvoke(), QScriptDebugger::interruptAction(), QAxServerBase::Invoke(), isDirPath(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QLibraryPrivate::isPlugin(), QSslCertificate::issuerInfo(), QTextList::itemText(), jump(), QMessageBox::keyPressEvent(), QTextCodecPlugin::keys(), QMetaEnum::keysToValue(), QObject::killTimer(), QFont::lastResortFamily(), QFont::lastResortFont(), launch(), libraryPathList(), QCoreApplication::libraryPaths(), QLibraryInfo::licensedProducts(), QGLShaderProgram::link(), QTranslator::load(), QAxServerBase::Load(), QLibraryPrivate::load_sys(), QFontDatabase::loadXlfd(), QSystemTrayIconSys::locateSystemTray(), QPatternist::ReportContext::lookupSourceLocation(), lsOpen(), QLineControl::maskString(), QScriptErrorLogWidget::message(), QXlibMime::mimeAtomToString(), QXlibMime::mimeConvertToFormat(), QXlibMime::mimeDataForAtom(), QTest::mouseEvent(), QPatternist::NamePool::NamePool(), QStyleSheetStyleSelector::nodeNames(), QPSQLResult::numRowsAffected(), QWaylandClipboard::offer(), QAxEventSink::OnChanged(), QBBInputContext::onSetComposingRegion(), QOCIDriver::open(), QDB2Driver::open(), QAudioInputPrivate::open(), QAudioOutputPrivate::open(), QWSServer::openKeyboard(), QWSServer::openMouse(), operator<<(), operator=(), operator>>(), QBenchmarkValgrindUtils::outFileBase(), QTest::outputMessage(), QStaticTextPrivate::paintText(), QScriptDebuggerScriptedConsoleCommand::parse(), QDateTimeParser::parse(), QPatternist::XsdSchemaParser::parseAlternative(), QPatternist::XsdSchemaParser::parseAny(), QPatternist::XsdSchemaParser::parseAnyAttribute(), QPatternist::XsdSchemaParser::parseAppInfo(), QPatternist::XsdSchemaParser::parseAssertion(), QNlaThread::parseBlob(), QPatternist::XsdSchemaParser::parseComplexContent(), QPatternist::XsdSchemaParser::parseComplexContentExtension(), QPatternist::XsdSchemaParser::parseComplexContentRestriction(), QPatternist::XsdSchemaParser::parseDefaultOpenContent(), QFtpDTP::parseDir(), QXmlSimpleReaderPrivate::parseDoctype(), QPatternist::XsdSchemaParser::parseDocumentation(), QPatternist::XsdSchemaParser::parseEnumerationFacet(), QPatternist::XsdSchemaParser::parseField(), QPatternist::XsdSchemaParser::parseFractionDigitsFacet(), QPatternist::XsdSchemaParser::parseGlobalAttribute(), QPatternist::XsdSchemaParser::parseGlobalComplexType(), QPatternist::XsdSchemaParser::parseGlobalElement(), parseHeaderValue(), QAuthenticatorPrivate::parseHttpResponse(), QPatternist::XsdSchemaParser::parseImport(), QPatternist::XsdSchemaParser::parseInclude(), QPatternist::XsdSchemaParser::parseKeyRef(), QPatternist::XsdSchemaParser::parseLengthFacet(), QPatternist::XsdSchemaParser::parseList(), QPatternist::XsdSchemaParser::parseLocalAttribute(), QPatternist::XsdSchemaParser::parseLocalComplexType(), QPatternist::XsdSchemaParser::parseLocalElement(), QPatternist::XsdSchemaParser::parseMaxExclusiveFacet(), QPatternist::XsdSchemaParser::parseMaxInclusiveFacet(), QPatternist::XsdSchemaParser::parseMaxLengthFacet(), QPatternist::XsdSchemaParser::parseMinExclusiveFacet(), QPatternist::XsdSchemaParser::parseMinInclusiveFacet(), QPatternist::XsdSchemaParser::parseMinLengthFacet(), QPatternist::XsdSchemaParser::parseMinMaxConstraint(), QPatternist::XsdSchemaParser::parseNamedGroup(), QPatternist::XsdSchemaParser::parseNotation(), QPatternist::XsdSchemaParser::parseOpenContent(), QPatternist::XsdSchemaParser::parsePatternFacet(), QPatternist::XsdSchemaParser::parseRedefine(), QPatternist::XsdSchemaParser::parseReferredAttributeGroup(), QPatternist::XsdSchemaParser::parseReferredGroup(), QPatternist::XsdSchemaParser::parseSchema(), QPatternist::XsdSchemaParser::parseSelector(), QPatternist::XsdSchemaParser::parseSimpleContentExtension(), QPatternist::XsdSchemaParser::parseSimpleContentRestriction(), QPatternist::XsdSchemaParser::parseSimpleRestriction(), QHttpNetworkReplyPrivate::parseStatus(), parseStopNode(), QPatternist::XsdSchemaParser::parseTotalDigitsFacet(), QPatternist::XsdSchemaParser::parseUnion(), QPatternist::XsdSchemaParser::parseWhiteSpaceFacet(), QPictureIO::pictureFormat(), pixelToPoint(), QScriptBreakpointsWidgetPrivate::pixmap(), QScriptDebuggerPrivate::pixmap(), pointSize(), QScriptDebuggerAgent::positionChange(), QPSQLResult::prepare(), QTDSDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QPatternist::AccelTree::printStats(), QApplicationPrivate::process_cmdline(), QDBusAbstractInterfacePrivate::property(), propertyNotFoundError(), propertyWriteReply(), QScript::QObjectDelegate::put(), QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(), qax_docuFromName(), qax_generateDocumentation(), QSvgPaintEngine::qbrushToSvg(), qDBusGenerateMetaObjectXml(), qDBusIntrospectObject(), qDBusReplyFill(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), QDirPrivate::QDirPrivate(), qGetInterfaceType(), qGetODBCVersion(), QLinuxFbIntegration::QLinuxFbIntegration(), qMakeError(), qMakeFieldInfo(), qMakeStatement(), qmlExecuteDeferred(), QNetworkReplyDataImpl::QNetworkReplyDataImpl(), QPageSetupWidget::QPageSetupWidget(), QProgressDialog::QProgressDialog(), QRegExpValidator::QRegExpValidator(), QScriptDebuggerBackendPrivate::qsassert(), QScriptBreakpointsWidget::QScriptBreakpointsWidget(), QScriptDebuggerConsoleWidget::QScriptDebuggerConsoleWidget(), QScriptDebugOutputWidget::QScriptDebugOutputWidget(), QScriptNewBreakpointWidget::QScriptNewBreakpointWidget(), QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(), qt_clean_filter_list(), qt_error_string(), qt_eval_string(), qt_fillFontDef(), qt_getLprPrinters(), qt_guiPlatformPlugin(), qt_init(), qt_localeFromLCID(), qt_mac_applicationmenu_string(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_extract_filter(), qt_mac_menu_merge_action(), qt_message_output(), qt_parseEtcLpPrinters(), qt_pd_foreach(), qt_set_x11_resources(), qt_splitLocaleName(), qt_strip_filters(), qt_strippedText(), qt_win_extract_filter(), qt_win_filter(), qt_wince_is_pocket_pc(), qt_wince_is_smartphone(), qt_x11_set_fallback_font_family(), QtCeGetClipboard(), qTdsErrHandler(), qTdsMsgHandler(), QTest::qtest_qParseArgs(), QTextLayout::QTextLayout(), qToField(), qToStringList(), QVariantToVARIANT(), QXmlName::QXmlName(), QZipStreamStrategy::QZipStreamStrategy(), rasterFallbacksMask(), rasterFallbackWarn(), QAudioInputPrivate::read(), QTextStream::read(), read_xbm_header(), readAllProperties(), QPatternist::XsdSchemaParser::readBlockingConstraintAttribute(), MetaObjectGenerator::readClassInfo(), QPatternist::XsdSchemaParser::readDerivationConstraintAttribute(), MetaObjectGenerator::readEnumInfo(), QPatternist::XsdSchemaParser::readNameAttribute(), QPngHandlerPrivate::readPngTexts(), QPatternist::XsdSchemaParser::readXPathExpression(), QIBaseResult::record(), QPSQLDriver::record(), QNSOpenSavePanelDelegate::removeExtensions:, QSystemLibrary::resolve(), QDeclarativeVME::run(), QScriptDebugger::runToCursorAction(), QScriptDebugger::runToNewScriptAction(), QDomDocumentPrivate::saveDocument(), QSvgPaintEngine::saveGradientStops(), QScript::Lexer::scanRegExp(), QPatternist::XQueryTokenizer::scanUntil(), QLocalePrivate::scriptCode(), scriptDataFromScriptValue(), scriptDataToScriptValue(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QSqlRelationalTableModel::selectStatement(), QWaylandSelection::send(), QAbstractXmlReceiver::sendAsNode(), QDBusConnectionPrivate::sendError(), QCoreApplication::sendPostedEvents(), QDBusConnectionPrivate::sendWithReplyLocal(), QPatternist::AccelTree::sequencedTypedValue(), QUnixPrintWidgetPrivate::setCupsProperties(), QScript::Lexer::setErrorMessage(), QDeclarativeJS::Lexer::setErrorMessage(), setIntOption(), QScriptDebuggerConsoleWidget::setLineContinuationMode(), QDBusPendingCallPrivate::setMetaTypes(), QComboBoxDelegate::setSeparator(), QPatternist::XsdSchemaContext::setupBuiltinTypesFacetList(), QPatternist::XsdSchemaParserContext::setupElementDescriptions(), QPageSetupWidget::setupPrinter(), QScriptDebuggerConsole::showDebuggerInfoMessage(), QPushButton::sizeHint(), QHttpSocketEngine::slotSocketReadNotification(), sm_performSaveYourself(), QSmSocketReceiver::socketActivated(), QFtpDTP::socketReadyRead(), QPatternist::XsdSchemaChecker::sourceLocation(), QPatternist::XsdSchemaResolver::sourceLocation(), standardLibraryErrorString(), QScriptCompletionTask::start(), QXmlStreamReaderPrivate::startDocument(), QSvgHandler::startElement(), QScriptDebugger::stepIntoAction(), QScriptDebugger::stepOutAction(), QScriptDebugger::stepOverAction(), QPatternist::Base64Binary::stringValue(), QPatternist::AbstractFloat< isDouble >::stringValue(), stripTextDecl(), QGuiPlatformPlugin::styleName(), QSslCertificate::subjectInfo(), QIBaseDriver::subscribeToNotificationImplementation(), QUrl::swap(), QGuiPlatformPlugin::systemIconThemeName(), QDeclarativeCompiler::testLiteralAssignment(), QLineControl::text(), QTextHtmlExporter::toHtml(), QPatternist::Tokenizer::tokenToString(), toQAudioFormat(), QPatternist::AnyURI::toQUrl(), QBenchmarkContext::toString(), QDate::toString(), QScriptDebuggerValue::toString(), QHashableLatin1Literal::toString(), QTest::toString(), QPatternist::Decimal::toString(), QTime::toString(), QDateTime::toString(), toUnicode(), QPatternist::AtomicValue::toXDM(), QCoreApplication::translate(), translate_color(), translate_dashPattern(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), translateWSAError(), QSystemLocalePrivate::uiLanguages(), QScriptEngine::uncaughtExceptionBacktrace(), QPageSetupWidget::unitChanged(), QPatternist::NamePool::unlockedAllocateLocalName(), QIBaseDriver::unsubscribeFromNotificationImplementation(), QBBEngine::updateConfiguration(), QFactoryLoader::updateDir(), QLineControl::updateDisplayText(), QSystemLocaleData::updateLocale(), QPrintPreviewDialogPrivate::updatePageNumLabel(), ShaderEffectItem::updateShaderProgram(), QPatternist::XsdValidatingInstanceReader::validate(), QPatternist::XsdSchemaParser::validateIdAttribute(), QAxFactory::validateLicenseKey(), valueCheck(), QScript::variantProtoFuncToString(), QSettingsPrivate::variantToString(), vsprintf(), windowsErrorString(), WinMain(), QSystemLocalePrivate::winToQtFormat(), QXmlStreamWriterPrivate::write(), QTextOdfWriter::writeAll(), QTextOdfWriter::writeBlock(), QTextOdfWriter::writeBlockFormat(), QTextOdfWriter::writeCharacterFormat(), QTextOdfWriter::writeFormats(), QTextOdfWriter::writeFrame(), QTextOdfWriter::writeFrameFormat(), QPdfEnginePrivate::writeInfo(), QTextOdfWriter::writeInlineCharacter(), QTextOdfWriter::writeListFormat(), QTextOdfWriter::writeTableCellFormat(), QApplicationPrivate::x11_apply_settings(), QX11EmbedWidget::x11Event(), QXIMInputContext::x11FilterEvent(), QX11Data::xdndMimeAtomToString(), QX11Data::xdndMimeConvertToFormat(), QX11Data::xdndMimeDataForAtom(), xdndObtainData(), QDBusDefaultConnection::~QDBusDefaultConnection(), and QZipStreamStrategy::~QZipStreamStrategy().
|
staticprivate |
Definition at line 4104 of file qstring.cpp.
Referenced by fromAscii_helper(), and fromLatin1().
|
static |
Returns a QString initialized with the first size characters of the 8-bit string str.
If size is -1 (default), it is taken to be qstrlen(str).
QTextCodec::codecForLocale() is used to perform the conversion.
Definition at line 4245 of file qstring.cpp.
Referenced by QUnixPrintWidgetPrivate::_q_printerChanged(), QCoreApplication::applicationFilePath(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QApplicationPrivate::applyX11SpecificCommandLineArguments(), QCoreApplication::arguments(), QFileSystemEngine::canonicalName(), QCUPSSupport::collectMarkedOptionsHelper(), QApplicationPrivate::construct(), QWindowsMimeText::convertToMime(), QWindowsMimeURI::convertToMime(), dlIterateCallback(), QtopiaPrintEngine::end(), QZipReader::fileData(), QZipPrivate::fillFileInfo(), QPlatformFontDatabase::fontDir(), fontPath(), QHostInfoAgent::fromName(), QFileDialogPrivate::getEnvironmentVariable(), getMacLocaleName(), QGtkStylePrivate::getThemeName(), getWinLocaleName(), QTDSResult::gotoNext(), interfaceListingWin2k(), interfaceListingWinXP(), isDirPath(), QKde::kdeHome(), launchWebBrowser(), QLibraryInfo::licensee(), QAxScriptManager::load(), locale_decode(), QHostInfo::localHostName(), QLibraryInfo::location(), QXlibMime::mimeConvertToFormat(), QProcessEnvironmentPrivate::OrderedMutexLocker::OrderedMutexLocker(), parseGeometry(), QPlatformFontDatabase::populateFontDatabase(), QApplicationPrivate::process_cmdline(), QCoreApplicationPrivate::processCommandLineArguments(), qCmdLineArgs(), qdlerror(), qMakeError(), QPdfBaseEngine::QPdfBaseEngine(), QRuntimeGraphicsSystem::QRuntimeGraphicsSystem(), qt_create_commandline(), qt_error_string(), qt_getLprPrinters(), qt_guiPlatformPlugin(), qt_init(), qt_parseEtcLpPrinters(), qt_parsePrintcap(), qt_parsePrintersConf(), qt_parseSpoolInterface(), qt_set_qws_resources(), qt_set_x11_resources(), qt_tildeExpansion(), qt_wstate_iconified(), QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(), qWinMsgHandler(), qwsFontPath(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QXlibDisplay::QXlibDisplay(), QWSCalibratedMouseHandler::readCalibration(), QPSQLResult::record(), QXIMInputContext::reset(), QPageSetupWidget::selectPrinter(), QPPDOptionsEditor::setEditorData(), QSmSocketReceiver::socketActivated(), standardLibraryErrorString(), QProcessPrivate::startDetached(), QProcessPrivate::startProcess(), QApplication::style(), QProcess::systemEnvironment(), QCUPSSupport::tempFd(), timeZone(), translateWSAError(), QWSCalibratedMouseHandler::writeCalibration(), QX11Data::xdndMimeConvertToFormat(), and xic_draw_callback().
Constructs a QString that uses the first size Unicode characters in the array unicode.
The data in unicode is not copied. The caller must be able to guarantee that unicode will not be deleted or modified as long as the QString (or an unmodified copy of it) exists.
Any attempts to modify the QString or copies of it will cause it to create a deep copy of the data, ensuring that the raw data isn't modified.
Here's an example of how we can use a QRegExp on raw data in memory without requiring to copy the data into a QString:
Definition at line 7673 of file qstring.cpp.
Referenced by QFontMetrics::charWidth(), QSvgPaintEngine::drawTextItem(), QRasterPaintEngine::drawTextItem(), getLocaleData(), getLocaleListData(), QDeclarativeExpressionPrivate::init(), launchWebBrowser(), QDeclarativeVMEMetaObject::method(), QXlibMime::mimeConvertToFormat(), QDeclarativeCompiledBindingsPrivate::run(), setRawData(), QTextBlock::text(), XsdSchemaToken::toString(), QPatternist::XSLTTokenLookup::toString(), and QX11Data::xdndMimeConvertToFormat().
|
inlinestatic |
Returns a copy of the str string.
The given string is converted to Unicode using the fromAscii() function.
This constructor is only available if Qt is configured with STL compatibility enabled.
Definition at line 1047 of file qstring.h.
|
inlinestatic |
Returns a copy of the str string.
The given string is assumed to be encoded in utf16 if the size of wchar_t is 2 bytes (e.g. on windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix systems).
This method is only available if Qt is configured with STL compatibility enabled.
Definition at line 1065 of file qstring.h.
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646-UCS-4 encoded).
If size is -1 (default), unicode must be terminated with a 0.
Definition at line 4356 of file qstring.cpp.
Referenced by fromSQLTCHAR(), fromWCharArray(), QFontMetrics::inFontUcs4(), QFontMetricsF::inFontUcs4(), and QXmlStreamReaderPrivate::parse().
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646-UTF-16 encoded).
If size is -1 (default), unicode must be terminated with a 0.
This function checks for a Byte Order Mark (BOM). If it is missing, host byte order is assumed.
This function is slow compared to the other Unicode conversions. Use QString(const QChar *, int) or QString(const QChar *) if possible.
QString makes a deep copy of the Unicode data.
Definition at line 4329 of file qstring.cpp.
Referenced by QChar::decomposition(), fromSQLTCHAR(), fromWCharArray(), launchWebBrowser(), QNlaThread::parseQuerySet(), and qMakeError().
|
static |
Returns a QString initialized with the first size bytes of the UTF-8 string str.
If size is -1 (default), it is taken to be qstrlen(str).
UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QString. However, invalid sequences are possible with UTF-8 and, if any such are found, they will be replaced with one or more "replacement characters", or suppressed. These include non-Unicode sequences, non-characters, overlong sequences or surrogate codepoints encoded into UTF-8.
Non-characters are codepoints that the Unicode standard reserves and must not be used in text interchange. They are the last two codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF, inclusive.
Definition at line 4302 of file qstring.cpp.
Referenced by QDeclarativeVisualDataModel::_q_itemsChanged(), _q_mapFromX509Name(), QDBusServer::address(), QDeclarativePropertyCache::append(), QDeclarativeCompiler::buildBinding(), QDeclarativeCompiler::buildGroupedProperty(), QDeclarativeCompiler::buildObject(), QDeclarativeCompiler::buildProperty(), QDeclarativeCompiler::buildPropertyObjectAssignment(), QDeclarativeCompiler::buildPropertyOnAssignment(), QDeclarativeCompiler::buildSignal(), QDeclarativeCompiler::buildValueTypeProperty(), cacheForNamespace(), QDeclarativeObjectMethodScriptClass::callOverloaded(), QDeclarativeCompiler::checkDynamicMeta(), QODBCDriver::cleanup(), QPrintDialogPrivate::closeCarbonPrintPanel(), QDeclarativeGestureAreaParser::compile(), QDeclarativeConnectionsParser::compile(), QDeclarativePropertyChangesParser::compile(), QDeclarativeListModelParser::compile(), containsTLDEntry(), Maemo::convertKey(), QMacPasteboardMimeAny::convertToMime(), QWindowsMimeHtml::convertToMime(), Maemo::convertValue(), QDeclarativePropertyCache::create(), QDeclarativeEnginePrivate::createCache(), QPatternist::ExpressionFactory::createExpression(), QDBusMarshaller::currentSignature(), QDBusDemarshaller::currentSignature(), QPSQLResult::data(), QDeclarativeScriptData::dataReceived(), QDeclarativeQmldirData::dataReceived(), QDeclarativeCompiler::deferredProperties(), QDeclarativeXMLHttpRequest::downloadProgress(), QDeclarativeXMLHttpRequest::error(), QXmlQuery::evaluateTo(), QFontEngineQPA::extractHeaderField(), QFontEngineQPF::extractHeaderField(), QFontconfigDatabase::fallbacksForFamily(), QSQLite2ResultPrivate::fetchNext(), QDeclarativeImportsPrivate::find(), QDeclarativeImportedNamespace::find_helper(), QDeclarativeInclude::finished(), QDeclarativeXMLHttpRequest::finished(), QDBusMessagePrivate::fromDBusMessage(), fromPercentEncodingHelper(), fromPercentEncodingMutable(), fromSQLTCHAR(), QFreetypeFace::getFace(), QGtkStylePrivate::getFilesystemIcon(), getFullPath(), QGtkStylePrivate::getGConfString(), getIBaseError(), QGtkStylePrivate::getIconThemeName(), Maemo::getVariantFromDBusMessage(), QApplicationPrivate::globalAppleEventProcessor(), QIBaseResult::gotoNext(), QDeclarativeXMLHttpRequest::header(), QDeclarativeXMLHttpRequest::headers(), QTextHtmlParser::importStyleSheet(), QDeclarativeInclude::include(), QDeclarativeCompiler::indexOfProperty(), QDeclarativeCompiler::indexOfSignal(), QFontEngineFT::init(), initializeDb(), QDeclarativeVisualDataModelPartsMetaObject::initialValue(), QTextControl::insertFromMimeData(), QSslCertificatePrivate::isBlacklisted(), QDeclarativeVisualDataModel::item(), launchWebBrowser(), QLibraryPrivate::load_sys(), loadFontConfig(), locale_decode(), macQuoteString(), QXlibMime::mimeConvertToFormat(), QBBClipboard::MimeData::MimeData(), QXlibMime::mimeDataForAtom(), QDeclarativeProperty::name(), QDeclarativePropertyCache::Data::name(), QDeclarativeEngineDebugService::objectData(), QDeclarativeDebugService::objectToString(), QGtkStylePrivate::openDirectory(), QGtkStylePrivate::openFilename(), QGtkStylePrivate::openFilenames(), QDeclarativeRewrite::RewriteBinding::operator()(), QDeclarativeDirParser::parse(), QNetworkCookiePrivate::parseSetCookieHeaderLine(), QFontconfigDatabase::populateFontDatabase(), QDBusConnectionPrivate::prepareHook(), QSvgHandler::processingInstruction(), QDeclarativeWorkerScriptEnginePrivate::processLoad(), QDBusAbstractInterfacePrivate::property(), QDeclarativePropertyMapMetaObject::propertyCreated(), QDeclarativeEngineDebugService::propertyData(), QDeclarativeObjectScriptClass::propertyNames(), QDeclarativePropertyMapMetaObject::propertyWritten(), ModelNodeMetaObject::propertyWritten(), QDBusError::QDBusError(), qDBusGenerateMetaObjectXml(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qGetStringData(), qMakeError(), qMakeFieldInfo(), QScript::qobjectProtoFuncToString(), QScriptDebuggerCodeFinderWidget::QScriptDebuggerCodeFinderWidget(), QScriptNewBreakpointWidget::QScriptNewBreakpointWidget(), qStringFromNSString(), qt_FcPatternToQFontDef(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qWarnODBCHandle(), QXcbScreen::QXcbScreen(), readArrayBuffer(), QPngHandlerPrivate::readPngTexts(), QPSQLResult::record(), registerComponent(), registerFont(), QDeclarativeXMLHttpRequest::requestFromUrl(), QDeclarativeImports::resolveType(), QDeclarativeXMLHttpRequest::responseBody(), QDeclarativeRewrite::RewriteBinding::rewrite(), QGtkStylePrivate::saveFilename(), QCoreApplication::sendPostedEvents(), QJSDebuggerAgent::setBreakpoints(), QDBusConnectionPrivate::setConnection(), QDeclarativeListModelParser::setCustomData(), QDeclarativeEngineDebugService::setMethodBody(), QDBusAbstractInterfacePrivate::setProperty(), QProcessPrivate::startProcess(), QNetworkProxyFactory::systemProxyForQuery(), QDeclarativeCompiler::testLiteralAssignment(), QDeclarativeCompiler::testQualifiedEnumAssignment(), QDBusDemarshaller::toObjectPathUnchecked(), QDBusDemarshaller::toSignatureUnchecked(), QDeclarativeObjectScriptClass::tostring(), QDBusDemarshaller::toStringUnchecked(), toUrl(), QCoreApplication::translate(), Maemo::IAPConfPrivate::valueToVariant(), vsprintf(), QDeclarativeInclude::worker_include(), QDeclarativePropertyPrivate::write(), QFontDatabase::writingSystemSample(), QX11Data::xdndMimeConvertToFormat(), QX11Data::xdndMimeDataForAtom(), QCoreApplicationData::~QCoreApplicationData(), and QDeclarativeInfo::~QDeclarativeInfo().
|
static |
Returns a copy of the string, where the encoding of string depends on the size of wchar.
If wchar is 4 bytes, the string is interpreted as ucs-4, if wchar is 2 bytes it is interpreted as ucs-2.
If size is -1 (default), the string has to be 0 terminated.
Definition at line 1019 of file qstring.cpp.
Referenced by QAxClientSite::activateObject(), QFileSystemModelPrivate::addNode(), QWindowsMime::allMimesForFormats(), QSystemLocalePrivate::amText(), QCoreApplication::arguments(), checkHRESULT(), childKeysOrGroups(), QNativeWifiEngine::connectToId(), ControlList::ControlList(), QWindowsMimeText::convertToMime(), QWindowsMimeURI::convertToMime(), QBuiltInMimes::convertToMime(), QClassFactory::CreateInstanceLic(), QSystemLocalePrivate::currencySymbol(), QWin32PrintEngine::drawTextItem(), DumpIDL(), errorCodeToString(), expandEnvStrings(), QAxEventSink::findProperty(), QSystemLocalePrivate::firstDayOfWeek(), fromStdWString(), QFontEngineWin::getCMap(), QOleDataObject::GetData(), QNativeWifiEngine::getInterfaceFromId(), QAxScriptSite::GetItemInfo(), QSystemLocalePrivate::getLocaleInfo(), QNativeWifiEngine::hasIdentifier(), IFontToQFont(), QWindowsSystemProxy::init(), initFontInfo(), QAxBase::initializeLicensedHelper(), interfaceListingWinXP(), QAxServerBase::Invoke(), isDirPath(), launchWebBrowser(), QSystemLibrary::load(), QAxServerBase::Load(), loadEngine(), QFSFileEnginePrivate::longFileName(), QSystemLocalePrivate::measurementSystem(), menuItemEntry(), MetaObjectGenerator::metaObject(), MetaObjectGenerator::MetaObjectGenerator(), QLastResortMimes::mimeForFormat(), QFileSystemEngine::nativeAbsoluteFilePath(), QFileSystemModelPrivate::node(), QAxServerBase::OnAmbientPropertyChange(), QBBInputContext::onCommitText(), QAxScriptSite::OnScriptError(), QAxScriptSite::OnScriptTerminate(), QBBInputContext::onSetComposingText(), QFileSystemEngine::owner(), QNlaThread::parseQuerySet(), QSystemLocalePrivate::pmText(), QFontEngineWin::properties(), qAppFileName(), qax_docuFromName(), qax_readClassInfo(), qax_readInterfaceInfo(), qAxInit(), qCmdLineArgs(), QSessionManager::QSessionManager(), QSystemLibrary::QSystemLibrary(), qt_CoCreateGuid(), qt_create_commandline(), qt_error_string(), qt_LOGFONTtoQFont(), QAxClientSite::qt_metacall(), qt_reg_winclass(), qt_win_get_existing_directory(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), QtCeGetClipboard(), QtWndProc(), QWin32PrintEnginePrivate::queryDefault(), qWinCmdArgs(), QtPropertyBag::Read(), QWin32PrintEnginePrivate::readDevnames(), MetaObjectGenerator::readEnumInfo(), MetaObjectGenerator::readEventInterface(), MetaObjectGenerator::readFuncsInfo(), QWinSettingsPrivate::readKey(), readLink(), readSymLink(), MetaObjectGenerator::readVarsInfo(), QAxFactory::registerActiveObject(), registerFont(), QAxServerBase::Save(), QAxServerBase::SaveCompleted(), QNativeWifiEngine::scanComplete(), QAxFactory::serverDirPath(), QAxFactory::serverFilePath(), storeFont(), timeZone(), QSystemLocalePrivate::toCurrencyString(), QSystemLocalePrivate::toString(), QDateTime::toString(), QSystemLocalePrivate::uiLanguages(), QFileSystemEngine::uncListSharesOnServer(), UpdateRegistry(), MetaObjectGenerator::usertypeToString(), QAxFactory::validateLicenseKey(), VARIANTToQVariant(), QAxBase::verbs(), windowsConfigPath(), windowsErrorString(), winGetExistDirCallbackProc(), winIso3116CtryName(), winIso639LangName(), WinMain(), and QtPropertyBag::Write().
|
staticprivate |
Definition at line 822 of file qstring.cpp.
Referenced by append(), and resize().
int QString::indexOf | ( | QChar | c, |
int | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 2838 of file qstring.cpp.
Referenced by _q_parseUnixDir(), QHttpPrivate::_q_slotReadyRead(), QDeclarativePropertyCache::append(), QKeySequence::assign(), QDeclarativeEngineDebugService::buildObjectDump(), QTextEngine::calculateTabWidth(), QDBusAbstractInterface::callWithArgumentList(), QDir::cd(), QVNCScreen::connect(), QTransformedScreen::connect(), QLinuxFbIntegration::connect(), contains(), QHttpHeader::contentType(), QPatternist::XsdInstanceReader::convertToQName(), QPatternist::XsdTypeChecker::convertToQName(), QDeclarativePropertyCache::create(), QFileSystemEngine::createDirectory(), QScriptDebuggerConsolePrivate::createJob(), QDeclarativeComponentPrivate::createObject(), QScriptDebuggerLocalsModel::data(), QKeySequencePrivate::decodeString(), double2string(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QItemDelegate::drawDisplay(), QFontMetrics::elidedText(), QFontMetricsF::elidedText(), QConfFileSettingsPrivate::ensureSectionParsed(), QPatternist::SubstringBeforeFN::evaluateSingleton(), QSymSQLResult::exec(), QSqlResult::exec(), extractEncodingDecl(), QDateTimeParser::findAmPm(), findChildObject(), QFontDatabase::findFont(), findObject(), fixedCDataSection(), fixedComment(), fixedPIData(), fixedPubidLiteral(), fixedSystemLiteral(), QMacPasteboardMimeUnicodeText::flavorFor(), fontPath(), fractionDigitsForDecimal(), QPatternist::NamePool::fromClarkName(), QUrl::fromLocalFile(), QDir::fromNativeSeparators(), QSslCertificate::fromPath(), QDateTime::fromString(), QUrl::fromUserInput(), QDirPrivate::getFilterSepChar(), getStringTok(), QImageReaderPrivate::getText(), QGtkStylePrivate::getThemeName(), QScriptToolTipJob::handleResponse(), QByteArray::indexOf(), QSvgSwitch::init(), QAxBase::initializeRemote(), QMenu::initStyleOption(), QDeclarativeDebugServer::instance(), QAxServerBase::Invoke(), isDirPath(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QSslSocketBackendPrivate::isMatchingHostname(), isUncRoot(), QDBusUtil::isValidObjectPath(), QMenuBar::keyPressEvent(), QMenu::keyPressEvent(), QByteArray::lastIndexOf(), launchWebBrowser(), QAxServerBase::Load(), QLibraryPrivate::load_sys(), Qt::mightBeRichText(), QKeySequence::mnemonic(), QDeclarativePropertyCache::Data::name(), QSqlRelationalTableModelPrivate::nameToIndex(), QWSServerPrivate::newMouseHandler(), QDeclarativeEngineDebugService::objectData(), QAudioDeviceInfoInternal::open(), QWSServer::openKeyboard(), QStringRef::operator=(), QDeclarativeDirParser::parse(), QHttpHeader::parse(), parseFontName(), QLineControl::parseInputMask(), QHttpHeader::parseLine(), QHttpResponseHeader::parseLine(), parseServerList(), QHostAddress::parseSubnet(), QDeclarativeStringConverters::pointFFromString(), QApplicationPrivate::process_cmdline(), QSettingsPrivate::processChild(), QFtpPI::processReply(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qExtractSecurityPolicyFromString(), qGetTableInfo(), qIsEffectiveTLD(), QMacSettingsPrivate::QMacSettingsPrivate(), qSplitTableAndOwner(), qSplitTableName(), qt_accAmpIndex(), qt_get_screen(), qt_mac_menu_merge_action(), qt_make_filter_list(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_parseQconfig(), qt_parseSpoolInterface(), qt_set_x11_resources(), qt_setWindowTitle_helperHelper(), qt_split_namespace(), qt_splitLocaleName(), qt_win_get_save_file_name(), QTextHtmlImporter::QTextHtmlImporter(), quotedValue(), QXmlStreamAttribute::QXmlStreamAttribute(), QDeclarativeStringConverters::rectFFromString(), registerFont(), remove(), QInternalMimeData::renderDataHelper(), replacePercentN(), QDeclarativeXMLHttpRequest::requestFromUrl(), QAxServerBase::Save(), QPatternist::XQueryTokenizer::scanUntil(), QAxScriptManager::scriptForFunction(), set_text(), QUrlPrivate::setAuthority(), QAxBase::setControl(), QTextBrowserPrivate::setSource(), QUndoCommand::setText(), QGtkStylePrivate::setupGtkFileChooser(), QUrl::setUrl(), QUrlPrivate::setUserInfo(), QDeclarativeStringConverters::sizeFFromString(), QFileSystemEngine::slowCanonicalized(), split(), QXmlNamespaceSupport::splitName(), splitSpaceSemicolon(), QAudioDeviceInfoInternal::testSettings(), QImage::textLanguages(), QImage::textList(), QPatternist::XQueryTokenizer::tokenizeCharacterReference(), QDir::toNativeSeparators(), tryDriveUNCFallback(), QMenuPrivate::updateActionRects(), QAuthenticatorPrivate::updateCredentials(), QDeclarativeStringConverters::vector3DFromString(), QFontMetrics::width(), QFontMetricsF::width(), xdndObtainData(), and QDeclarativeInfo::~QDeclarativeInfo().
int QString::indexOf | ( | const QString & | str, |
int | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from.
Returns -1 if str is not found.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Example:
If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.
Definition at line 2721 of file qstring.cpp.
int QString::indexOf | ( | const QLatin1String & | str, |
int | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Example:
If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.
Definition at line 2748 of file qstring.cpp.
int QString::indexOf | ( | const QStringRef & | s, |
int | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 2858 of file qstring.cpp.
int QString::indexOf | ( | const QRegExp & | rx, |
int | from = 0 |
||
) | const |
Definition at line 3342 of file qstring.cpp.
int QString::indexOf | ( | QRegExp & | rx, |
int | from = 0 |
||
) | const |
Definition at line 3366 of file qstring.cpp.
Definition at line 1671 of file qstring.cpp.
Referenced by QWizardPrivate::_q_handleFieldObjectDestroyed(), QScriptDebuggerLocalsWidgetPrivate::_q_insertCompletion(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QXmlStreamPrivateTagStack::addToStringStorage(), QCss::StyleSheet::buildIndexes(), decimalForm(), QPatternist::LocalNameTest::displayName(), QPatternist::QNameTest::displayName(), exponentForm(), QTest::formatResult(), QUrl::fromPunycode(), insert(), QByteArray::insert(), QDomCharacterDataPrivate::insertData(), QAccessibleSimpleEditableTextInterface::insertText(), int2string(), QLineControl::internalInsert(), QLineControl::internalRedo(), QLineControl::internalUndo(), launchWebBrowser(), QLibraryPrivate::load_sys(), QLocalePrivate::longLongToString(), QDateTimeParser::parseSection(), QAccessibleSimpleEditableTextInterface::pasteText(), QDateTimeParser::potentialValue(), qDateTimeFromString(), qt_create_commandline(), QXmlStreamReader::readElementText(), toPunycodeHelper(), AnchorVertex::toString(), QLocalePrivate::unsLongLongToString(), and QTextEngine::validate().
Definition at line 1638 of file qstring.cpp.
QString & QString::insert | ( | int | i, |
const QLatin1String & | s | ||
) |
Definition at line 1616 of file qstring.cpp.
|
inline |
|
inline |
Returns true if the string has no characters; otherwise returns false.
Example:
Definition at line 704 of file qstring.h.
Referenced by QTextBrowserPrivate::_q_activateAnchor(), QUnixPrintWidgetPrivate::_q_btnBrowseClicked(), QTextBrowserPrivate::_q_documentModified(), QComboBoxPrivate::_q_editingFinished(), QFileDialogPrivate::_q_enterDirectory(), _q_escapeIdentifier(), QFileSystemModelPrivate::_q_fileSystemChanged(), QFileDialogPrivate::_q_goToDirectory(), QTextBrowserPrivate::_q_highlightLink(), QLabelPrivate::_q_linkHovered(), QProcessPrivate::_q_notified(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerPrivate::_q_onFindCodeRequest(), QPrintPreviewDialogPrivate::_q_print(), QUnixPrintWidgetPrivate::_q_printerChanged(), QPrintDialogPrivate::_q_printerOrFileSelected(), QComboBoxPrivate::_q_returnPressed(), QLineEditPrivate::_q_selectionChanged(), QFileDialogPrivate::_q_selectionChanged(), QHttpPrivate::_q_slotReadyRead(), QHttpPrivate::_q_slotSendRequest(), QScriptDebuggerCodeFinderWidgetPrivate::_q_updateButtons(), QFileDialogPrivate::_q_updateOkButton(), QFileDialogPrivate::_q_useNameFilter(), QFtpPI::abort(), QMessageBox::aboutQt(), QDir::absoluteFilePath(), QDeclarativeTypeLoader::absoluteFilePath(), QMenuPrivate::activateAction(), QDBusConnectionPrivate::activateInternalFilters(), QTextControlPrivate::activateLinkUnderCursor(), QDBusConnectionPrivate::activateObject(), QSettingsPrivate::actualKey(), QDeclarativeImportsPrivate::add(), QFontDatabasePrivate::addAppFont(), QScriptDebuggerConsoleCommandManager::addCommand(), QScriptDebuggerConsoleCommandManager::addCommandGroup(), QIcdEngine::addConfiguration(), QFileDialogPrivate::addDefaultSuffixToFiles(), QSvgIconEngine::addFile(), QIcon::addFile(), QPixmapIconEngine::addFile(), addFontToDatabase(), QDeclarativeContextData::addImportedScript(), QDeclarativeImportDatabase::addImportPath(), addKey(), QCoreApplication::addLibraryPath(), QFileSystemModelPrivate::addNode(), QFileSystemWatcher::addPath(), QFontDatabasePrivate::addQPF2File(), QHttpPrivate::addRequest(), QDir::addResourceSearchPath(), Maemo::IcdPrivate::addrinfo(), QConnmanEngine::addServiceConfiguration(), QPainterPath::addText(), allKeys(), QWindowsMime::allMimesForFormats(), QPatternist::NamePool::allocateBinding(), QPatternist::NamePool::allocateQName(), QTextControl::anchorPosition(), QCopChannel::answer(), QTextHtmlImporter::appendNodeText(), QPSQLDriverPrivate::appendTables(), QCoreApplication::applicationFilePath(), QTextHtmlParser::applyAttributes(), QTextHtmlParserNode::applyBackgroundImage(), QTextHtmlParserNode::applyCssDeclarations(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QApplicationPrivate::appName(), QDeclarativeParser::Variant::asScript(), QSvgStyleSelector::attribute(), QAccessibleTextWidget::attributes(), QNetworkAccessManagerPrivate::authenticationRequired(), QUrlPrivate::authority(), QAuthDevice::authorizeMessage(), QTransportAuth::authorizeRequest(), QCss::StyleSelector::basicSelectorMatches(), QSettingsPrivate::beginGroupOrArray(), bestStyle(), QFontDatabase::bold(), QPainter::boundingRect(), QSvgGradientStyle::brush(), QDeclarativeCompiler::buildDynamicMeta(), QCss::StyleSheet::buildIndexes(), buildMatchRule(), QDeclarativeCompiler::buildSignal(), QNetworkManagerEngine::bytesReceived(), QNetworkManagerEngine::bytesWritten(), QNetworkAccessAuthenticationManager::cacheCredentials(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), QMenuBarPrivate::calcActionRects(), QAuthenticatorPrivate::calculateResponse(), QWindowsMimeURI::canConvertFromMime(), QWindowsMimeHtml::canConvertFromMime(), QTextControl::canInsertFromMimeData(), QDBusAbstractInterfacePrivate::canMakeCalls(), QUrlPrivate::canonicalHost(), QDir::cd(), QDomHandler::characters(), QDBusUtil::checkBusName(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QDBusUtil::checkErrorName(), checkHRESULT(), checkIfValid(), QDBusUtil::checkInterfaceName(), QDBusUtil::checkMemberName(), QAbstractItemViewPrivate::checkMouseMove(), QDBusUtil::checkObjectPath(), QScript::SyntaxChecker::checkSyntax(), QDeclarativeCompiler::checkValidId(), childKeysOrGroups(), QConfFileSettingsPrivate::children(), classIDL(), QDir::cleanPath(), QBenchmarkValgrindUtils::cleanup(), clipboardData(), QPdfBaseEnginePrivate::closePrintDevice(), QPatternist::ColorOutput::colorify(), comify(), QDeclarativeCompiler::compile(), QGLShaderPrivate::compile(), QDeclarativeCompiler::compileTree(), QLineControl::complete(), QDeclarativeFolderListModel::componentComplete(), QTransformedScreen::connect(), QDirectFBScreen::connect(), QDBusConnection::connect(), QDBusConnection::connectToBus(), QCoreWlanEngine::connectToId(), QNativeWifiEngine::connectToId(), QDBusConnection::connectToPeer(), QLocalSocket::connectToServer(), constructWindowTitleFromFilePath(), QScriptDebuggerConsole::consumeInput(), QHttpHeader::contentType(), QWindowsMimeURI::convertFromMime(), QMacPasteboardMimeFileUri::convertFromMime(), QMacPasteboardMimeUrl::convertFromMime(), QScriptEnginePrivate::convertValue(), QLineControl::copy(), QPlatformIntegrationFactory::create(), QNetworkAccessFileBackendFactory::create(), QPatternist::AbstractDuration::create(), QPatternist::AbstractDateTime::create(), QSettingsPrivate::create(), QDeclarativeEnginePrivate::createComponent(), QSqlRecordPrivate::createField(), QSqlIndex::createField(), createFontNode(), QScriptDebuggerConsolePrivate::createJob(), createLinearGradientNode(), QDBusMetaObject::createMetaObject(), createPixmapDataSync(), QDeclarativeEnginePrivate::createQmlObject(), createRadialGradientNode(), createRectNode(), QUndoGroup::createRedoAction(), QUndoStack::createRedoAction(), QLabelPrivate::createStandardContextMenu(), QLineEdit::createStandardContextMenu(), createSvgNode(), QUndoGroup::createUndoAction(), QUndoStack::createUndoAction(), createUseNode(), QMessageBox::critical(), QAbstractFileEngineIterator::currentFilePath(), QNetworkSessionPrivateImpl::currentInterface(), QScriptDebuggerStackModel::data(), QPSQLResult::data(), QScriptDebuggerScriptsModel::data(), QScriptBreakpointsModel::data(), QScriptDebuggerPrivate::debuggerEvent(), QCss::StyleSelector::declarationsForNode(), decodeMSG(), QPatternist::CompressedWhitespace::decompress(), QSqlTableModel::deleteRowFromTable(), QCommandLinkButtonPrivate::descriptionHeight(), QWidget::destroy(), QLocalSocketPrivate::destroyPipeHandles(), QDeclarativeTextPrivate::determineHorizontalAlignment(), QDeclarativeTextEditPrivate::determineHorizontalAlignment(), QDeclarativeTextInputPrivate::determineHorizontalAlignment(), determineScreenSize(), QDBusConnection::disconnect(), QPatternist::NamePool::displayName(), dlIterateCallback(), do_dbus_call(), QScriptDebuggerBackend::doPendingEvaluate(), QGenericEngine::doRequestUpdate(), QIcdEngine::doRequestUpdate(), QDragManager::drag(), QSvgText::draw(), QTextDocumentLayoutPrivate::drawBlock(), QCommonStyle::drawControl(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QItemDelegate::drawDisplay(), QWindowsCEStyle::drawItemText(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QWindowsVistaStyle::drawPrimitive(), QPainter::drawStaticText(), QPainter::drawText(), QGridLayoutRowInfo::dump(), QGridLayoutEngine::dump(), QDeclarativeCompiledData::dumpInstructions(), QAxBase::dynamicCallHelper(), elliditide(), QTextHtmlExporter::emitBackgroundAttribute(), QTextHtmlExporter::emitCharFormatStyle(), QTextHtmlExporter::emitFragment(), QPSPrintEnginePrivate::emitHeader(), QTextHtmlExporter::emitTable(), QClipboardWatcher::empty(), QStringRef::endsWith(), QIconLoader::ensureInitialized(), err_info_about_objects(), QRegExpEngine::error(), QPluginLoader::errorString(), QLibrary::errorString(), QImageReader::errorString(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPatternist::QNameFN::evaluateSingleton(), QPatternist::StringJoinFN::evaluateSingleton(), QPatternist::PrefixFromQNameFN::evaluateSingleton(), QScriptDebuggerCodeView::event(), QTabBar::event(), QAxServerBase::eventFilter(), QFontDef::exactMatch(), QScriptDebuggerBackendPrivate::exception(), QDeclarativeExpressionPrivate::exceptionToError(), QSqlTableModelPrivate::exec(), QSqlQuery::exec(), QPSQLResult::exec(), QSqlDatabase::exec(), QDeclarativeStateChangeScript::execute(), QDeclarativeScriptActionPrivate::execute(), QDir::exists(), QPatternist::QNameConstructor::expandQName(), QScreen::exposeRegion(), QZipReader::extractAll(), QFontDatabase::families(), familyList(), fbname(), QNetworkAccessAuthenticationManager::fetchCachedCredentials(), QNetworkAccessAuthenticationManager::fetchCachedProxyCredentials(), QDir::filePath(), QHttpNetworkConnectionPrivate::fillPipeline(), QDeclarativeImportedNamespace::find_helper(), find_translation(), QDateTimeParser::findAmPm(), QScriptDebuggerPrivate::findCode(), QLibraryInfoPrivate::findConfiguration(), QDateTimeParser::findDay(), findEncoding(), QFontDatabase::findFont(), findGraphicsFactory(), findGroupFactory(), QSystemTrayIconSys::findIconGeometry(), QIconLoader::findIconHelper(), QDBusConnectionPrivate::findMetaObject(), QDateTimeParser::findMonth(), QXmlStreamWriterPrivate::findNamespace(), QResourceRoot::findNode(), findStyleFactoryMethod(), findStyleUtilFactoryMethod(), QSystemTrayIconSys::findTrayGeometry(), findUtilFactory(), QDomNode::firstChildElement(), fixedXmlName(), QTextStreamPrivate::flushWriteBuffer(), fmtDateTime(), QFontDatabase::font(), QPlatformFontDatabase::fontDir(), QTest::formatResult(), QMacPasteboard::formats(), QWindowsMimeHtml::formatsForMime(), QPatternist::NamePool::fromClarkName(), QPatternist::Numeric::fromLexical(), QPatternist::XsdTypeChecker::fromLexical(), QHostInfoAgent::fromName(), QSslCertificate::fromPath(), QXmlInputSource::fromRawData(), QDate::fromString(), QTime::fromString(), QFont::fromString(), QDateTime::fromString(), QUrl::fromUserInput(), QDeclarativeCompiler::genComponent(), QDeclarativeStatePrivate::generateActionList(), generateSubObjectXml(), QDeclarativeCompiler::genObject(), QDeclarativeTypeLoader::get(), QWindowsAccessible::get_accDefaultAction(), QTextStreamPrivate::getChar(), GetClassObject(), QColorDialog::getColor(), QAxServerBase::GetCurFile(), QSslSocketBackendPrivate::getErrorsFromOpenSsl(), getFamiliesAndSignatures(), getFcPattern(), QFileInfoGatherer::getFileInfos(), getFmtString(), QFontDialogPrivate::getFont(), getIBaseError(), getImage(), QFileInfoGatherer::getInfo(), QFileSystemEngine::getLinkTarget(), QSystemLocalePrivate::getLocaleInfo_qchar(), getNetworkAttrs(), QBenchmarkValgrindUtils::getNewestFileName(), QFileDialog::getOpenFileName(), QFileDialog::getOpenFileNames(), getPath(), getPixmap(), QDeclarativeTypeLoader::getQmldir(), QFileDialog::getSaveFileName(), QDeclarativeTypeLoader::getScript(), QGtkStylePrivate::getThemeFont(), QGtkStylePrivate::getThemeName(), QScanThread::getUserConfigurations(), QNetworkManagerSettingsConnection::getUuid(), QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(), QFileIconProviderPrivate::getWinIcon(), getWinLocaleName(), QSystemSemaphorePrivate::handle(), QSharedMemoryPrivate::handle(), QDBusConnectionPrivate::handleSignal(), handleStringAttribute(), QSvgStyleSelector::hasAttributes(), QDomImplementation::hasFeature(), QMacPasteboard::hasFormat(), QGraphicsScene::helpEvent(), QScriptSyntaxHighlighter::highlightBlock(), QScriptSyntaxHighlighter::highlightWord(), QTextDocumentLayout::hitTest(), QFileSystemEngine::homePath(), QNetworkInterface::humanReadableName(), QIcdEngine::icdServiceOwnerChanged(), QGuiPlatformPlugin::iconThemeSearchPaths(), QTextHtmlImporter::import(), QDeclarativeImportsPrivate::importExtension(), QScriptEngine::importExtension(), QTextHtmlParser::importStyleSheet(), QDeclarativeInclude::include(), QDirModel::index(), QMoviePrivate::infoForFrame(), QObject::inherits(), QTextEditPrivate::init(), QFontDialogPrivate::init(), QPlainTextEditPrivate::init(), QFileDialogPrivate::init(), QMessageBoxPrivate::init(), QWindowsSystemProxy::init(), QSQLiteResultPrivate::initColumns(), QGtkStylePrivate::initGtkWidgets(), QAxScriptEngine::initialize(), QSocks5SocketEnginePrivate::initialize(), QTextHtmlParserNode::initializeProperties(), QAxBase::initializeRemote(), QFileDialogPrivate::initialSelection(), QSslSocketBackendPrivate::initSslContext(), QTextControlPrivate::inputMethodEvent(), QLineEdit::inputMethodEvent(), QComboBox::inputMethodEvent(), QAbstractItemView::inputMethodEvent(), QTextCursor::insertImage(), QFormLayout::insertRow(), QSqlTableModel::insertRowIntoTable(), QTextCursor::insertText(), QPatternist::XSLTTokenizer::insideTemplate(), QDeclarativeDebugServer::instance(), QLineControl::internalSetText(), QFileSystemEntry::isAbsolute(), QFontDatabase::isBitmapScalable(), isBypassed(), isc(), QWinInputContext::isComposing(), isDirPath(), Text::isElementContentWhitespace(), QFileSystemEntry::isEmpty(), QUrl::isEmpty(), isHostExcluded(), Maemo::ProxyConfPrivate::isHostExcluded(), QLibrary::isLibrary(), QPixmapIconEngineEntry::isNull(), QUrl::isParentOf(), QLibraryPrivate::isPlugin(), QFileSystemEntry::isRelative(), QUrl::isRelative(), QTextEngine::isRightToLeft(), QDateTimeEditPrivate::isSeparatorKey(), isServerProcess(), QDBusConnectionPrivate::isServiceRegisteredByThread(), QFontDatabase::isSmoothlyScalable(), isUncRoot(), QAudioFormat::isValid(), QTgaFile::isValid(), QNetworkInterface::isValid(), QDBusUtil::isValidBusName(), QColor::isValidColor(), QDBusUtil::isValidInterfaceName(), QDBusUtil::isValidMemberName(), QPatternist::DerivedString< TypeToken >::isValidName(), QDBusUtil::isValidPartOfObjectPath(), QDBusUtil::isValidUniqueConnectionName(), QFontDatabase::italic(), QStyle::itemTextRect(), QKde::kdeHome(), QTreeView::keyboardSearch(), QAbstractItemView::keyboardSearch(), QTextBrowser::keyPressEvent(), QTextControlPrivate::keyPressEvent(), QMenuBar::keyPressEvent(), QAbstractSpinBox::keyPressEvent(), QDateTimeEdit::keyPressEvent(), QLineEdit::keyPressEvent(), QPlainTextEdit::keyPressEvent(), QComboBox::keyPressEvent(), QTextEdit::keyPressEvent(), QAbstractItemView::keyPressEvent(), QPlatformIntegrationFactory::keys(), QDomNode::lastChildElement(), QStringList::lastIndexOf(), launchWebBrowser(), QWizardPrivate::layoutInfoForCurrentPage(), QCoreApplication::libraryPaths(), QGLShaderProgram::link(), QFtp::list(), QLocalServer::listen(), QPluginLoader::load(), QTranslator::load(), QLibraryPrivate::load(), QDeclarativeBorderImage::load(), QDeclarativeAnimatedImage::load(), QAxScript::load(), QPixmap::load(), QFontDatabase::load(), QDeclarativeDataLoader::load(), QAxScriptManager::load(), QImage::load(), QAxServerBase::Load(), QLibraryPrivate::load_sys(), QSvgIconEnginePrivate::loadDataForModeAndState(), loadEngine(), QTextDocument::loadResource(), loadSingleEngine(), QFontDatabase::loadXlfd(), QHostInfo::localDomainName(), FAREnforcer::logAuthAttempt(), longestCommonPrefix(), QFSFileEnginePrivate::longFileName(), QLocalePrivate::longLongToString(), QHostInfo::lookupHost(), lsOpen(), macFormatCurrency(), macQuoteString(), makeCacheKey(), QSharedMemoryPrivate::makePlatformSafeKey(), QResourceRoot::mappingRootSubdir(), QAbstractItemModel::match(), QDirIteratorPrivate::matchesFilters(), QCompletionEngine::matchHint(), QUrlPrivate::mergePaths(), QScriptDebugOutputWidget::message(), QScriptDebuggerConsoleWidget::message(), QScriptStdMessageHandler::message(), MetaObjectGenerator::metaObject(), Qt::mightBeRichText(), QLastResortMimes::mimeForFormat(), QXlibMime::mimeStringToAtom(), QDir::mkdir(), QDir::mkpath(), QWhatsThat::mouseMoveEvent(), QTextControlPrivate::mouseReleaseEvent(), QWhatsThat::mouseReleaseEvent(), QFileSystemEngine::nativeAbsoluteFilePath(), QNetworkManagerEngine::newAccessPoint(), QTextHtmlParser::newNode(), QErrorMessagePrivate::nextPending(), QDomNode::nextSiblingElement(), QPatternist::XQueryTokenizer::nextToken(), QFileSystemModelPrivate::node(), QUrlPrivate::normalized(), QSettingsPrivate::normalizedKey(), QDBusConnection::objectRegisteredAt(), QDeclarativeDebugService::objectToString(), QDBusXmlParser::objectTree(), QNetworkAccessFileBackend::open(), QNetworkAccessFtpBackend::open(), QIBaseDriver::open(), QSQLite2Driver::open(), QSQLiteDriver::open(), QOCIDriver::open(), QDB2Driver::open(), QMYSQLDriver::open(), QPSQLDriver::open(), QODBCDriver::open(), QWSPcMouseHandlerPrivate::openDevices(), openDocument(), QWSServer::openKeyboard(), QWSServer::openMouse(), QPdfBaseEnginePrivate::openPrintDevice(), QLinuxFbIntegrationPrivate::openTty(), QLinuxFbScreenPrivate::openTty(), PvrEglScreen::openTty(), QFontDef::operator<(), operator<<(), QUrl::operator=(), QProcessPrivate::Channel::operator=(), QFontDef::operator==(), QDBusIntrospection::Interface::operator==(), operator==(), operator>(), QProcessEnvironmentPrivate::OrderedMutexLocker::OrderedMutexLocker(), QTest::outputMessage(), QPlainTextEdit::paintEvent(), QNSOpenSavePanelDelegate::panel:shouldShowFilename:, QScriptXmlParser::parse(), QDeclarativeDirParser::parse(), QScriptParser::parse(), QXmlStreamReaderPrivate::parse(), QRegExpEngine::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), QPatternist::XsdSchemaParser::parseAny(), QPatternist::XsdSchemaParser::parseAnyAttribute(), QPatternist::XsdSchemaParser::parseAppInfo(), parseBaseGradient(), parseCombinedArgString(), parseCompOp(), QNetworkManagerEngine::parseConnection(), parseCSStoXMLAttrs(), parseDateString(), QPatternist::XsdSchemaParser::parseDocumentation(), QXmlStreamReaderPrivate::parseEntity(), QPatternist::PatternPlatform::parseFlags(), parseFontFaceNameNode(), parseFontFaceNode(), QDateTimeParser::parseFormat(), parseHeaderValue(), QAuthenticatorPrivate::parseHttpResponse(), QPatternist::XsdSchemaParser::parseImport(), QLineControl::parseInputMask(), parseIp6(), QPatternist::XsdSchemaParser::parseNotation(), parseOthers(), QXmlSimpleReaderPrivate::parseProlog(), QSocks5SocketEnginePrivate::parseRequestMethodReply(), parseServerList(), QNetworkCookiePrivate::parseSetCookieHeaderLine(), QHostAddress::parseSubnet(), QPatternist::AbstractDateTime::parseZoneOffset(), QDeclarativePackage::part(), QLineControl::paste(), QFSCompleter::pathFromIndex(), QStringMatcher::pattern(), QProcessPrivate::pipeWriterBytesToWrite(), QFontDatabase::pointSizes(), populate_database(), QScriptDebuggerAgent::positionChange(), QKeyMapper::possibleKeys(), QDateTimeParser::potentialValue(), QXmlNamespaceSupport::prefix(), QXmlNamespaceSupport::prefixes(), QOCIResult::prepare(), QPSQLResult::prepare(), QSqlQuery::prepare(), QDomNode::previousSiblingElement(), QOCIDriver::primaryIndex(), QSQLite2Driver::primaryIndex(), QTDSDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QApplicationPrivate::process_cmdline(), QLineControl::processInputMethodEvent(), QPatternist::XSLTSimpleContentConstructor::processItem(), QDeclarativePixmapReader::processJob(), QLineControl::processKeyEvent(), QTextHtmlImporter::processSpecialNodes(), propertyNotFoundError(), propertyWriteReply(), proxyAuthenticationKey(), QMacStylePrivate::pushButtonSizeFromContents(), Q_GLOBAL_STATIC_WITH_ARGS(), qAppendWhereClause(), qAppFileName(), QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(), qax_docuFromName(), qax_generateDocumentation(), QAxScriptEngine::QAxScriptEngine(), QConfFileSettingsPrivate::QConfFileSettingsPrivate(), qDateFromString(), qDateTimeFromString(), QDBusAbstractInterface::QDBusAbstractInterface(), QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(), QDBusConnection::QDBusConnection(), qDBusGenerateMetaObjectXml(), qDBusIntrospectObject(), QDBusServer::QDBusServer(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qDecodeDataUrl(), QDirPrivate::QDirPrivate(), qExtractSecurityPolicyFromString(), QGraphicsTextItem::QGraphicsTextItem(), QHttpHeader::QHttpHeader(), qInit(), QMacSettingsPrivate::QMacSettingsPrivate(), qmlsqldatabase_open_sync(), QMultiInputContext::QMultiInputContext(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), QNetworkSession::QNetworkSession(), qNtlmPhase3(), QQnxMouseHandler::QQnxMouseHandler(), QRenderRule::QRenderRule(), QScriptDebuggerBackendPrivate::qsassert(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), qt_accAmpIndex(), qt_ACE_do(), qt_addPatternProps(), qt_create_commandline(), qt_error_string(), qt_fillFontDef(), qt_format_text(), qt_get_screen(), qt_getLprPrinters(), qt_guiPlatformPlugin(), qt_init(), qt_keyrelease_scanner(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_extract_filter(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), qt_mac_make_filters_list(), qt_make_filter_list(), qt_parsePrintcap(), qt_parseSpoolInterface(), qt_perhapsAddPrinter(), qt_resource_fixResourceRoot(), qt_set_x11_resources(), qt_setWindowTitle_helperHelper(), qt_splitLocaleName(), qt_win_filter(), qt_win_get_existing_directory(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), qt_win_make_filters_list(), qt_win_make_OFN(), qt_x11_set_fallback_font_family(), qTimeFromString(), QToolButton::QToolButton(), QtWndProc(), QWin32PrintEnginePrivate::queryDefault(), QPatternist::XSLTTokenizer::queueTextConstructor(), QUrl::QUrl(), QVFbKeyboardHandler::QVFbKeyboardHandler(), QVFbMouseHandler::QVFbMouseHandler(), qWarnODBCHandle(), QWinSettingsPrivate::QWinSettingsPrivate(), qws_dataDir(), qwsFontPath(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate(), QWSQnxKeyboardHandler::QWSQnxKeyboardHandler(), QXmlName::QXmlName(), QWSCalibratedMouseHandler::readCalibration(), MetaObjectGenerator::readClassInfo(), QInotifyFileSystemWatcherEngine::readFromInotify(), QWinSettingsPrivate::readKey(), QPatternist::XsdSchemaParser::readNamespaceAttribute(), QPngHandlerPrivate::readPngTexts(), QPatternist::XsdSchemaParser::readXPathAttribute(), QPatternist::XsdSchemaParser::readXPathExpression(), QFtpPI::readyRead(), QSocks5SocketEnginePrivate::reauthenticate(), QDB2Driver::record(), QOCIDriver::record(), QPSQLDriver::record(), QAxScriptManager::registerEngine(), registerFont(), QDBusConnection::registerObject(), QPlatformFontDatabase::registerQPF2Font(), QResource::registerResource(), QAccessibleGroupBox::relationTo(), QDir::relativeFilePath(), QSettings::remove(), QDir::remove(), QWinSettingsPrivate::remove(), QSidebar::removeEntry(), QNetworkDiskCachePrivate::removeFile(), QCoreApplication::removeLibraryPath(), QFileSystemWatcher::removePath(), QInotifyFileSystemWatcherEngine::removePaths(), QKqueueFileSystemWatcherEngine::removePaths(), QDir::rename(), replace(), QDeclarativeXMLHttpRequest::requestFromUrl(), QMacInputContext::reset(), QUrl::resolved(), QFileSystemEntry::resolveFilePath(), resolveGdi32(), QFileSystemEntry::resolveNativeFilePath(), resolveScheme(), QTextBrowserPrivate::resolveUrl(), QDockAreaLayoutInfo::restoreState(), QFileSystemModelPrivate::QFileSystemNode::retranslateStrings(), QMacPasteboard::retrieveData(), QXlibClipboardMime::retrieveData_sys(), QPatternist::AccelTreeResourceLoader::retrieveUnparsedText(), QDir::rmdir(), QDir::rmpath(), QKqueueFileSystemWatcherEngine::run(), QFileInfoGatherer::run(), QDomDocumentTypePrivate::save(), QAxServerBase::Save(), QDomElementPrivate::save(), QDomDocumentPrivate::saveDocument(), QDockAreaLayoutInfo::saveState(), QToolBarAreaLayout::saveState(), Maemo::IcdPrivate::scan(), QAxScriptManager::scriptFileFilter(), QScriptDebuggerAgent::scriptLoad(), QScriptDebuggerAgent::scriptUnload(), QTextEdit::scrollToAnchor(), section(), QDeclarativeViewSection::sectionString(), QSqlTableModel::select(), QFileDialog::selectFile(), QSqlRelationalTableModel::selectStatement(), QSqlTableModel::selectStatement(), QDBusConnectionPrivate::sendError(), QWSServer::sendIMEvent(), QCopChannel::sendLocally(), QLineEditPrivate::sendMouseEventToInputContext(), QTextControlPrivate::sendMouseEventToInputContext(), QHttpNetworkConnectionChannel::sendRequest(), QSocks5SocketEnginePrivate::sendRequestMethod(), QXlibClipboard::sendSelection(), set_text(), QCoreApplication::setApplicationName(), QUrlPrivate::setAuthority(), QScriptDebuggerAgent::setBreakpoint(), QNetworkDiskCache::setCacheDirectory(), QColor::setColorFromString(), QTextControlPrivate::setContent(), QAxBase::setControl(), QNetworkCookieJar::setCookiesFromUrl(), QLineEditPrivate::setCursorVisible(), QScriptDebuggerLocalsModel::setData(), QFileSystemModel::setData(), QMessageBox::setDetailedText(), QFileDialog::setDirectory(), QSocks5SocketEnginePrivate::setErrorState(), QPluginLoader::setFileName(), QLibrary::setFileName(), QTextControl::setFocusToAnchor(), QDeclarativeFolderListModel::setFolder(), setFontFamilyFromValues(), QMessageBox::setInformativeText(), QMdiSubWindowPrivate::setNewWindowTitle(), QPrinter::setOutputFileName(), QWidgetPrivate::setParent_sys(), QTextLayout::setPreeditArea(), QUndoAction::setPrefixedText(), QPrintDialogPrivate::setPrinter(), QPrinter::setPrinterName(), QWin32PrintEngine::setProperty(), QHttpSocketEngine::setProxy(), QAbstractSpinBoxPrivate::setRange(), QFileSystemModel::setRootPath(), QDeclarativeFontLoader::setSource(), QTextBrowserPrivate::setSource(), QApplication::setStyleSheet(), QWidget::setStyleSheet(), QAccessibleAbstractScrollArea::setText(), QImageWriter::setText(), QAction::setText(), QGtkStylePrivate::setupGtkFileChooser(), QUrlModel::setUrl(), setWidthAttribute(), QWidgetPrivate::setWindowIconText_sys(), QWidget::setWindowTitle(), QWidgetPrivate::setWindowTitle_sys(), shouldWatchService(), QBalloonTip::showBalloon(), QSystemTrayIconPrivate::showMessage_sys(), QMessageBoxPrivate::showOldMessageBox(), QToolTip::showText(), QTextControlPrivate::showToolTip(), QPushButton::sizeHint(), QHttpSocketEngine::slotSocketReadNotification(), QFileSystemEngine::slowCanonicalized(), QFontDatabase::smoothSizes(), QFtpDTP::socketReadyRead(), QAbstractSpinBoxPrivate::specialValue(), QCss::Selector::specificity(), QFSCompleter::splitPath(), QCompleter::splitPath(), QSqlDriver::sqlStatement(), QLocale::standaloneDayName(), QLocale::standaloneMonthName(), QCommonStyle::standardIconImplementation(), QStyleSheetStyle::standardIconImplementation(), QStyleSheetStyle::standardPixmap(), QScriptCompletionTask::start(), QThreadPrivate::start(), QHttpSetProxyRequest::start(), QProcessPrivate::startDetached(), QSslSocketBackendPrivate::startHandshake(), QProcessPrivate::startProcess(), QStringRef::startsWith(), Maemo::IcdPrivate::state(), QNetworkSessionPrivateImpl::stateChange(), Maemo::IcdPrivate::statistics(), QApplication::style(), QtFontFoundry::style(), QStyleSheetStyle::styleHint(), QFontDatabase::styles(), QFontDatabase::styleString(), styleStringHelper(), supportsAttribute(), QMenuPrivate::QMacMenuPrivate::syncAction(), QNetworkSessionPrivateImpl::syncStateWithInterface(), QGuiPlatformPlugin::systemIconThemeName(), QNetworkProxyFactory::systemProxyForQuery(), QDB2Driver::tables(), QIBaseDriver::tables(), QSQLiteDriver::tables(), tabTextFor(), QFileSystemEngine::tempPath(), QAccessibleButton::text(), QAccessibleWidget::text(), QClipboard::text(), QAccessibleMenuBar::text(), QAccessibleToolButton::text(), QAccessibleHeader::text(), QAccessibleDisplay::text(), QAccessibleGroupBox::text(), QAccessibleLineEdit::text(), QAccessibleTable2Cell::text(), QAccessibleTabBar::text(), QAccessibleTable2HeaderCell::text(), QImage::text(), QAccessibleComboBox::text(), QAccessibleItemRow::text_helper(), QIconLoader::themeName(), QCoreFuriCuri::timerEvent(), QMdiSubWindowPrivate::titleBarOptions(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QCommandLinkButtonPrivate::titleRect(), QScript::ToBool(), QPatternist::NamePool::toClarkName(), QSystemLocalePrivate::toCurrencyString(), QLocale::toCurrencyString(), QDBusMessagePrivate::toDBusMessage(), QUrlPrivate::toEncoded(), QTextHtmlExporter::toHtml(), tokenUntil(), QUrl::toLocalFile(), QNetworkCookie::toRawForm(), QScriptContext::toString(), QHostAddress::toString(), QDeclarativeObjectScriptClass::tostring(), QUrl::toString(), QDateTime::toString(), QCoreApplication::translate(), QETWidget::translateConfigEvent(), QKeyMapperPrivate::translateKeyEvent(), QETWidget::translateKeyEvent(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), translateWSAError(), MetaObjectGenerator::tryCache(), QFileIconProvider::type(), QSystemLocalePrivate::uiLanguages(), unquote(), QLocalePrivate::unsLongLongToString(), unstylable(), QDeclarativeStateGroupPrivate::updateAutoState(), QGraphicsSvgItemPrivate::updateDefaultSize(), QAbstractSpinBoxPrivate::updateEdit(), QFileSystemModelPrivate::QFileSystemNode::updateIcon(), ShaderEffectItem::updateProperties(), UpdateRegistry(), QSqlTableModel::updateRowInTable(), ShaderEffectItem::updateShaderProgram(), QIconLoader::updateSystemTheme(), QUnixPrintWidgetPrivate::updateWidget(), QMdiSubWindowPrivate::updateWindowTitle(), QHttpNetworkRequestPrivate::uri(), QDeclarativeEnginePrivate::urlToLocalFileOrQrc(), QUrlPrivate::userInfo(), QSpinBoxValidator::validate(), QUrlPrivate::validate(), QSpinBoxPrivate::validateAndInterpret(), QDateTimeEditPrivate::validateAndInterpret(), QDoubleSpinBoxPrivate::validateAndInterpret(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), QPatternist::XsdValidatingInstanceReader::validateElementSimpleType(), QAxFactory::validateLicenseKey(), QDeclarativeEngineDebugService::valueContents(), QDeclarativeStringConverters::variantFromString(), QAxBase::verbs(), QHeaderView::viewportEvent(), QMYSQLResult::virtual_hook(), QFontDatabase::weight(), QAbstractXmlReceiver::whitespaceOnly(), QPatternist::AccelTreeBuilder< true >::whitespaceOnly(), QPatternist::QAbstractXmlReceiver::whitespaceOnly(), windowsConfigPath(), windowsErrorString(), winGetExistDirCallbackProc(), winIso639LangName(), QDeclarativeInclude::worker_include(), QFileDialogPrivate::workingDirectory(), QDBusMetaObjectGenerator::write(), QSvgIconEngine::write(), QImageWriter::write(), QWSCalibratedMouseHandler::writeCalibration(), QXmlSerializer::writeEscaped(), QXmlSerializer::writeEscapedAttribute(), QXmlStreamWriter::writeNamespace(), QApplicationPrivate::x11_apply_settings(), QXIMInputContext::x11FilterEvent(), QX11Data::xdndMimeStringToAtom(), xic_draw_callback(), and QDeclarativeInfo::~QDeclarativeInfo().
|
inline |
Returns true if this string is null; otherwise returns false.
Example:
Qt makes a distinction between null strings and empty strings for historical reasons. For most applications, what matters is whether or not a string contains any data, and this can be determined using the isEmpty() function.
Definition at line 505 of file qstring.h.
Referenced by QHttpPrivate::_q_slotSendRequest(), QCoreApplication::applicationDirPath(), QCoreApplication::applicationFilePath(), QPatternist::XQueryTokenizer::attributeAsRaw(), QCss::StyleSelector::basicSelectorMatches(), buildMatchRule(), QWizard::buttonText(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), QUrlPrivate::canonicalHost(), clear(), QDBusConnectionPrivate::connectSignal(), QSvgIconPlugin::create(), QDomImplementation::createDocumentType(), createUseNode(), QAbstractFileEngineIterator::currentFilePath(), QDBusConnectionPrivate::disconnectSignal(), QTranslatorPrivate::do_translate(), QMotifStyle::drawControl(), QLineEdit::dropEvent(), endsWith(), QStringRef::endsWith(), QPatternist::ReplaceFN::evaluateSingleton(), find_translation(), QSystemTrayIconSys::findTrayGeometry(), QMacPasteboardMime::flavorToMime(), fontExists(), QtFontFamily::foundry(), QUrlPrivate::fragmentImpl(), QWindowsAccessible::get_accValue(), QDBusConnectionPrivate::handleSignal(), QFtpDTP::hasError(), QTextControl::insertFromMimeData(), QComboBox::insertItem(), QPatternist::XSLTTokenizer::insideFunction(), QAxServerBase::Invoke(), QNetworkAuthenticationCredential::isNull(), QStringRef::isNull(), QTranslator::load(), QLibraryInfo::location(), QFtp::login(), QDomNamedNodeMapPrivate::namedItemNS(), QPatternist::XQueryTokenizer::nextToken(), QDBusXmlParser::object(), QMYSQLDriver::open(), QPatternist::AccelTreeResourceLoader::openUnparsedText(), operator!=(), QDirSortItemComparator::operator()(), operator<<(), operator==(), QDeclarativeDirParser::parse(), QXmlStreamReaderPrivate::parse(), QXmlSimpleReaderPrivate::parseBeginOrContinue(), QXmlSimpleReaderPrivate::parseFailed(), QUrl::path(), populate_database(), QDBusConnectionPrivate::prepareHook(), QTextHtmlImporter::processSpecialNodes(), qCreateParamString(), QDomAttrPrivate::QDomAttrPrivate(), QDomElementPrivate::QDomElementPrivate(), qDrawPlainRect(), StringSplitter::qIsForwardIteratorEnd(), qIsForwardIteratorEnd(), qmlxmlhttprequest_open(), QRuntimeGraphicsSystem::QRuntimeGraphicsSystem(), qt_aqua_get_known_size(), qt_get_screen(), qt_init(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_display_change_callbk(), qt_qFindChild_helper(), qt_qFindChildren_helper(), QTextLayout::QTextLayout(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QXmlStreamReaderPrivate::raiseError(), QXmlSimpleReaderPrivate::reportParseError(), QDomDocumentTypePrivate::save(), QDomAttrPrivate::save(), QDomElementPrivate::save(), QDomNotationPrivate::save(), QDomEntityPrivate::save(), QFutureWatcherBasePrivate::sendCallOutEvent(), QDomElementPrivate::setAttributeNodeNS(), QUrlPrivate::setAuthority(), QProgressDialog::setCancelButtonText(), QUrl::setFragment(), QSystemTrayIconSys::setIconContents(), QDomNamedNodeMapPrivate::setNamedItemNS(), QXmlNamespaceSupport::setPrefix(), QLabel::setTextFormat(), QWidget::setWindowTitle(), QXmlStreamReaderPrivate::startDocument(), startsWith(), QStringRef::startsWith(), QLineControl::text(), QLocale::toCurrencyString(), QUrlPrivate::toEncoded(), QPatternist::XQueryTokenizer::tokenizeStringLiteral(), toPercentEncodingHelper(), QUrl::toString(), toUtf8(), QStringRef::toUtf8(), QUrlPrivate::userInfo(), QTextOdfWriter::writeBlockFormat(), QXmlStreamWriter::writeProcessingInstruction(), QApplicationPrivate::x11_apply_settings(), and QPSQLResult::~QPSQLResult().
bool QString::isRightToLeft | ( | ) | const |
Returns true if the string is read right to left.
Definition at line 7528 of file qstring.cpp.
Referenced by QDeclarativeTextEditPrivate::determineHorizontalAlignment(), QDeclarativeTextInputPrivate::determineHorizontalAlignment(), QTextEngine::isRightToLeft(), and QLabelPrivate::textDirection().
|
inline |
|
inline |
int QString::lastIndexOf | ( | QChar | c, |
int | from = -1 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3000 of file qstring.cpp.
Referenced by _q_parseDosDir(), QFileDialogPrivate::_q_updateOkButton(), QDeclarativeImportsPrivate::add(), QFileDialogPrivate::addDefaultSuffixToFiles(), addTag(), QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), QFileDialogPrivate::basename(), QDeclarativeCompiler::buildDynamicMeta(), createImageNode(), QDeclarativeComponentPrivate::createObject(), customMimeType(), QKeySequencePrivate::decodeString(), QDeclarativeXmlQueryEngine::doQueryJob(), DumpIDL(), fbname(), QFileInfoGatherer::fetchExtendedInformation(), QResourceFileEngine::fileName(), fileName(), QDeclarativeImportedNamespace::find(), find_translation(), QSslCertificate::fromPath(), QFileSystemEngine::getLinkTarget(), QSymSQLResultPrivate::initColumns(), QAxBase::initializeRemote(), isDirPath(), QSslSocketBackendPrivate::isMatchingHostname(), keyName(), keyPath(), lastIndexOf(), QByteArray::lastIndexOf(), QStringRef::lastIndexOf(), launchWebBrowser(), QTranslator::load(), QAxServerBase::Load(), QFSFileEnginePrivate::longFileName(), menuItemEntry(), QDeclarativeEngineDebugService::objectData(), QScriptNewBreakpointWidget::onOkClicked(), QStringRef::operator=(), parseFontName(), parseIp6(), qAxInit(), qt_init(), qt_is_idn_enabled(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qt_mac_menu_merge_action(), qt_set_x11_resources(), qt_setWindowTitle_helperHelper(), MetaObjectGenerator::readClassInfo(), QFileSystemEngine::removeDirectory(), QDeclarativeImportsPrivate::resolvedUri(), QAxServerBase::Save(), QNetworkCookieJar::setCookiesFromUrl(), QDeclarativeFolderListModel::setFolder(), QDesktopServices::storageLocation(), QMenuPrivate::QMacMenuPrivate::syncAction(), QFileInfoGatherer::updateFile(), UpdateRegistry(), QAxFactory::validateLicenseKey(), and QDeclarativeInfo::~QDeclarativeInfo().
int QString::lastIndexOf | ( | const QString & | str, |
int | from = -1 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the index position of the last occurrence of the string str in this string, searching backward from index position from.
If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Example:
Definition at line 2925 of file qstring.cpp.
int QString::lastIndexOf | ( | const QLatin1String & | s, |
int | from = -1 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 2967 of file qstring.cpp.
int QString::lastIndexOf | ( | const QStringRef & | s, |
int | from = -1 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3023 of file qstring.cpp.
int QString::lastIndexOf | ( | const QRegExp & | rx, |
int | from = -1 |
||
) | const |
Definition at line 3385 of file qstring.cpp.
int QString::lastIndexOf | ( | QRegExp & | rx, |
int | from = -1 |
||
) | const |
Definition at line 3409 of file qstring.cpp.
QString QString::left | ( | int | n | ) | const |
Returns a substring that contains the n leftmost characters of the string.
The entire string is returned if n is greater than size() or less than zero.
Definition at line 3664 of file qstring.cpp.
Referenced by QLineEditPrivate::_q_completionHighlighted(), _q_escapeIdentifier(), _q_resolveEntryAndCreateLegacyEngine_recursive(), QDeclarativeTypeLoader::absoluteFilePath(), QDeclarativeImportsPrivate::add(), QDeclarativePropertyCache::append(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QKeySequence::assign(), computeElidedText(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QHttpHeader::contentType(), QPatternist::XsdInstanceReader::convertToQName(), QPatternist::XsdTypeChecker::convertToQName(), QFileSystemEngine::createDirectory(), QScriptDebuggerConsolePrivate::createJob(), QPSQLResult::data(), QCalendarModel::dayName(), QNativeWifiEngine::disconnectFromId(), QDragManager::drag(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), DumpIDL(), QTextEngine::elidedText(), elliditide(), extractEncodingDecl(), QResourceFileEngine::fileName(), QDeclarativeImportedNamespace::find(), QFontDatabase::findFont(), QSystemTrayIconSys::findIconGeometry(), QSystemTrayIconSys::findTrayGeometry(), fontPath(), QSslCertificate::fromPath(), QDateTime::fromString(), QUrl::fromUserInput(), QFileSystemEngine::getLinkTarget(), getStringTok(), QImageReaderPrivate::getText(), getVariables(), QMacInputContext::globalEventProcessor(), QDirModel::index(), QAxBase::initializeRemote(), QLineControl::internalInsert(), QLineControl::internalSetText(), QAxServerBase::Invoke(), isDirPath(), keyPath(), leftJustified(), QTranslator::load(), QAxServerBase::Load(), longestCommonPrefix(), QFSFileEnginePrivate::longFileName(), QSharedMemoryPrivate::makePlatformSafeKey(), QFileDialogPrivate::maxNameLength(), menuItemEntry(), QDeclarativePropertyCache::Data::name(), QWSServerPrivate::newMouseHandler(), QDeclarativeEngineDebugService::objectData(), QScriptNewBreakpointWidget::onOkClicked(), QIBaseDriver::open(), QMYSQLDriver::open(), QWSServer::openKeyboard(), QFontMetrics::operator!=(), QTest::outputMessage(), QDeclarativeDirParser::parse(), parseFontName(), QLineControl::parseInputMask(), QHttpHeader::parseLine(), QHttpResponseHeader::parseLine(), QHttpRequestHeader::parseLine(), QDateTimeParser::parseSection(), QFileSystemEntry::path(), QDeclarativeStringConverters::pointFFromString(), QApplicationPrivate::process_cmdline(), QXmlNamespaceSupport::processName(), QPatternist::NamespaceSupport::processName(), qAxInit(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qDrawPlainRect(), qExtractSecurityPolicyFromString(), qGetTableInfo(), QIconTheme::QIconTheme(), qParseOpts(), qSplitTableAndOwner(), qSplitTableName(), qt_mac_to_pascal_string(), qt_parsePrinterDesc(), qt_parseQconfig(), qt_set_x11_resources(), qt_split_namespace(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), MetaObjectGenerator::readClassInfo(), QFtpPI::readyRead(), QDeclarativeStringConverters::rectFFromString(), registerFont(), QFileSystemEngine::removeDirectory(), rightJustified(), QAxServerBase::Save(), QAxScriptManager::scriptForFunction(), section(), set_text(), QUrlPrivate::setAuthority(), QNetworkCookieJar::setCookiesFromUrl(), QDeclarativeFolderListModel::setFolder(), QSystemTrayIconSys::setIconContents(), QTextBrowserPrivate::setSource(), QUndoCommand::setText(), QGtkStylePrivate::setupGtkFileChooser(), QUrl::setUrl(), QUrlPrivate::setUserInfo(), QDeclarativeStringConverters::sizeFFromString(), QFileSystemEngine::slowCanonicalized(), QXmlNamespaceSupport::splitName(), QFtpPI::startNextCmd(), QPainter::testRenderHint(), QLineControl::textBeforeSelection(), QImage::textList(), QPatternist::Decimal::toString(), totalDigitsForDecimal(), QMenuPrivate::updateActionRects(), QAuthenticatorPrivate::updateCredentials(), UpdateRegistry(), QDateTimeEditPrivate::validateAndInterpret(), QAxFactory::validateLicenseKey(), QDeclarativeStringConverters::vector3DFromString(), and QDeclarativeInfo::~QDeclarativeInfo().
QString QString::leftJustified | ( | int | width, |
QChar | fill = QLatin1Char(' ') , |
||
bool | truncate = false |
||
) | const |
Returns a string of size width that contains this string padded by the fill character.
If truncate is false and the size() of the string is more than width, then the returned string is a copy of the string.
If truncate is true and the size() of the string is more than width, then any characters in a copy of the string after position width are removed, and the copy is returned.
Definition at line 5318 of file qstring.cpp.
Referenced by QPatternist::AbstractDuration::create(), QPatternist::AbstractDateTime::create(), and vsprintf().
QStringRef QString::leftRef | ( | int | n | ) | const |
Returns a substring reference to the n leftmost characters of the string.
If n is greater than size() or less than zero, a reference to the entire string is returned.
Definition at line 9045 of file qstring.cpp.
Referenced by QDeclarativePropertyCache::create(), QSslSocketBackendPrivate::isMatchingHostname(), and parseServerList().
|
inline |
Returns the number of characters in this string.
Equivalent to size().
Definition at line 696 of file qstring.h.
Referenced by QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QPrintDialogPrivate::_q_printerOrFileSelected(), QHttpPrivate::_q_slotConnected(), QFileDialogPrivate::_q_updateOkButton(), QDeclarativeTypeLoader::absoluteFilePath(), QFileDialog::accept(), QDBusConnectionPrivate::activateObject(), QDeclarativeImportDatabase::addImportPath(), QDeclarativeImportDatabase::addPluginPath(), QDir::addResourceSearchPath(), addTag(), QTextHtmlImporter::appendNodeText(), QConcatenable< QString >::appendTo(), QSyntaxHighlighterPrivate::applyFormatChanges(), QUnixPrintWidgetPrivate::applyPrinterProperties(), QKeySequence::assign(), QPatternist::DerivedString< TypeToken >::attributeNormalize(), QTextEngine::attributes(), QFileSystemEntry::baseName(), bidiItemize(), QOCIResultPrivate::bindValue(), QFontMetrics::boundingRect(), QFontMetricsF::boundingRect(), QPainter::boundingRect(), QDeclarativeCompiler::buildDynamicMeta(), QTextCodec::canEncode(), canonicalOrderHelper(), QRegExpEngine::Box::cat(), QFontMetrics::charWidth(), QPatternist::XsdTypeChecker::checkConstrainingFacetsString(), QDir::cleanPath(), QLineControl::clear(), QLocalePrivate::codeToCountry(), QLocalePrivate::codeToLanguage(), QLocalePrivate::codeToScript(), QDeclarativeStringConverters::colorFromString(), compare(), QStringRef::compare(), QLineControl::complete(), QFileSystemEntry::completeBaseName(), QDeclarativeCompiler::completeComponentBuild(), QScriptCompletionTaskPrivate::completeScriptExpression(), QScriptDebuggerConsoleCommandManager::completions(), composeHelper(), QWinInputContext::composition(), computeElidedText(), QLinuxFbScreen::connect(), QAbstractConcatenable::convertFromAscii(), QWindowsMimeText::convertFromMime(), QWindowsMimeURI::convertFromMime(), QBuiltInMimes::convertFromMime(), Qt::convertFromPlainText(), QWindowsMimeURI::convertToMime(), QUtf8::convertToUnicode(), count(), QNetworkAccessFileBackendFactory::create(), QFileSystemEngine::createDirectory(), createFileFromTemplate(), QPatternist::URILoader::createRequest(), QPSQLResult::data(), QDomCharacterDataPrivate::dataLength(), QLocalePrivate::dateTimeToString(), decimalForm(), QKeySequencePrivate::decodeString(), decomposeHelper(), QPatternist::CompressedWhitespace::decompress(), QDeclarativeListModelParser::definesEmptyList(), derefEngine(), double2string(), QLocalePrivate::doubleToString(), QDragManager::drag(), QSvgText::draw(), QPainter::drawText(), QLineEdit::dropEvent(), DumpIDL(), QAxBase::dynamicCallHelper(), QTextEngine::elidedText(), QTextHtmlExporter::emitFragment(), QTextHtmlExporter::emitFrameStyle(), encodeText(), QStringRef::endsWith(), QPatternist::CaseInsensitiveStringComparator::equals(), errorCodeToString(), Qt::escape(), QPatternist::escape(), escapedKey(), QPatternist::AtomicString::evaluateEBV(), QPatternist::DerivedString< TypeToken >::evaluateEBV(), QPatternist::TranslateFN::evaluateSingleton(), QCalendarTextNavigator::eventFilter(), QRegExp::exactMatch(), QDB2Result::exec(), QODBCResult::exec(), QSqlResult::exec(), QOCICols::execBatch(), QProcessPrivate::execChild(), exponentForm(), extractEncodingDecl(), familyList(), QWSSoundServerPrivate::feedDevice(), QFileSystemEntry::fileName(), QDir::filePath(), QFileSystemModelPrivate::filePath(), QShortcutMap::find(), findArgEscapes(), findChildObject(), findGraphicsFactory(), findGroupFactory(), findInBlock(), QResourceRoot::findNode(), findObject(), findStyleFactoryMethod(), findStyleUtilFactoryMethod(), QSystemTrayIconSys::findTrayGeometry(), findUtilFactory(), fmtDateTime(), QTextEngine::formatIndex(), QTest::formatResult(), QSqlDriver::formatValue(), QPatternist::NamePool::fromClarkName(), QPatternist::HexBinary::fromLexical(), QUrl::fromLocalFile(), QDir::fromNativeSeparators(), QUrl::fromPunycode(), QDateTime::fromString(), QTextCodec::fromUnicode(), QTextEncoder::fromUnicode(), generateName(), QAxServerBase::GetCurFile(), getEnglishName(), getMessage(), getNextChar(), QGtkStylePrivate::getThemeName(), QMacInputContext::globalEventProcessor(), QApplicationPrivate::globalEventProcessor(), QRegExpEngine::goodStringMatch(), QDBusConnectionPrivate::handleSignal(), QLineControl::hasAcceptableInput(), QDeclarativeXMLHttpRequest::headers(), QRegExpEngine::heuristicallyChooseHeuristic(), QScriptSyntaxHighlighter::highlightBlock(), QCalendarDateSectionValidator::highlightString(), QScriptSyntaxHighlighter::highlightWord(), QTextDocumentLayout::hitTest(), QUrl::host(), QRegExp::indexIn(), indexOf(), QStringRef::indexOf(), QFontMetrics::inFontUcs4(), QFontMetricsF::inFontUcs4(), QSettingsPrivate::iniEscapedKey(), QDeclarativeTextInputPrivate::init(), QSQLite2ResultPrivate::init(), QLineControl::init(), QAxBase::initializeRemote(), QSettingsPrivate::iniUnescapedKey(), QTextControlPrivate::inputMethodEvent(), QTextDocumentPrivate::insert(), QTextDocumentPrivate::insertBlock(), QTextCursor::insertText(), int2string(), QLineControl::internalDelete(), QLineControl::internalInsert(), QLCDNumberPrivate::internalSetString(), QLineControl::internalSetText(), QAxServerBase::Invoke(), QFileSystemEntry::isAbsolute(), QKeyMapperPrivate::isADeadKey(), isDirPath(), QFileSystemEntry::isDriveRoot(), QPatternist::LangFN::isLangMatch(), QSslSocketBackendPrivate::isMatchingHostname(), QUrl::isParentOf(), isPrefixOf(), QXmlUtils::isPublicID(), QFileSystemEntry::isRelative(), isSignalPropertyName(), isSupportedSvgFeature(), isUncRoot(), QDBusUtil::isValidBusName(), QDBusUtil::isValidInterfaceName(), QDBusUtil::isValidMemberName(), QPatternist::DerivedString< TypeToken >::isValidName(), QPatternist::DerivedString< TypeToken >::isValidNMTOKEN(), QDBusUtil::isValidPartOfObjectPath(), QDBusUtil::isValidUniqueConnectionName(), QTextEngine::itemize(), QTextEngine::justify(), QTest::keyClicks(), QMenuBar::keyPressEvent(), QMenu::keyPressEvent(), QTextEdit::keyPressEvent(), QRegExp::lastIndexIn(), launchWebBrowser(), QTextLine::layout_helper(), QTextEngine::LayoutData::LayoutData(), leftJustified(), QPatternist::ProcessingInstructionConstructor::leftTrimmed(), CharacterData::length(), lengthLessThan(), QCss::ValueExtractor::lengthValue(), QTextEngine::lineNumberForTextPosition(), QTranslator::load(), QAxServerBase::Load(), loadEngine(), localeAwareCompare(), QStringRef::localeAwareCompare(), localizedName(), longestCommonPrefix(), QFSFileEnginePrivate::longFileName(), QLocalePrivate::longLongToString(), QPatternist::XQueryTokenizer::lookupKeyword(), QLineControl::maskString(), menuItemEntry(), Qt::mightBeRichText(), QMacPasteboardMimeAny::mimeFor(), QKeySequence::mnemonic(), QMacInputContext::mouseHandler(), QWinInputContext::mouseHandler(), QXIMInputContext::mouseHandler(), QDeclarativeTextInput::moveCursorSelection(), QFileSystemEngine::nativeAbsoluteFilePath(), QFileSystemModelPrivate::naturalCompare(), QTextHtmlParser::newNode(), QScriptEnginePrivate::newRegExp(), QCssScanner_Generated::next(), nextDotDelimiter(), QTextEngine::nextLogicalPosition(), QPatternist::XQueryTokenizer::nextToken(), QFileSystemModelPrivate::node(), QStyleSheetStyleSelector::nodeNameEquals(), QLocalePrivate::numberToCLocale(), QScriptNewBreakpointWidget::onOkClicked(), QOCIDriver::open(), QDB2Driver::open(), QAudioInputPrivate::open(), QODBCDriver::open(), QAudioOutputPrivate::open(), QTemporaryFileEngine::open(), operator<(), operator<<(), QGraphicsSimpleTextItem::paint(), QDeclarativeStyledTextPrivate::parse(), QDeclarativeDirParser::parse(), QDeclarativeJS::Parser::parse(), QTextHtmlParser::parse(), parse_locale_tag(), QSvgHandler::parseCSStoXMLAttrs(), QTextHtmlParser::parseEntity(), QPatternist::PatternPlatform::parseFlags(), parseFontName(), QLineControl::parseInputMask(), QHttpResponseHeader::parseLine(), QHttpRequestHeader::parseLine(), QDeclarativeBindingCompilerPrivate::parseName(), parseServerList(), QXmlSimpleReaderPrivate::parseString(), QFileSystemEntry::path(), QFSCompleter::pathFromIndex(), populate_database(), QDeclarativeTextEdit::positionAt(), QDB2Result::prepare(), QOCIResult::prepare(), QODBCResult::prepare(), QDBusConnectionPrivate::prepareHook(), QDB2Driver::primaryIndex(), QODBCDriver::primaryIndex(), QLineControl::processInputMethodEvent(), QLineControl::processKeyEvent(), QXmlSimpleReaderPrivate::processReference(), QFtpPI::processReply(), QProcessPrivate::processStarted(), QDeclarativeTextInput::q_canPasteChanged(), qDateTimeFromString(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QDeclarative_isFileCaseCorrect(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), qEncodeNtlmString(), QLineEdit::QLineEdit(), QRegExpEngine::QRegExpEngine(), qReplacePlaceholderMarkers(), qSplitTableAndOwner(), qStreamNtlmString(), qStringAsUcs2Le(), QtPrivate::QStringList_contains(), QStringToBSTR(), QStringToOLESTR(), qt_accAmpIndex(), qt_ACE_do(), qt_create_commandline(), qt_format_text(), qt_keyrelease_scanner(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qt_mac_menu_merge_action(), qt_mac_removeMnemonics(), qt_mac_to_pascal_string(), qt_parsePrintcap(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_parseQconfig(), qt_parseSpoolInterface(), qt_section_chunk::qt_section_chunk(), qt_set_x11_resources(), qt_splitLocaleName(), qt_string_normalize(), qt_tildeExpansion(), qt_win_get_open_file_names(), qt_win_make_OFN(), qTextAfterOffsetFromString(), qTextAtOffsetFromString(), qTextBeforeOffsetFromString(), QUuid::QUuid(), qWinCmdArgs(), qwsSetClipboardText(), QTextStreamPrivate::read(), QWinSettingsPrivate::readKey(), QVFbScreenKeyboardHandler::readKeyboardData(), QFtpPI::readyRead(), QDB2Driver::record(), QODBCDriver::record(), QPSQLDriver::record(), QTextControlPrivate::rectForPosition(), QDeclarativeBindingCompilerPrivate::registerLiteralString(), QFileSystemEngine::removeDirectory(), QLineControl::removeSelectedText(), replace(), replaceArgEscapes(), replacePercentN(), QDeclarativeXMLHttpRequest::requestFromUrl(), QDB2Result::reset(), QODBCResult::reset(), QDeclarativeImportsPrivate::resolvedUri(), resolveScheme(), QDeclarativeCompiler::rewriteBinding(), rightJustified(), QAxServerBase::Save(), section(), QLineEdit::selectionStart(), QKeyMapper::sendKeyEvent(), QLineEditPrivate::sendMouseEventToInputContext(), QTextControlPrivate::sendMouseEventToInputContext(), QWSInputMethod::sendPreeditString(), QWSServerPrivate::sendQCopEvent(), QWinSettingsPrivate::set(), set_text(), QCoreApplication::setApplicationVersion(), QUrlPrivate::setAuthority(), QTextEngine::setBoundary(), QWSQCopRegisterChannelCommand::setChannel(), QScript::Lexer::setCode(), QDeclarativeJS::Lexer::setCode(), QColor::setColorFromString(), QBBInputContext::setComposingText(), QAxBase::setControl(), QPluginLoader::setFileName(), QWSPlaySoundCommand::setFileName(), QSystemTrayIconSys::setIconContents(), QWSIdentifyCommand::setId(), QTextLine::setLineWidth(), QWSQCopSendCommand::setMessage(), QDeclarativeTextInput::setPasswordCharacter(), QDirPrivate::setPath(), QLineControl::setSelection(), QGtkStylePrivate::setupGtkFileChooser(), QUrlPrivate::setUserInfo(), QSystemTrayIconSys::showMessage(), QNmDBusHelper::slotAccessPointAdded(), QNmDBusHelper::slotAccessPointRemoved(), QSettingsPrivate::splitArgs(), splitSpaceSemicolon(), QSqlDriver::sqlStatement(), QScriptCompletionTask::start(), QFtpPI::startNextCmd(), QTextBoundaryFinder::string(), stringContainsNullChar(), QSettingsPrivate::stringListToVariantList(), QLineControl::stripString(), stripTextDecl(), QMenuPrivate::QMacMenuPrivate::syncAction(), QDB2Driver::tables(), QODBCDriver::tables(), QFontMetrics::tightBoundingRect(), QFontMetricsF::tightBoundingRect(), toAscii(), QStringRef::toAscii(), QFileDialogPrivate::toInternal(), QPatternist::Tokenizer::tokenToString(), toLatin1(), QStringRef::toLatin1(), QProcessEnvironmentPrivate::toList(), QStringRef::toLocal8Bit(), QUrl::toLocalFile(), QDir::toNativeSeparators(), toPunycodeHelper(), toStdWString(), QKeySequence::toString(), totalDigitsForDecimal(), totalDigitsForSignedLongLong(), totalDigitsForUnsignedLongLong(), XsdSchemaToken::toToken(), QPatternist::XSLTTokenLookup::toToken(), toUcs4(), QStringRef::toUcs4(), toUcs4_helper(), QFontEngineXLFD::toUnicode(), toUtf8(), QStringRef::toUtf8(), toWCharArray(), QETWidget::translateKeyEvent(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), QWSSoundServerClient::tryReadCommand(), typeNameToXml(), QLocalePrivate::unsLongLongToString(), QLineControl::updateDisplayText(), QFileInfoGatherer::updateFile(), QPrintPreviewDialogPrivate::updatePageNumLabel(), UpdateRegistry(), QSpinBoxValidator::validate(), QLocalePrivate::validateChars(), vsprintf(), wc2rx(), QFontMetrics::width(), QFontMetricsF::width(), QXmlSerializer::write(), write_xbm_image(), QTextOdfWriter::writeBlock(), QXmlSerializer::writeEscaped(), QXmlSerializer::writeEscapedAttribute(), QApplication::x11ProcessEvent(), and xic_draw_callback().
int QString::localeAwareCompare | ( | const QString & | s | ) | const |
Definition at line 5197 of file qstring.cpp.
Referenced by QStringRef::at(), QSortFilterProxyModel::lessThan(), localeAwareCompare(), QFileSystemModelPrivate::naturalCompare(), QDirSortItemComparator::operator()(), and QAbstractItemModelPrivate::variantLessThan().
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.
On Mac OS X since Qt 4.3, this function compares according the "Order for sorted lists" setting in the International prefereces panel.
Definition at line 367 of file qstring.h.
|
inline |
Definition at line 1262 of file qstring.h.
|
inlinestatic |
Definition at line 1264 of file qstring.h.
|
staticprivate |
Definition at line 5212 of file qstring.cpp.
Referenced by localeAwareCompare(), and QStringRef::localeAwareCompare().
QString QString::mid | ( | int | position, |
int | n = -1 |
||
) | const |
Returns a string that contains n characters of this string, starting at the specified position index.
Returns a null string if the position index exceeds the length of the string. If there are less than n characters available in the string starting at the given position, or if n is -1 (default), the function returns all characters that are available from the specified position.
Example:
Definition at line 3706 of file qstring.cpp.
Referenced by QLineEditPrivate::_q_completionHighlighted(), QScriptDebuggerLocalsWidgetPrivate::_q_insertCompletion(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), _q_parseDosDir(), _q_parseUnixDir(), _q_resolveEntryAndCreateLegacyEngine_recursive(), QFileDialogPrivate::_q_updateOkButton(), QNSOpenSavePanelDelegate::acceptableExtensionsForSave, QFileSystemWatcher::addPaths(), QTextCodec::availableMibs(), QFileSystemEntry::baseName(), QFileDialogPrivate::basename(), QDeclarativeCompiler::buildDynamicMeta(), QDeclarativeEngineDebugService::buildObjectDump(), QMacSettingsPrivate::children(), comify(), QFileSystemEntry::completeBaseName(), QScriptCompletionTaskPrivate::completeScriptExpression(), QFileSystemEntry::completeSuffix(), QVNCScreen::connect(), QVFbScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QLinuxFbIntegration::connect(), QPatternist::XsdInstanceReader::convertToQName(), QPatternist::XsdTypeChecker::convertToQName(), QTextCodecPlugin::create(), createImageNode(), QScriptDebuggerConsolePrivate::createJob(), QDeclarativeComponentPrivate::createObject(), customMimeType(), QKeySequencePrivate::decodeString(), QNativeWifiEngine::disconnectFromId(), QDeclarativeJS::TextWriter::doMove(), QDeclarativeXmlQueryEngine::doQueryJob(), QWindowsCEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QStyleSheetStyle::drawControl(), QItemDelegate::drawDisplay(), driveSpec(), QAxBase::dynamicCallHelper(), QFontMetrics::elidedText(), QFontMetricsF::elidedText(), QTextEngine::elidedText(), elliditide(), QResourcePrivate::ensureChildren(), QResourcePrivate::ensureInitialized(), QScriptDebuggerCodeView::event(), QDeclarativeScriptParser::extractMetaData(), QDeclarativeScriptParser::extractPragmas(), familyList(), fbname(), QFileSystemEntry::fileName(), fileName(), QFileSystemModelPrivate::filePath(), QDeclarativeImportedNamespace::find(), QResourceRoot::findNode(), QMacPasteboardMimeUnicodeText::flavorFor(), fontPath(), QPatternist::NamePool::fromClarkName(), QProcessEnvironmentPrivate::fromList(), QUrl::fromLocalFile(), QSslCertificate::fromPath(), QDate::fromString(), QTime::fromString(), QDateTime::fromString(), getFmtString(), QDeclarativeEnginePrivate::getImageFromProvider(), QDeclarativeEnginePrivate::getPixmapFromProvider(), getStringTok(), QImageReaderPrivate::getText(), getVariables(), hasValidSignal(), QCalendarDateSectionValidator::highlightString(), QUrl::host(), QSQLite2ResultPrivate::init(), QSvgSwitch::init(), QSymSQLResultPrivate::initColumns(), QAxBase::initializeRemote(), QDeclarativePropertyPrivate::initProperty(), QTextDocumentPrivate::insert_string(), QDeclarativeDebugServer::instance(), QAxServerBase::Invoke(), isParentDomain(), QUrl::isParentOf(), QDBusUtil::isValidUniqueConnectionName(), keyName(), launchWebBrowser(), QTextLine::layout_helper(), QPatternist::ProcessingInstructionConstructor::leftTrimmed(), QTranslator::load(), QAxServerBase::Load(), QLibraryInfo::location(), QLineControl::maskString(), Qt::mightBeRichText(), QMacPasteboardMimeAny::mimeFor(), QTextDocumentPrivate::move(), QWSServerPrivate::newMouseHandler(), QPatternist::XQueryTokenizer::nextToken(), QDeclarativeEngineDebugService::objectData(), QBBInputContext::onGetTextAfterCursor(), QBBInputContext::onGetTextBeforeCursor(), QScriptNewBreakpointWidget::onOkClicked(), QBBInputContext::onSetComposingRegion(), QIBaseDriver::open(), QSQLiteDriver::open(), QAudioDeviceInfoInternal::open(), QMYSQLDriver::open(), QWSServer::openKeyboard(), QDeclarativeDirParser::parse(), parseFontName(), QDateTimeParser::parseFormat(), parseIp6(), QHttpHeader::parseLine(), QHttpResponseHeader::parseLine(), QDateTimeParser::parseSection(), parseServerList(), QHostAddress::parseSubnet(), QFSCompleter::pathFromIndex(), QDeclarativeStringConverters::pointFFromString(), QSqlResult::prepare(), QCss::Scanner::preprocess(), QApplicationPrivate::process_cmdline(), QXmlNamespaceSupport::processName(), QPatternist::NamespaceSupport::processName(), QFtpPI::processReply(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qExtractSecurityPolicyFromString(), qGetTableInfo(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), QMacSettingsPrivate::QMacSettingsPrivate(), qParseOpts(), qSplitTableName(), QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(), qt_format_text(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_parseQconfig(), qt_parseSpoolInterface(), qt_resource_fixResourceRoot(), qt_set_x11_resources(), qt_split_namespace(), qTextAfterOffsetFromString(), qTextAtOffsetFromString(), qTextBeforeOffsetFromString(), QTextHtmlImporter::QTextHtmlImporter(), QWinSettingsPrivate::QWinSettingsPrivate(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), QTextStreamPrivate::read(), readSymLink(), QFtpPI::readyRead(), QPSQLDriver::record(), QDeclarativeStringConverters::rectFFromString(), QTextDocumentPrivate::remove_string(), QCoreApplication::removeLibraryPath(), QInternalMimeData::renderDataHelper(), QDeclarativeImportsPrivate::resolvedUri(), QAxServerBase::Save(), section(), QDateTimeParser::sectionText(), QLineControl::selectedText(), set_text(), QUrlPrivate::setAuthority(), QCalendarDateValidator::setFormat(), QUndoCommand::setText(), QUrl::setUrl(), simplified(), QDeclarativeStringConverters::sizeFFromString(), QFileSystemEngine::slowCanonicalized(), split(), QXmlNamespaceSupport::splitName(), QFSCompleter::splitPath(), QCompleter::splitPath(), splitSpaceSemicolon(), QSettingsPrivate::stringToVariant(), QPatternist::AbstractFloat< isDouble >::stringValue(), QSqlDriver::stripDelimitersImplementation(), QAbstractSpinBoxPrivate::stripped(), QDomCharacterDataPrivate::substringData(), QFileSystemEntry::suffix(), QPainter::testRenderHint(), QAudioDeviceInfoInternal::testSettings(), QClipboard::text(), QAccessibleLineEdit::text(), QLineControl::textAfterSelection(), textForRange(), QImage::textLanguages(), QImage::textList(), QFileDialogPrivate::toInternal(), QPatternist::XQueryTokenizer::tokenizeCharacterReference(), QPatternist::XQueryTokenizer::tokenizeNCName(), QPatternist::XQueryTokenizer::tokenizeNCNameOrQName(), QPatternist::XQueryTokenizer::tokenizeNumberLiteral(), QPatternist::Tokenizer::tokenToString(), QNetworkCookie::toRawForm(), QPatternist::Decimal::toString(), totalDigitsForDecimal(), totalDigitsForSignedLongLong(), QMenuPrivate::updateActionRects(), QAuthenticatorPrivate::updateCredentials(), QFileInfoGatherer::updateFile(), QDeclarativeStringConverters::vector3DFromString(), QCommonStylePrivate::viewItemDrawText(), QTextOdfWriter::writeBlock(), xdndObtainData(), and QDeclarativeInfo::~QDeclarativeInfo().
QStringRef QString::midRef | ( | int | position, |
int | n = -1 |
||
) | const |
Returns a substring reference to n characters of this string, starting at the specified position.
If the position exceeds the length of the string, an empty reference is returned.
If there are less than n characters available in the string, starting at the given position, or if n is -1 (default), the function returns all characters from the specified position onwards.
Example:
Definition at line 9099 of file qstring.cpp.
Referenced by QSslSocketBackendPrivate::isMatchingHostname(), and parseServerList().
Definition at line 7434 of file qstring.cpp.
Referenced by arg().
QString QString::normalized | ( | QString::NormalizationForm | mode | ) | const |
Returns the string in the given Unicode normalization mode.
Definition at line 6635 of file qstring.cpp.
Referenced by QMacPasteboardMimeFileUri::convertFromMime(), QMacPasteboardMimeUrl::convertFromMime(), QMacPasteboardMimeFileUri::convertToMime(), QMacPasteboardMimeUrl::convertToMime(), getFullPath(), locale_decode(), and locale_encode().
QString QString::normalized | ( | QString::NormalizationForm | mode, |
QChar::UnicodeVersion | version | ||
) | const |
Returns the string in the given Unicode normalization mode, according to the given version of the Unicode standard.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6703 of file qstring.cpp.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6448 of file qstring.cpp.
Referenced by QFileDialogPrivate::_q_createDirectory(), QFtpPrivate::_q_startNextCommand(), QNetworkManagerEngine::activationFinished(), QNetworkManagerEngine::activeConnectionPropertiesChanged(), QFontDatabasePrivate::addAppFont(), addressFromSockaddr(), QConnmanEngine::addServiceConfiguration(), QDeclarativeParser::Variant::asScript(), QAccessibleTextWidget::attributes(), QUrlPrivate::authority(), breakpointMapToScriptValue(), QPatternist::XsdTypeChecker::checkConstrainingFacetsSignedInteger(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(), QCoreApplicationPrivate::checkReceiverThread(), classIDL(), QGraphicsWidget::close(), QPdfBaseEnginePrivate::closePrintDevice(), QDeclarativeStateGroup::componentComplete(), QNetworkManagerEngine::connectionFromId(), QFtp::connectToHost(), QCoreWlanEngine::connectToId(), QDeclarativeBindingCompilerPrivate::contextName(), convert(), QWindowsMimeHtml::convertFromMime(), QAxServerBase::create(), QPatternist::AbstractDateTime::create(), QDeclarativeEnginePrivate::createCache(), QUrlPrivate::createErrorString(), createForMib(), decodeMSG(), QPatternist::Expression::description(), QNetworkManagerEngine::disconnectFromId(), QPatternist::Cardinality::displayName(), QGenericEngine::doRequestUpdate(), QMacStylePrivate::drawColorlessButton(), QGtkStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QGtkStyle::drawPrimitive(), QDeclarativeCompiledData::dump(), QGridLayoutEngine::dump(), QPatternist::XsdSchemaDebugger::dumpParticle(), QTextHtmlExporter::emitBlock(), QTextHtmlExporter::emitBlockAttributes(), QTextHtmlExporter::emitCharFormatStyle(), QTextHtmlExporter::emitFragment(), QTextHtmlExporter::emitFrameStyle(), QTextHtmlExporter::emitTable(), QTextHtmlExporter::emitTextFrame(), QTextHtmlExporter::emitTextLength(), encodeText(), QtopiaPrintEngine::end(), QDeclarativeComponent::errorString(), QEgl::errorString(), QPatternist::GenerateIDFN::evaluateSingleton(), QPatternist::CodepointsToStringFN::evaluateSingleton(), QScriptEdit::extraAreaPaintEvent(), QWSSoundServerPrivate::feedDevice(), QXmlStreamWriterPrivate::findNamespace(), QPatternist::formatData(), QTest::formatResult(), QDB2Driver::formatValue(), QSqlDriver::formatValue(), QIBaseDriver::formatValue(), QOCIDriver::formatValue(), QODBCDriver::formatValue(), QPSQLDriver::formatValue(), QPatternist::HexBinary::fromLexical(), QHostInfoAgent::fromName(), QDeclarativeRectangle::generateBorderedRect(), QDeclarativeRectangle::generateRoundedRect(), getFmtString(), QNetworkManagerEngine::getInterfaceFromId(), QScanThread::getSsidFromNetworkName(), QGestureManager::getState(), getValue(), QPatternist::ColoringMessageHandler::handleMessage(), QNetworkManagerEngine::hasIdentifier(), QTreeModel::headerData(), QColorDialogPrivate::init(), QTreeModel::insertColumns(), QTextCursor::insertImage(), QNetworkManagerEngine::interfacePropertiesChanged(), QLibraryPrivate::isPlugin(), QTextList::itemText(), QTextCodecPlugin::keys(), loadSingleEngine(), QScriptDebuggerConsoleWidget::message(), QScriptDebugOutputWidget::message(), QScriptStdMessageHandler::message(), QProgressBar::minimumSizeHint(), QCalendarWidget::minimumSizeHint(), multiArg(), QNetworkManagerEngine::newAccessPoint(), QDeclarativeJS::numberToString(), object_name_for_button(), QDB2Driver::open(), QPSQLDriver::open(), QDebug::operator<<(), QSqlRelationalTableModel::orderByClause(), QStaticTextPrivate::paintText(), QNetworkManagerEngine::parseConnection(), QNlaThread::parseQuerySet(), pixelToPoint(), QSvgIconEnginePrivate::pmcKey(), QNetworkDiskCachePrivate::prepareLayout(), QDB2Driver::primaryIndex(), QODBCDriver::primaryIndex(), printPage(), QPatternist::AccelTree::printStats(), QFtp::put(), qDBusNewConnection(), QFontEngineQPF::QFontEngineQPF(), QSvgPaintEngine::qfontToSvg(), qMakePreparedStmtId(), QSvgPaintEngine::qpenToSvg(), qReplacePlaceholderMarkers(), QScriptDebuggerBackendPrivate::qsassert(), qt_create_internal_window(), qt_mac_constructQIconFromIconRef(), qt_reg_winclass(), qt_socket_getPortAndAddress(), QDB2Driver::record(), QODBCDriver::record(), registerFont(), QNetworkManagerEngine::removeAccessPoint(), QNetworkManagerEngine::removeConnection(), resolveGdi32(), QPatternist::SystemPropertyFN::retrieveProperty(), QDoubleSpinBoxPrivate::round(), QScanThread::run(), runningUnderDebugger(), QNativeWifiEngine::scanComplete(), scriptMapToScriptValue(), QDateTimeParser::sectionName(), QWSSoundServerClient::sendDeviceError(), QWSSoundServerClient::sendDeviceReady(), QWSSoundServerClient::sendSoundCompleted(), QConnmanEngine::serviceFromId(), QConnmanEngine::servicePropertyChangedContext(), QNetworkManagerEngine::sessionStateForId(), QNetworkDiskCache::setCacheDirectory(), QTreeModel::setColumnCount(), QHttpHeader::setContentLength(), QLibrary::setFileNameAndVersion(), QFtp::setProxy(), QIBaseResult::size(), sm_performSaveYourself(), QHttpPGHRequest::start(), QFtpPI::startNextCmd(), QCoreWlanEngine::startTime(), QDateTimeParser::stateName(), QPatternist::YearMonthDuration::stringValue(), QPatternist::Duration::stringValue(), QPatternist::Integer::stringValue(), QPatternist::DayTimeDuration::stringValue(), QPatternist::AbstractFloat< isDouble >::stringValue(), QPatternist::DerivedInteger< DerivedType >::stringValue(), QDB2Driver::tables(), QODBCDriver::tables(), QCalendarDayValidator::text(), QAccessibleDisplay::text(), QAccessibleItemRow::text(), QAccessibleScrollBar::text(), QAccessibleSlider::text(), QAccessibleDial::text(), QCalendarMonthValidator::text(), QCalendarYearValidator::text(), QUrlPrivate::toEncoded(), QTextHtmlExporter::toHtml(), QDeclarativeError::toString(), QScriptContext::toString(), QEglProperties::toString(), QDate::toString(), QScriptDebuggerValue::toString(), QTest::toString(), QSettingsGroup::toString(), QPatternist::Decimal::toString(), QDeclarativeObjectScriptClass::tostring(), QDateTime::toString(), QFont::toString(), toString(), totalDigitsForSignedLongLong(), totalDigitsForUnsignedLongLong(), translate_color(), QNetworkDiskCachePrivate::uniqueFileName(), QNetworkManagerEngine::updateAccessPoint(), QPrintPreviewDialogPrivate::updateNavActions(), QCalendarWidgetPrivate::updateNavigationBar(), QPrintPreviewDialogPrivate::updatePageNumLabel(), UpdateRegistry(), QFontDialogPrivate::updateSizes(), variantToString(), QSettingsPrivate::variantToString(), WinMain(), QTextOdfWriter::writeBlock(), QTextOdfWriter::writeCharacterFormat(), QTextOdfWriter::writeFrame(), QTextOdfWriter::writeListFormat(), QX11EmbedWidget::x11Event(), QPatternist::AbstractDateTime::zoneOffsetToString(), QColorDialog::~QColorDialog(), QDB2Result::~QDB2Result(), QEventDispatcherWin32Private::~QEventDispatcherWin32Private(), and QODBCResult::~QODBCResult().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6458 of file qstring.cpp.
|
static |
Returns a string equivalent of the number n according to the specified base.
The base is 10 by default and must be between 2 and 36. For bases other than 10, n is treated as an unsigned integer.
Definition at line 6426 of file qstring.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6438 of file qstring.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6468 of file qstring.cpp.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6478 of file qstring.cpp.
|
static |
Returns a string equivalent of the number n, formatted according to the specified format and precision.
See Argument Formats for details.
Unlike QLocale::toString(), this function does not honor the user's locale settings.
Definition at line 6501 of file qstring.cpp.
|
inline |
Returns true if this string is not equal to string other; otherwise returns false.
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 localeAwareCompare().
Definition at line 406 of file qstring.h.
|
inline |
Definition at line 413 of file qstring.h.
|
inline |
Definition at line 925 of file qstring.h.
|
inline |
Definition at line 978 of file qstring.h.
Definition at line 265 of file qstring.h.
Referenced by QByteArray::operator+=().
|
inline |
Appends the string other onto the end of this string and returns a reference to this string.
Example:
This operation is typically very fast (constant time), because QString preallocates extra space at the end of the string data so it can grow without reallocating the entire string each time.
Definition at line 274 of file qstring.h.
|
inline |
|
inline |
|
inline |
Definition at line 440 of file qstring.h.
|
inline |
Definition at line 442 of file qstring.h.
|
inline |
Definition at line 444 of file qstring.h.
bool QString::operator< | ( | const QString & | other | ) | const |
Returns true if this string is lexically less than string other; otherwise returns false.
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 using the QString::localeAwareCompare() function.
Definition at line 2436 of file qstring.cpp.
bool QString::operator< | ( | const QLatin1String & | s | ) | const |
Definition at line 2444 of file qstring.cpp.
|
inline |
Definition at line 927 of file qstring.h.
|
inline |
Definition at line 456 of file qstring.h.
|
inline |
Returns true if this string is lexically less than or equal to string other; otherwise returns false.
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 localeAwareCompare().
Definition at line 407 of file qstring.h.
|
inline |
Definition at line 414 of file qstring.h.
|
inline |
Definition at line 931 of file qstring.h.
|
inline |
Definition at line 460 of file qstring.h.
Definition at line 1582 of file qstring.cpp.
Referenced by append(), QDBusObjectPath::operator=(), QDBusSignature::operator=(), QCharRef::operator=(), QStringRef::operator=(), QSettingsKey::originalKeyPosition(), QDBusObjectPath::QDBusObjectPath(), QDBusObjectPath::setPath(), and QDBusSignature::setSignature().
Assigns other to this string and returns a reference to this string.
Definition at line 1508 of file qstring.cpp.
|
inline |
Definition at line 718 of file qstring.h.
|
inline |
Definition at line 424 of file qstring.h.
|
inline |
Definition at line 426 of file qstring.h.
|
inline |
Definition at line 428 of file qstring.h.
bool QString::operator== | ( | const QString & | other | ) | const |
Returns true if string other is equal to this string; otherwise returns false.
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 localeAwareCompare().
Definition at line 2368 of file qstring.cpp.
bool QString::operator== | ( | const QLatin1String & | s | ) | const |
Definition at line 2379 of file qstring.cpp.
|
inline |
Definition at line 923 of file qstring.h.
|
inline |
Definition at line 976 of file qstring.h.
|
inline |
Returns true if this string is lexically greater than string other; otherwise returns false.
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 localeAwareCompare().
bool QString::operator> | ( | const QLatin1String & | s | ) | const |
Definition at line 2558 of file qstring.cpp.
|
inline |
Definition at line 929 of file qstring.h.
|
inline |
Definition at line 458 of file qstring.h.
|
inline |
Returns true if this string is lexically greater than or equal to string other; otherwise returns false.
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 localeAwareCompare().
Definition at line 408 of file qstring.h.
|
inline |
Definition at line 415 of file qstring.h.
|
inline |
Definition at line 933 of file qstring.h.
|
inline |
Definition at line 462 of file qstring.h.
|
inline |
Definition at line 700 of file qstring.h.
|
inline |
Returns the character at the specified position in the string as a modifiable reference.
Example:
The return value is of type QCharRef, a helper class for QString. When you get an object of type QCharRef, you can use it as if it were a QChar &. If you assign to it, the assignment will apply to the character in the QString from which you got the reference.
Definition at line 884 of file qstring.h.
Definition at line 702 of file qstring.h.
Definition at line 261 of file qstring.h.
Referenced by _q_escapeIdentifier(), QSettingsPrivate::actualKey(), QCoreApplication::addLibraryPath(), QPSQLDriverPrivate::appendTables(), QCoreApplication::applicationDirPath(), QCoreApplication::arguments(), QTransformedScreen::connect(), QMacPasteboardMimeVCard::convertFromMime(), QAbstractFileEngineIterator::currentFilePath(), QScriptDebuggerLocalsModel::data(), decimalForm(), QLocalePrivate::doubleToString(), QResourcePrivate::ensureInitialized(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QTDSDriver::formatValue(), QNetworkAccessFtpBackend::ftpDone(), getFmtString(), getImage(), QFileSystemEngine::getLinkTarget(), getPixmap(), QFileIconProviderPrivate::getWinIcon(), QTextControl::insertFromMimeData(), QTextList::itemText(), QMessageBox::keyPressEvent(), QFSFileEnginePrivate::longFileName(), QLocalePrivate::longLongToString(), operator+(), parseCSStoXMLAttrs(), parseStopNode(), QTextHtmlParserNode::parseStyleAttribute(), QCss::Parser::parseTerm(), QProcessPrivate::pipeWriterBytesToWrite(), QTextStreamPrivate::putNumber(), QTextStreamPrivate::putString(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QFontEngineQPF::QFontEngineQPF(), QMacSettingsPrivate::QMacSettingsPrivate(), qQuote(), qt_create_commandline(), QTextHtmlImporter::QTextHtmlImporter(), qTopLevelDomain(), QFactoryLoader::refreshAll(), QSettings::remove(), QCoreApplication::removeLibraryPath(), section(), QSqlRelationalTableModel::selectStatement(), QSqlDriver::sqlStatement(), QIBaseDriver::tables(), QTextStreamPrivate::ungetChar(), QLocalePrivate::unsLongLongToString(), QSpinBoxValidator::validate(), QSettingsPrivate::variantToString(), QTextOdfWriter::writeInlineCharacter(), and QDeclarativeInfo::~QDeclarativeInfo().
|
inline |
|
inline |
Definition at line 432 of file qstring.h.
|
inline |
Definition at line 434 of file qstring.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
Definition at line 1437 of file qstring.cpp.
QString & QString::remove | ( | int | position, |
int | n | ||
) |
Removes n characters from the string, starting at the given position index, and returns a reference to the string.
If the specified position index is within the string, but position + n is beyond the end of the string, the string is truncated at the specified position.
Definition at line 1867 of file qstring.cpp.
Referenced by QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), cleanPath(), composeHelper(), QTextStreamPrivate::consume(), QScriptDebuggerConsole::consumeInput(), createUseNode(), QKeySequencePrivate::decodeString(), QDomCharacterDataPrivate::deleteData(), QAccessibleSimpleEditableTextInterface::deleteText(), elliditide(), filterDisplayOffset(), filterTransformation(), fixedCDataSection(), fixedComment(), fixedPIData(), fixedPubidLiteral(), fixedSystemLiteral(), QSpinBox::fixup(), QDoubleSpinBox::fixup(), QTest::formatResult(), QPatternist::DerivedInteger< DerivedType >::fromLexical(), QGtkStylePrivate::getThemeName(), QMessageBoxPrivate::hideSpecial(), QSQLiteResultPrivate::initColumns(), QLineControl::internalDelete(), QLineControl::internalRedo(), QLineControl::internalUndo(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QFSFileEnginePrivate::longFileName(), QWSServerPrivate::newMouseHandler(), QSettingsPrivate::normalizedKey(), QAxClientSite::OnPosRectChange(), QSQLiteDriver::open(), QTest::outputMessage(), QTextHtmlParser::parseEntity(), QCss::Parser::parseSimpleSelector(), QCss::Parser::parseTerm(), qExtractSecurityPolicyFromString(), qt_accStripAmp(), qt_mac_menu_merge_action(), qt_parseSpoolInterface(), qt_setWindowTitle_helperHelper(), qt_strippedText(), qt_tildeExpansion(), qt_wce_insert_action(), qt_wce_rename_menu_item(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), qt_win_make_OFN(), readLink(), QDir::relativeFilePath(), removeOptionalQuotes(), QLineControl::removeSelectedText(), QFileSystemEntry::resolveFilePath(), QFileDialog::selectFile(), QNetworkCookieJar::setCookiesFromUrl(), QPluginLoader::setFileName(), QSvgNode::styleProperty(), QStyleSheetStyle::styleRules(), QMenuPrivate::QMacMenuPrivate::syncAction(), QSpinBox::textFromValue(), QDoubleSpinBox::textFromValue(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QSystemLocalePrivate::toCurrencyString(), QUrl::toLocalFile(), QCss::Parser::unquotedLexem(), QSpinBoxPrivate::validateAndInterpret(), QDoubleSpinBoxPrivate::validateAndInterpret(), and xic_draw_callback().
QString & QString::remove | ( | QChar | ch, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Removes every occurrence of the character ch in this string, and returns a reference to this string.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Example:
This is the same as replace
(ch, "", cs).
Definition at line 1920 of file qstring.cpp.
QString & QString::remove | ( | const QString & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Removes every occurrence of the given str string in this string, and returns a reference to this string.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
This is the same as replace
(str, "", cs).
Definition at line 1895 of file qstring.cpp.
Removes every occurrence of the regular expression rx in the string, and returns a reference to the string.
For example:
Definition at line 295 of file qstring.h.
QString QString::repeated | ( | int | times | ) | const |
Returns a copy of this string repeated the specified number of times.
If times is less than 1, an empty string is returned.
Example:
Definition at line 6657 of file qstring.cpp.
Definition at line 2005 of file qstring.cpp.
Referenced by _q_escapeIdentifier(), QUnixPrintWidgetPrivate::_q_printerChanged(), QFileDialogPrivate::_q_useNameFilter(), QDeclarativeImportsPrivate::add(), QDeclarativeImportDatabase::addImportPath(), QStyleSheetStyleSelector::attribute(), QAccessibleTextWidget::attributes(), QDir::cleanPath(), QDateTimeEditPrivate::clearSection(), comify(), QWindowsMimeText::convertToMime(), createSvgNode(), QScriptDebuggerLocalsModel::data(), decomposeHelper(), QSvgText::draw(), QTextHtmlExporter::emitBlock(), encodeText(), QDeclarativeDirParser::errors(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPatternist::ReplaceFN::evaluateSingleton(), QSqlResult::exec(), find_translation(), findInBlock(), QMacPasteboardMimeAny::flavorFor(), QTextStreamPrivate::flushWriteBuffer(), QSqlDriver::formatValue(), QMYSQLDriver::formatValue(), QPSQLDriver::formatValue(), QBBSystemLocaleData::getCorrectFormat(), QComboMenuDelegate::getStyleOption(), QApplicationPrivate::globalEventProcessor(), QSvgSwitch::init(), QXmlSimpleReaderPrivate::insertXmlRef(), QLineControl::internalDelete(), QLineControl::internalInsert(), launchWebBrowser(), QAxServerBase::Load(), QLibraryInfo::location(), QFSFileEnginePrivate::longFileName(), QSharedMemoryPrivate::makePlatformSafeKey(), mapToLowerCase(), QProgressBar::minimumSizeHint(), QPatternist::XsdTypeChecker::normalizedValue(), QPSQLDriver::open(), QSplitter::operator>>(), QGraphicsSimpleTextItem::paint(), QDateTimeParser::parse(), QPatternist::PatternPlatform::parsePattern(), QDateTimeParser::parseSection(), QProcessPrivate::pipeWriterBytesToWrite(), QHttpNetworkConnectionPrivate::prepareRequest(), QCss::Scanner::preprocess(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QDeclarativeScriptEngine::QDeclarativeScriptEngine(), QFontEngineQPF::QFontEngineQPF(), qQuote(), qt_accStripAmp(), qt_create_commandline(), qt_mac_extract_filter(), qt_mac_menu_merge_action(), qt_setWindowTitle_helperHelper(), qt_tildeExpansion(), qt_win_get_existing_directory(), quoteNewline(), readSymLink(), QLineControl::removeSelectedText(), QByteArray::replace(), replace(), QDomCharacterDataPrivate::replaceData(), replacePercentN(), QAccessibleSimpleEditableTextInterface::replaceText(), QDeclarativeXMLHttpRequest::requestFromUrl(), QDeclarativeImportsPrivate::resolvedUri(), QDeclarativeTypeData::resolveTypes(), QAxServerBase::Save(), QAction::setText(), QUrl::setUrl(), QDesktopServices::storageLocation(), stripTextDecl(), tabTextFor(), QAccessibleMdiSubWindow::text(), QGraphicsSimpleTextItemPrivate::updateBoundingRect(), QMdiSubWindowPrivate::updateInternalWindowTitle(), QDeclarativeTextPrivate::updateLayout(), QFontDialogPrivate::updateStyles(), WinMain(), QDBusMetaObjectGenerator::write(), QXmlStreamWriter::writeCDATA(), and xic_draw_callback().
Definition at line 1983 of file qstring.cpp.
Replaces n characters beginning at index position with the string after and returns a reference to this string.
Example:
Definition at line 1970 of file qstring.cpp.
QString & QString::replace | ( | QChar | before, |
QChar | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2230 of file qstring.cpp.
QString & QString::replace | ( | const QChar * | before, |
int | blen, | ||
const QChar * | after, | ||
int | alen, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2121 of file qstring.cpp.
QString & QString::replace | ( | const QLatin1String & | before, |
const QLatin1String & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2267 of file qstring.cpp.
QString & QString::replace | ( | const QLatin1String & | before, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2297 of file qstring.cpp.
QString & QString::replace | ( | const QString & | before, |
const QLatin1String & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2323 of file qstring.cpp.
QString & QString::replace | ( | const QString & | before, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2031 of file qstring.cpp.
QString & QString::replace | ( | QChar | c, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2176 of file qstring.cpp.
QString & QString::replace | ( | QChar | c, |
const QLatin1String & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 2349 of file qstring.cpp.
Definition at line 3072 of file qstring.cpp.
|
private |
Definition at line 2039 of file qstring.cpp.
Referenced by replace().
|
inline |
Attempts to allocate memory for at least size characters.
If you know in advance how large the string will be, you can call this function, and if you resize the string often you are likely to get better performance. If size is an underestimate, the worst that will happen is that the QString will be a bit slower.
The sole purpose of this function is to provide a means of fine tuning QString's memory usage. In general, you will rarely ever need to call this function. If you want to change the size of the string, call resize().
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 large enough to make a call to reserve() worthwhile:
Definition at line 881 of file qstring.h.
Referenced by QDBusConnectionPrivate::activateCall(), QTextHtmlImporter::appendNodeText(), QXmlStreamReaderPrivate::clearTextBuffer(), QPatternist::ColoringMessageHandler::colorifyDescription(), Qt::escape(), QRegExp::escape(), QPatternist::escape(), QPatternist::TranslateFN::evaluateSingleton(), QMYSQLDriver::formatValue(), QXmlStreamReaderPrivate::getChar_helper(), QDBusConnectionPrivate::handleSignal(), QScriptSyntaxHighlighter::highlightBlock(), QXmlStreamReaderPrivate::init(), QSettingsPrivate::iniUnescapedKey(), QCss::ValueExtractor::lengthValue(), QCss::Symbol::lexem(), QSqlResultPrivate::namedToPositionalBinding(), QScriptEnginePrivate::newRegExp(), QPatternist::XQueryTokenizer::nextToken(), QPatternist::XQueryTokenizer::normalizeEOL(), operator+=(), QDeclarativeStyledTextPrivate::parse(), QPatternist::ReplaceFN::parseReplacement(), QSqlResultPrivate::positionalToNamedBinding(), QDBusConnectionPrivate::prepareHook(), qIsEffectiveTLD(), qReplacePlaceholderMarkers(), QtPrivate::QStringList_join(), qt_ACE_do(), QXmlFormatterPrivate::QXmlFormatterPrivate(), QConfFileSettingsPrivate::readIniSection(), QSqlRelationalTableModelPrivate::relationField(), repeated(), replace(), QSqlDriver::sqlStatement(), QPatternist::HexBinary::stringValue(), QTextBlock::text(), QTextHtmlExporter::toHtml(), QPatternist::XQueryTokenizer::tokenizeStringLiteral(), QProcessEnvironmentPrivate::toList(), typeNameToXml(), QXmlSerializer::writeEscaped(), QXmlStreamWriterPrivate::writeEscaped(), QXmlSerializer::writeEscapedAttribute(), and QPatternist::AbstractDateTime::zoneOffsetToString().
void QString::resize | ( | int | size | ) |
Sets the size of the string to size characters.
If size is greater than the current size, the string is extended to make it size characters long with the extra characters added to the end. The new characters are uninitialized.
If size is less than the current size, characters are removed from the end.
Example:
If you want to append a certain number of identical characters to the string, use operator+=() as follows rather than resize():
If you want to expand the string so that it reaches a certain width and fill the new positions with a particular character, use the leftJustified() function:
If size is negative, it is equivalent to passing zero.
Definition at line 1353 of file qstring.cpp.
Referenced by _q_parseUnixDir(), QXmlStreamPrivateTagStack::addToStringStorage(), append(), chop(), QXmlStreamReaderPrivate::clearTextBuffer(), QTextDocumentPrivate::compressPieceTable(), QWindowsMimeText::convertFromMime(), QBuiltInMimes::convertFromMime(), QGb18030Codec::convertToUnicode(), QIsciiCodec::convertToUnicode(), QGbkCodec::convertToUnicode(), QUtf32::convertToUnicode(), QGb2312Codec::convertToUnicode(), QPatternist::CompressedWhitespace::decompress(), expand(), QXmlStreamReaderPrivate::fastScanContentCharList(), QXmlStreamReaderPrivate::fastScanName(), QXmlStreamReaderPrivate::fastScanNMTOKEN(), fill(), QTextStreamPrivate::fillReadBuffer(), fromStdWString(), QXmlStreamReaderPrivate::getChar_helper(), getEnglishName(), QSettingsPrivate::iniUnescapedStringList(), leftJustified(), QResourceRoot::name(), operator+=(), operator>>(), QTextDocumentPrivate::plainText(), qt_ACE_do(), qt_nameprep(), QtWndProc(), QXmlFormatterPrivate::QXmlFormatterPrivate(), remove(), replace(), replace_helper(), rightJustified(), QXmlStreamReaderPrivate::scanString(), QXmlStreamReaderPrivate::scanUntil(), setUnicode(), toLower(), toPunycodeHelper(), QTextDecoder::toUnicode(), toUpper(), truncate(), updateValue(), and QXIMInputContext::x11FilterEvent().
QString QString::right | ( | int | n | ) | const |
Returns a substring that contains the n rightmost characters of the string.
The entire string is returned if n is greater than size() or less than zero.
Definition at line 3682 of file qstring.cpp.
Referenced by _q_escapeIdentifier(), QKeySequence::assign(), computeElidedText(), QNativeWifiEngine::disconnectFromId(), DumpIDL(), QFileSystemEngine::fillPermissions(), QPatternist::NamePool::fromClarkName(), QUrl::fromLocalFile(), getLocations(), QGtkStylePrivate::getThemeName(), QLCDNumberPrivate::internalSetString(), isUncRoot(), loadEngine(), menuItemEntry(), QGtkStyle::pixelMetric(), qIsEffectiveTLD(), qSplitTableAndOwner(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qt_set_x11_resources(), qTopLevelDomain(), QUrlPrivate::setUserInfo(), QMenuPrivate::QMacMenuPrivate::syncAction(), and UpdateRegistry().
QString QString::rightJustified | ( | int | width, |
QChar | fill = QLatin1Char(' ') , |
||
bool | truncate = false |
||
) | const |
Returns a string of size() width that contains the fill character followed by the string.
For example:
If truncate is false and the size() of the string is more than width, then the returned string is a copy of the string.
If truncate is true and the size() of the string is more than width, then the resulting string is truncated at position width.
Definition at line 5357 of file qstring.cpp.
Referenced by getFmtString(), QLCDNumberPrivate::internalSetString(), and vsprintf().
QStringRef QString::rightRef | ( | int | n | ) | const |
Returns a substring reference to the n rightmost characters of the string.
If n is greater than size() or less than zero, a reference to the entire string is returned.
Definition at line 9068 of file qstring.cpp.
|
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 behavior, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see SectionFlags.
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.
Definition at line 781 of file qstring.h.
Referenced by EGLNullWSScreen::connect(), QConnmanEngine::connectToId(), QDeclarativeListViewPrivate::createItem(), QConnmanEngine::disconnectFromId(), QConnmanEngine::isRoamingAllowed(), qt_init(), QVNCIntegration::QVNCIntegration(), section(), QSqlRelationalTableModel::selectStatement(), and QDeclarativeListViewPrivate::updateCurrentSection().
QString QString::section | ( | const QString & | in_sep, |
int | start, | ||
int | end = -1 , |
||
SectionFlags | flags = SectionDefault |
||
) | const |
Definition at line 3526 of file qstring.cpp.
QString QString::section | ( | const QRegExp & | reg, |
int | start, | ||
int | end = -1 , |
||
SectionFlags | flags = SectionDefault |
||
) | const |
Definition at line 3597 of file qstring.cpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 729 of file qstring.h.
Referenced by number(), QLabel::setNum(), and setNum().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 731 of file qstring.h.
|
inline |
Sets the string to the printed value of n in the specified base, and returns a reference to the string.
The base is 10 by default and must be between 2 and 36. For bases other than 10, n is treated as an unsigned integer.
The formatting always uses QLocale::C, i.e., English/UnitedStates. To get a localized string representation of a number, use QLocale::toString() with the appropriate locale.
Definition at line 733 of file qstring.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 735 of file qstring.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 737 of file qstring.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 739 of file qstring.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6307 of file qstring.cpp.
QString & QString::setNum | ( | qulonglong | n, |
int | base = 10 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6323 of file qstring.cpp.
|
inline |
Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 741 of file qstring.h.
QString & QString::setNum | ( | double | n, |
char | format = 'g' , |
||
int | precision = 6 |
||
) |
Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The format can be 'f', 'F', 'e', 'E', 'g' or 'G' (see the arg() function documentation for an explanation of the formats).
Unlike QLocale::toString(), this function doesn't honor the user's locale settings.
Definition at line 6364 of file qstring.cpp.
Resets the QString to use the first size Unicode characters in the array unicode.
The data in unicode is not copied. The caller must be able to guarantee that unicode will not be deleted or modified as long as the QString (or an unmodified copy of it) exists.
This function can be used instead of fromRawData() to re-use existings QString objects to save memory re-allocations.
Definition at line 7707 of file qstring.cpp.
Resizes the string to size characters and copies unicode into the string.
If unicode is 0, nothing is copied, but the string is still resized to size.
Definition at line 4377 of file qstring.cpp.
Referenced by setUtf16().
Resizes the string to size characters and copies unicode into the string.
If unicode is 0, nothing is copied, but the string is still resized to size.
Note that unlike fromUtf16(), this function does not consider BOMs and possibly differing byte ordering.
Definition at line 882 of file qstring.h.
Referenced by vsprintf().
QString QString::simplified | ( | ) | const |
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space.
Whitespace means any character for which QChar::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.
Example:
Definition at line 4415 of file qstring.cpp.
Referenced by QPatternist::AccelTreeBuilder< true >::attribute(), comify(), QSvgText::draw(), QPatternist::Base64Binary::fromLexical(), QPatternist::XsdTypeChecker::fromLexical(), QPatternist::DerivedString< TypeToken >::fromLexical(), QImageReaderPrivate::getText(), QPatternist::XsdTypeChecker::normalizedValue(), QIBaseDriver::open(), QMYSQLDriver::open(), QSplitter::operator>>(), QHostAddressPrivate::parse(), QDateTimeParser::parse(), QXmlStreamReaderPrivate::parse(), QPatternist::XsdSchemaParser::parseGlobalElement(), QHttpResponseHeader::parseLine(), QHttpRequestHeader::parseLine(), QIBaseDriver::primaryIndex(), QTDSDriver::primaryIndex(), QFtpPI::processReply(), QTextHtmlImporter::processSpecialNodes(), QPatternist::AttributeConstructor::processValue(), QPatternist::XsdValidatingInstanceReader::qNameAttribute(), qODBCWarn(), qParseOpts(), qt_parseEtcLpPrinters(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_parseQconfig(), qt_parseSpoolInterface(), qt_perhapsAddPrinter(), qt_set_x11_resources(), qt_strip_filters(), QPatternist::XsdSchemaParser::readNameAttribute(), QPngHandlerPrivate::readPngTexts(), QPatternist::XsdSchemaParser::readQNameAttribute(), QIBaseResult::record(), QIBaseDriver::record(), QTDSDriver::record(), set_text(), QImageWriter::setText(), styleStringHelper(), QIBaseDriver::tables(), QTDSDriver::tables(), QPatternist::AnyURI::toQUrl(), and QPatternist::XsdValidatingInstanceReader::validateElementComplexType().
|
inline |
Returns the number of characters in this string.
The last character in the string is at position size() - 1. In addition, QString ensures that the character at position size() is always '\0', so that you can use the return value of data() and constData() as arguments to functions that expect '\0'-terminated strings.
Example:
Definition at line 102 of file qstring.h.
Referenced by QDateTimeEditPrivate::_q_editorCursorPositionChanged(), QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged(), _q_resolveEntryAndCreateLegacyEngine_recursive(), QWindowsFileSystemWatcherEngine::addPaths(), QXmlStreamPrivateTagStack::addToStringStorage(), append(), QTextHtmlImporter::appendNodeText(), QConcatenable< QString >::appendTo(), QStringRef::appendTo(), QTextHtmlParser::applyAttributes(), at(), QStringRef::at(), QDirModelPrivate::children(), QConfFileSettingsPrivate::children(), QMacSettingsPrivate::children(), QXmlStreamReaderPrivate::clearSym(), QDateTimeEditPrivate::closestSection(), QPatternist::ColoringMessageHandler::colorifyDescription(), comify(), QScriptCompletionTaskPrivate::completeScriptExpression(), QTextDocumentPrivate::compressPieceTable(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QTextStreamPrivate::consume(), containsProhibitedOuptut(), QDialog::contextMenuEvent(), QAbstractConcatenable::convertFromAscii(), QStringBuilder< A, B >::convertTo(), count(), QStringRef::count(), QCalendarDateValidator::countRepeat(), countRepeat(), QScriptDebuggerConsolePrivate::createJob(), QScriptDeclarativeClass::createPersistentIdentifier(), QLocalePrivate::dateTimeToString(), QPatternist::CompressedWhitespace::decompress(), QDeclarativeJS::TextWriter::doReplace(), driveSpec(), elliditide(), QSettings::endArray(), QSettings::endGroup(), endsWith(), QStringRef::endsWith(), QScriptDebuggerCodeView::event(), QSQLiteResult::exec(), QODBCResult::exec(), QXmlStreamReaderPrivate::fastScanContentCharList(), QXmlStreamReaderPrivate::fastScanName(), QXmlStreamReaderPrivate::fastScanNMTOKEN(), QXmlInputSource::fetchData(), fileName(), QFileSystemEngine::fillMetaData(), QTextStreamPrivate::fillReadBuffer(), QDateTimeParser::findAmPm(), QDateTimeParser::findDay(), QFileSystemEntry::findFileNameSeparators(), QFileSystemEntry::findLastSeparator(), QDateTimeParser::findMonth(), QResourceRoot::findNode(), fixedCharData(), fixedXmlName(), QTextStreamPrivate::flushWriteBuffer(), fromLatin1_helper(), fromRawData(), QDateTime::fromString(), fromUcs4(), fromUtf16(), QWindowsAccessible::get_accDescription(), QWindowsAccessible::get_accHelp(), QWindowsAccessible::get_accKeyboardShortcut(), QWindowsAccessible::get_accName(), QTextStreamPrivate::getChar(), QXmlStreamReaderPrivate::getChar(), QXmlStreamReaderPrivate::getChar_helper(), getFmtString(), QFileSystemEngine::getLinkTarget(), getLocations(), getVariables(), QRawFont::glyphIndexesForString(), hasUnquotedAP(), QStringMatcher::indexIn(), indexOf(), QStringRef::indexOf(), iniChopTrailingSpaces(), QSettingsPrivate::iniEscapedKey(), QSettingsPrivate::iniEscapedString(), QSettingsPrivate::iniUnescapedStringList(), QTextDocumentPrivate::insert(), isDirPath(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QMYSQLDriver::isIdentifierEscapedImplementation(), QODBCDriver::isIdentifierEscapedImplementation(), QSqlDriver::isIdentifierEscapedImplementation(), QUrl::isParentOf(), XPThemeData::isValid(), QAbstractSpinBox::keyPressEvent(), lastIndexOf(), QStringRef::lastIndexOf(), macToQtFormat(), mapToLowerCase(), QDirIteratorPrivate::matchesFilters(), QMacPasteboardMimeAny::mimeFor(), QLastResortMimes::mimeForFormat(), QSqlResultPrivate::namedToPositionalBinding(), QFileSystemEngine::nativeAbsoluteFilePath(), QSettingsPrivate::normalizedKey(), operator+=(), QByteArray::operator<(), QByteArray::operator<=(), QStringRef::operator=(), QStringRef::operator==(), QByteArray::operator>(), QByteArray::operator>=(), operator[](), QDateTimeParser::parse(), QXmlStreamReaderPrivate::parse(), QTextHtmlParser::parseAttributes(), parseCombinedArgString(), QDateTimeParser::parseFormat(), parseIp6(), QDateTimeParser::parseSection(), QTextHtmlParser::parseTag(), QXmlStreamReaderPrivate::peekChar(), QGtkStyle::pixelMetric(), populate_database(), QSqlResultPrivate::positionalToNamedBinding(), QDateTimeParser::potentialValue(), QSQLiteResult::prepare(), QSqlResult::prepare(), QCss::Scanner::preprocess(), QXmlNamespaceSupport::processName(), QPatternist::NamespaceSupport::processName(), QXmlStreamReaderPrivate::putReplacement(), QXmlStreamReaderPrivate::putReplacementInAttributeValue(), QTextStreamPrivate::putString(), QXmlStreamReaderPrivate::putString(), QXmlStreamReaderPrivate::putStringLiteral(), qHash(), QIconTheme::QIconTheme(), qIsEffectiveTLD(), QString(), QtPrivate::QStringList_join(), QStringMatcher::QStringMatcher(), QStringRef::QStringRef(), qt_ACE_do(), qt_is_idn_enabled(), qt_mac_removeMnemonics(), qt_nameprep(), qt_readEscapedFormatString(), qt_repeatCount(), qt_string_count(), qt_strippedText(), qt_u_strToCase(), qt_win_get_save_file_name(), qTopLevelDomain(), QtWndProc(), QXmlStreamAttribute::QXmlStreamAttribute(), QTextStreamPrivate::read(), QXmlStreamReader::readElementText(), readLink(), QTextStreamPrivate::readPtr(), readSymLink(), QSqlRelationalTableModelPrivate::relationField(), QDir::relativeFilePath(), remove(), replace(), resize(), rotateSlashesDotsAndMiddots(), QWhatsThisPrivate::say(), QTextStreamPrivate::scan(), QXmlStreamReaderPrivate::scanString(), QXmlStreamReaderPrivate::scanUntil(), QDateTimeEditPrivate::sectionAt(), QDateTimeParser::sectionMaxSize(), QTextStream::seek(), QSettings::setArrayIndex(), QStringMatcher::setCaseSensitivity(), QWSRegionCommand::setData(), QCalendarDateValidator::setFormat(), QStringMatcher::setPattern(), setRawData(), QWorkspacePrivate::showMaximizeControls(), QConcatenable< QString >::size(), QDateTimeParser::skipToNextSection(), QFileSystemEngine::slowCanonicalized(), split(), QXmlNamespaceSupport::splitName(), startsWith(), QStringRef::startsWith(), QSettingsPrivate::stringToVariant(), QPatternist::AbstractFloat< isDouble >::stringValue(), QAbstractSpinBoxPrivate::stripped(), QAccessibleMenu::text(), timeFormatContainsAP(), QFileDialogPrivate::toInternal(), QTextDocument::toPlainText(), QUrl::toPunycode(), toPunycodeHelper(), toSQLTCHAR(), QPatternist::Decimal::toString(), truncate(), tryDriveUNCFallback(), QSystemLocalePrivate::uiLanguages(), unquote(), QDateTimeEditPrivate::updateEdit(), QAbstractSpinBoxPrivate::updateEdit(), QSpinBoxValidator::validate(), QRegExpValidator::validate(), QDateTimeEditPrivate::validateAndInterpret(), QDoubleSpinBoxPrivate::validateAndInterpret(), QSystemLocalePrivate::winToQtFormat(), QTextStreamPrivate::write(), QXmlStreamWriterPrivate::writeEscaped(), and xpmHash().
QStringList QString::split | ( | const QString & | sep, |
SplitBehavior | behavior = KeepEmptyParts , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
If sep does not match anywhere in the string, split() returns a single-element list containing this string.
cs specifies whether sep should be matched case sensitively or case insensitively.
If behavior is QString::SkipEmptyParts, empty entries don't appear in the result. By default, empty entries are kept.
Example:
Definition at line 6526 of file qstring.cpp.
Referenced by QScript::__setupPackage__(), QScriptEngine::availableExtensions(), QCss::StyleSelector::basicSelectorMatches(), Maemo::conn_settings_notify_func(), EGLNullWSScreen::connect(), QQnxScreen::connect(), QVNCScreen::connect(), QVFbScreen::connect(), QMultiScreen::connect(), PvrEglScreen::connect(), QLinuxFbScreen::connect(), QLinuxFbIntegration::connect(), QDirectFBScreen::connect(), convertWithPalette(), QPlatformIntegrationFactory::create(), QScriptDebuggerConsolePrivate::createJob(), createSvgNode(), QScriptDebuggerLocalsModel::data(), determineScreenSize(), QGtkStylePrivate::extract_filter(), familyList(), QWSSoundServerPrivate::feedDevice(), QDeclarativeStateGroupPrivate::findTransition(), QDate::fromString(), QFont::fromString(), QDateTime::fromString(), QImageReaderPrivate::getText(), QGtkStylePrivate::getThemeName(), QScriptToolTipJob::handleResponse(), QGuiPlatformPlugin::iconThemeSearchPaths(), QScriptEngine::importExtension(), QDirModel::index(), QDeclarativePropertyPrivate::initProperty(), QPatternist::XSLTTokenizer::insideTemplate(), QLibrary::isLibrary(), QPatternist::XPathHelper::isQName(), QDBusUtil::isValidBusName(), QDBusUtil::isValidInterfaceName(), QDBusUtil::isValidObjectPath(), QPatternist::XsdTypeChecker::isValidString(), QDBusUtil::isValidUniqueConnectionName(), QMetaEnum::keysToValue(), QStringList::lastIndexOf(), libGreaterThan(), libraryPathList(), QCoreApplication::libraryPaths(), QSystemLibrary::load(), QAxServerBase::Load(), QLibraryInfo::location(), QResourceRoot::mappingRootSubdir(), QFileSystemModelPrivate::node(), QDBusConnection::objectRegisteredAt(), QIBaseDriver::open(), QSQLiteDriver::open(), QDB2Driver::open(), QMYSQLDriver::open(), QWSServer::openKeyboard(), QWSServer::openMouse(), operator<<(), QHttpHeader::parse(), parseAnimateColorNode(), QPatternist::XsdSchemaParser::parseAny(), QPatternist::XsdSchemaParser::parseAnyAttribute(), QPatternist::XsdSchemaParser::parseGlobalElement(), parseIp4(), parseIp6(), QHttpRequestHeader::parseLine(), QPatternist::XsdSchemaParser::parseSchema(), QHostAddress::parseSubnet(), QPatternist::XsdSchemaParser::parseUnion(), QGtkStyle::pixelMetric(), QTDSDriver::primaryIndex(), QFtpPI::processReply(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QDeclarativeImportDatabase::QDeclarativeImportDatabase(), qExtractSecurityPolicyFromString(), qGetODBCVersion(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), qOpenGLVersionFlagsFromString(), qParseOpts(), qSplitTableQualifier(), QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(), qt_clean_filter_list(), qt_getDefaultFromHomePrinters(), QApplicationPrivate::qt_mac_apply_settings(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qt_make_filter_list(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_tildeExpansion(), qt_win_extract_filter(), qTopLevelDomain(), QWin32PrintEnginePrivate::queryDefault(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSPcMouseHandlerPrivate::QWSPcMouseHandlerPrivate(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), rasterFallbacksMask(), QPatternist::XsdSchemaParser::readBlockingConstraintAttribute(), QPatternist::XsdSchemaParser::readDerivationConstraintAttribute(), registerFont(), QDBusConnection::registerObject(), QDir::relativeFilePath(), QAxServerBase::Save(), section(), set_text(), QSslSocket::setCiphers(), QDirectFBScreenPrivate::setFlipFlags(), QScriptExtensionPlugin::setupPackage(), QDirPrivate::splitFilters(), QFSCompleter::splitPath(), QCompleter::splitPath(), QPatternist::XPathHelper::splitQName(), QProcessPrivate::startDetached(), QProcessPrivate::startProcess(), stringToList(), QFileDialogPrivate::typedFiles(), uncShareExists(), QDBusConnection::unregisterObject(), QPatternist::XsdValidatingInstanceReader::validate(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateElementSimpleType(), QPatternist::XsdTypeChecker::valuesAreEqual(), and QApplicationPrivate::x11_apply_settings().
QStringList QString::split | ( | const QChar & | sep, |
SplitBehavior | behavior = KeepEmptyParts , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 6546 of file qstring.cpp.
QStringList QString::split | ( | const QRegExp & | rx, |
SplitBehavior | behavior = KeepEmptyParts |
||
) | const |
Splits the string into substrings wherever the regular expression rx matches, and returns the list of those strings.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
If rx does not match anywhere in the string, split() returns a single-element list containing this string.
Here's an example where we extract the words in a sentence using one or more whitespace characters as the separator:
Here's a similar example, but this time we use any sequence of non-word characters as the separator:
Here's a third example where we use a zero-length assertion, \b (word boundary), to split the string into an alternating sequence of non-word and word tokens:
Definition at line 6591 of file qstring.cpp.
QString & QString::sprintf | ( | const char * | cformat, |
... | |||
) |
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments.
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::utf16()).
The format string supports most of the conversion specifiers provided by printf() in the standard C++ library. It doesn't honor the length modifiers (e.g. h
for short
, ll
for long long
). If you need those, use the standard snprintf() function instead:
For QObject::tr(){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.
Definition at line 5567 of file qstring.cpp.
Referenced by QVNCScreenPrivate::configure(), decodeMSG(), QHashData::destroyAndFree(), double2string(), int2string(), QColor::name(), QMapData::node_delete(), qt_parseEtcLpPrinters(), QHostAddress::toString(), and write_xpm_image().
|
inline |
Releases any memory not required to store the character data.
The sole purpose of this function is to provide a means of fine tuning QString's memory usage. In general, you will rarely ever need to call this function.
Definition at line 114 of file qstring.h.
Referenced by QTextDocumentPrivate::compressPieceTable(), QSettingsPrivate::iniUnescapedStringList(), QSqlResultPrivate::namedToPositionalBinding(), QSqlResultPrivate::positionalToNamedBinding(), and qReplacePlaceholderMarkers().
bool QString::startsWith | ( | const QString & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the string starts with s; otherwise returns false.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Definition at line 3734 of file qstring.cpp.
Referenced by QFileDialogPrivate::_q_autoCompleteFileName(), QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(), _q_parseUnixDir(), QFontComboBoxPrivate::_q_updateModel(), QFileDialogPrivate::_q_updateOkButton(), QFtpPI::abort(), QNSOpenSavePanelDelegate::acceptableExtensionsForSave, QIcdEngine::addConfiguration(), addFontToDatabase(), QLocalServerPrivate::addListener(), QResource::addSearchPath(), QTextCodec::availableCodecs(), QTextCodec::availableMibs(), QCss::StyleSelector::basicSelectorMatches(), QUnsortedModelEngine::buildIndices(), QWindowsMimeText::canConvertToMime(), QDir::cd(), QMacSettingsPrivate::children(), cleanPath(), QODBCDriver::cleanup(), QDeclarativeStringConverters::colorFromString(), QDeclarativeConnectionsParser::compile(), QScriptDebuggerConsoleCommandManager::completions(), QVNCScreen::connect(), QVFbScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QLinuxFbScreen::connect(), QLocalSocket::connectToServer(), QScriptDebuggerConsole::consumeInput(), QMacPasteboardMimeHTMLText::convertFromMime(), QTextCodecPlugin::create(), createImageNode(), QDBusMetaObject::createMetaObject(), QDeclarativeListModelParser::definesEmptyList(), QLocalSocketPrivate::destroyPipeHandles(), QTranslatorPrivate::do_load(), QIcdEngine::doRequestUpdate(), QSvgText::draw(), QResourcePrivate::ensureChildren(), QResourcePrivate::ensureInitialized(), QConfFileSettingsPrivate::ensureSectionParsed(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QSQLite2Driver::escapeIdentifier(), QTDSDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), extractEncodingDecl(), familyList(), QSortedModelEngine::filter(), QCompletionEngine::filterHistory(), QDeclarativeImportedNamespace::find(), QNetworkAuthenticationCache::findClosestMatch(), QDateTimeParser::findDay(), QDateTimeParser::findMonth(), QResourceRoot::findNode(), fixIfRelativeUncPath(), QMacPasteboardMimeTiff::flavorFor(), QMacPasteboardMimeUrl::flavorFor(), QMacPasteboardMimeVCard::flavorFor(), QWindowsMimeText::formatsForMime(), QDirectFBPixmapData::fromFile(), QDirectFbBlitterPlatformPixmap::fromFile(), QUrl::fromLocalFile(), QSslCertificate::fromPath(), QDateTime::fromString(), QFileInfoGatherer::getFileInfos(), getFmtString(), getImage(), QFileSystemEngine::getLinkTarget(), getLocations(), getPixmap(), getVariables(), QInternalMimeData::hasFormatHelper(), QUrl::host(), QDirModel::index(), QSQLite2ResultPrivate::init(), QPatternist::XSLTTokenizer::insideSequenceConstructor(), isCustomMimeType(), isDirPath(), QMYSQLDriver::isIdentifierEscapedImplementation(), QODBCDriver::isIdentifierEscapedImplementation(), QSqlDriver::isIdentifierEscapedImplementation(), QPatternist::LangFN::isLangMatch(), QStyleSheetStyle::isNaturalChild(), isParentDomain(), QUrl::isParentOf(), isParentPath(), isPrefixOf(), isSignalPropertyName(), isUncRoot(), QDBusUtil::isValidBusName(), QDBusUtil::isValidObjectPath(), QDBusUtil::isValidUniqueConnectionName(), launchWebBrowser(), QLocalServerPrivate::listen(), QLibraryPrivate::load_sys(), QFSFileEnginePrivate::longFileName(), QAbstractItemModel::match(), QXlibMime::mimeAtomForFormat(), QMacPasteboardMimeAny::mimeFor(), QLastResortMimes::mimeForFormat(), QDirModelPrivate::name(), nameToType(), QFileSystemEngine::nativeAbsoluteFilePath(), QFileSystemModelPrivate::node(), QSQLiteDriver::open(), QStringRef::operator=(), QNSOpenSavePanelDelegate::panel:shouldShowFilename:, parseColorValue(), QDeclarativeBindingCompilerPrivate::parseName(), QFSCompleter::pathFromIndex(), QGtkStyle::pixelMetric(), QHttpNetworkConnectionPrivate::prepareRequest(), QFtpPI::processReply(), QGlobalNetworkProxy::proxyForQuery(), QDBusAbstractInterface::QDBusAbstractInterface(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qDecodeOCIType(), qGetColumnType(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), qmlsqldatabase_executeSql_readonly(), qmlxmlhttprequest_setRequestHeader(), qOpenGLVersionFlagsFromString(), QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(), qt_create_commandline(), qt_mac_menu_merge_action(), qt_parseEtcLpPrinters(), qt_parseSpoolInterface(), qt_resource_fixResourceRoot(), qt_tildeExpansion(), QVNCIntegration::QVNCIntegration(), QWinSettingsPrivate::QWinSettingsPrivate(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), readConf(), readLink(), readSourceFile(), QPatternist::XsdSchemaParser::readXPathAttribute(), QDir::relativeFilePath(), removeOptionalQuotes(), QLocalServerPrivate::removeServer(), QInternalMimeData::renderDataHelper(), QSslSocketPrivate::resetDefaultCiphers(), QDeclarativeImportsPrivate::resolvedUri(), QFileSystemEntry::resolveFilePath(), QDeclarativeImportDatabase::resolvePlugin(), QColor::setColorFromString(), QNetworkCookieJar::setCookiesFromUrl(), QCalendarDateValidator::setFormat(), QDeclarativeXmlListModel::setQuery(), QDeclarativeXmlListModelRole::setQuery(), QTextBrowserPrivate::setSource(), shouldWatchService(), QFtpDTP::socketReadyRead(), QFSCompleter::splitPath(), QCompleter::splitPath(), QFtpPI::startNextCmd(), QSettingsPrivate::stringListToVariantList(), QSettingsPrivate::stringToVariant(), QAbstractSpinBoxPrivate::stripped(), stripTextDecl(), QSvgNode::styleProperty(), QStyleSheetStyle::styleRules(), QNetworkProxyFactory::systemProxyForQuery(), QAudioDeviceInfoInternal::testSettings(), QClipboard::text(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QUrlPrivate::toEncoded(), QFileDialogPrivate::toInternal(), QNetworkCookie::toRawForm(), QUrl::toString(), totalDigitsForSignedLongLong(), QFileInfoGatherer::translateDriveName(), trimmed(), tryDriveUNCFallback(), QSpinBoxValidator::validate(), QSettingsPrivate::variantToString(), QTextOdfWriter::writeInlineCharacter(), QX11Data::xdndMimeAtomForFormat(), and xdndObtainData().
bool QString::startsWith | ( | const QStringRef & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the string starts with the string reference s; otherwise returns false.
If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.
Definition at line 3779 of file qstring.cpp.
bool QString::startsWith | ( | const QLatin1String & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3743 of file qstring.cpp.
bool QString::startsWith | ( | const QChar & | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 3757 of file qstring.cpp.
|
inline |
QByteArray QString::toAscii | ( | ) | const |
Returns an 8-bit representation of the string as a QByteArray.
If a codec has been set using QTextCodec::setCodecForCStrings(), it is used to convert Unicode to 8-bit char; otherwise this function does the same as toLatin1().
Note that, despite the name, this function does not necessarily return an US-ASCII (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
Definition at line 4014 of file qstring.cpp.
Referenced by QXmlTestLogger::addBenchmarkResult(), QTestLogger::addBenchmarkResult(), QIcdEngine::addConfiguration(), QAccessibleWidget::addControllingSignal(), QByteArray::append(), Maemo::appendVariantToDBusMessage(), QMetaObject::connectSlotsByName(), QStringRef::constData(), createImageNode(), QBBRootWindow::createWindowGroup(), QIcdEngine::deleteConfiguration(), QNetworkSessionPrivateImpl::do_open(), QIcdEngine::doRequestUpdate(), QDB2Result::exec(), QTest::formatResult(), fromLatin1(), QBBGLContext::getProcAddress(), QByteArray::indexOf(), QByteArray::insert(), QByteArray::lastIndexOf(), QPatternist::XQueryTokenizer::lookupKeyword(), QTest::mouseEvent(), QAccessibleWidget::navigate(), QLinuxFbIntegrationPrivate::openTty(), QLinuxFbScreenPrivate::openTty(), PvrEglScreen::openTty(), QByteArray::operator+=(), QSplitter::operator>>(), QHttpNetworkConnectionPrivate::prepareRequest(), QTest::printBenchmarkResult(), qstring_to_xtp(), qt_getLprPrinters(), qt_parseEtcLpPrinters(), qt_parsePrintersConf(), QAccessibleWidget::relationTo(), QByteArray::replace(), QSQLite2Result::reset(), QCharRef::row(), subControlLayout(), QImage::textList(), QUrlPrivate::toEncoded(), toStdString(), and write_xbm_image().
QString QString::toCaseFolded | ( | ) | const |
Returns the case folded equivalent of the string.
For most Unicode characters this is the same as toLower().
Definition at line 5441 of file qstring.cpp.
Referenced by qHash().
double QString::toDouble | ( | bool * | ok = 0 | ) | const |
Returns the string converted to a double
value.
Returns 0.0 if the conversion fails.
If a conversion error occurs, *
{ok} is set to false; otherwise *
{ok} is set to true.
Various string formats for floating point numbers can be converted to double values:
This function tries 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.
Due to the ambiguity between the decimal point and thousands group separator in various locales, this function does not handle thousands group separators. If you need to convert such numbers, see QLocale::toDouble().
Definition at line 6227 of file qstring.cpp.
Referenced by QTextHtmlParserNode::applyCssDeclarations(), QPSQLResult::data(), QMYSQLResult::data(), QLCDNumber::display(), QAxBase::dynamicCallHelper(), QPatternist::AbstractFloat< isDouble >::fromLexical(), QCss::ValueExtractor::lengthValue(), parseOpacity(), QDeclarativeStringConverters::pointFFromString(), QWSPcMouseHandlerPrivate::QWSPcMouseHandlerPrivate(), QCss::Declaration::realValue(), QDeclarativeStringConverters::rectFFromString(), QDoubleSpinBoxPrivate::round(), setFloatAttribute(), setWidthAttribute(), QDeclarativeStringConverters::sizeFFromString(), toFloat(), QDeclarativeStringConverters::variantFromString(), and QDeclarativeStringConverters::vector3DFromString().
float QString::toFloat | ( | bool * | ok = 0 | ) | const |
Definition at line 6257 of file qstring.cpp.
Referenced by QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), and QVNCScreen::connect().
int QString::toInt | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | 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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6090 of file qstring.cpp.
Referenced by QFontDialogPrivate::_q_sizeChanged(), QFontDialogPrivate::_q_sizeHighlighted(), QHttpPrivate::_q_slotReadyRead(), QCalendarWidgetPrivate::_q_yearEditingFinished(), QTextHtmlParser::applyAttributes(), QTextCodec::availableMibs(), QCss::Declaration::borderImageValue(), EGLNullWSScreen::connect(), QQnxScreen::connect(), QVFbScreen::connect(), QVNCScreen::connect(), PvrEglScreen::connect(), QLinuxFbScreen::connect(), QLinuxFbIntegration::connect(), QDirectFBScreen::connect(), QMacPasteboardMimeVCard::convertFromMime(), QTextCodecPlugin::create(), QPatternist::AbstractDuration::create(), QPatternist::AbstractDateTime::create(), QMYSQLResult::data(), QKeySequencePrivate::decodeString(), QAxBase::dynamicCallHelper(), filterDisplayOffset(), filterTransformation(), QDate::fromString(), QTime::fromString(), QDateTime::fromString(), getDisplayId(), QSystemLocalePrivate::getLocaleInfo_int(), QBenchmarkValgrindUtils::getNewestFileName(), getNumTok(), QPSQLDriverPrivate::getPSQLVersion(), QBenchmarkValgrindUtils::haveValgrind(), QDeclarativeDebugServer::instance(), intValueHelper(), QAxServerBase::Invoke(), QLibrary::isLibrary(), QLibraryPrivate::isPlugin(), libGreaterThan(), QNativeSocketEnginePrivate::nativeBind(), QNativeSocketEnginePrivate::nativeConnect(), QNativeSocketEnginePrivate::nativeSendDatagram(), QWSServerPrivate::newMouseHandler(), QPSQLResult::numRowsAffected(), QSQLiteDriver::open(), QOCIDriver::open(), QScriptXmlParser::parse(), QDeclarativeDirParser::parse(), parseFont(), QDeclarativeStyledTextPrivate::parseFontAttributes(), QHttpResponseHeader::parseLine(), QPatternist::AbstractDateTime::parseZoneOffset(), QFtpPI::processReply(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), qParseOpts(), qt_init(), qt_socket_setPortAndAddress(), QtWndProc(), QVFbIntegration::QVFbIntegration(), QVNCIntegration::QVNCIntegration(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSPcMouseHandlerPrivate::QWSPcMouseHandlerPrivate(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), read_xbm_header(), setIntAttribute(), setIntOption(), QHttpSocketEngine::slotSocketReadNotification(), QSystemLocalePrivate::toCurrencyString(), QPatternist::XQueryTokenizer::tokenizeCharacterReference(), tokenUntil(), QDateTime::toString(), and vsprintf().
QByteArray QString::toLatin1 | ( | ) | const |
Returns a Latin-1 representation of the string as a QByteArray.
The returned byte array is undefined if the string contains non-Latin1 characters. Those characters may be suppressed or replaced with a question mark.
Definition at line 3993 of file qstring.cpp.
Referenced by QAbstractSocketPrivate::_q_connectToNextAddress(), QHttpPrivate::_q_slotConnected(), QHttpPrivate::_q_slotReadyRead(), QHttpPrivate::_q_slotSendRequest(), QAbstractSocketPrivate::_q_startConnecting(), QXmlStreamReader::addData(), QGLShaderProgram::addShaderFromSourceCode(), QDBusMarshaller::append(), QDBusMarshaller::appendCrossMarshalling(), Maemo::appendVariantToDBusMessage(), QTextHtmlParser::applyAttributes(), QMacStylePrivate::aquaSizeConstrain(), QCoreApplication::arguments(), QStyleSheetStyleSelector::attribute(), QGLShaderProgram::attributeLocation(), QTextCodec::availableCodecs(), QGLShaderProgram::bindAttributeLocation(), buildMatchRule(), QAuthenticatorPrivate::calculateResponse(), QDBusAbstractInterface::callWithArgumentList(), QTextCodec::canEncode(), QUrlPrivate::canonicalHost(), checkHRESULT(), QGLContext::choosePixelFormat(), classIDL(), QGLShader::compileSourceCode(), QVFbScreen::connect(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QLinuxFbScreen::connect(), QProxyScreen::connect(), QLinuxFbIntegration::connect(), QDBusConnection::connect(), QAbstractSocket::connectToHost(), QAbstractSocket::connectToHostImplementation(), QStringRef::constData(), QIconvCodec::convertFromUnicode(), QMacPasteboardMime::convertor(), QWSDisplay::convertSelection(), convertTypes(), QTextCodecPlugin::create(), createForName(), QmlJSDebugger::AbstractViewInspector::createQmlObject(), decodeMSG(), deleteChildGroups(), QAuthenticatorPrivate::digestMd5Response(), QNetworkSessionPrivateImpl::do_open(), QPainter::drawText(), QPdfEnginePrivate::drawTextItem(), QRasterPaintEngine::drawTextItem(), dumpRecursive(), QAxBase::dynamicCallHelper(), QtopiaPrintEngine::end(), QWSClient::errorHandler(), QXmlSimpleReader::feature(), QWSSoundServerPrivate::feedDevice(), QAbstractSocketPrivate::fetchConnectionParameters(), QNativeSocketEnginePrivate::fetchConnectionParameters(), QTextStreamPrivate::fillReadBuffer(), findEncoding(), QAxEventSink::findProperty(), findSlot(), QDBusMetaObjectGenerator::findType(), QMacPasteboardMime::flavorToMime(), fontExists(), QMimeDataWrapper::format(), QDropEvent::format(), fromLatin1(), QHostInfo::fromName(), QHostInfoAgent::fromName(), QHostInfoPrivate::fromName(), QXmlInputSource::fromRawData(), QFont::fromString(), fromUnicode(), QFontEngineWin::getCMap(), getNetWmState(), QWaylandReadbackGlxContext::getProcAddress(), QWaylandReadbackEglContext::getProcAddress(), QGLXContext::getProcAddress(), QWaylandXCompositeGLXContext::getProcAddress(), QGLContext::getProcAddress(), getWinLocaleName(), QApplicationPrivate::globalEventProcessor(), QMimeSourceWrapper::hasFormat(), hasValidSignal(), QSqlDatabasePrivate::init(), QNativeSocketEngine::initialize(), initializeDb(), QAxBase::initializeLicensedHelper(), QDeclarativePropertyPrivate::initProperty(), QAbstractSocketPrivate::initSocketLayer(), QSslSocketBackendPrivate::initSslContext(), QDeclarativeJS::integerFromString(), QAxServerBase::Invoke(), QLibraryPrivate::isPlugin(), QDBusUtil::isValidSignature(), QDBusUtil::isValidSingleSignature(), QMetaEnum::keysToValue(), QTcpServer::listen(), QResourcePrivate::load(), loadFc(), QFontDatabasePrivate::loadFromCache(), loadRaw(), loadWin(), QFontDatabase::loadXlfd(), QSystemTrayIconSys::locateSystemTray(), ShaderEffectItem::lookThroughShaderCode(), QHostInfo::lookupHost(), QScriptStdMessageHandler::message(), MetaObjectGenerator::metaObject(), MetaObjectGenerator::MetaObjectGenerator(), QXlibMime::mimeStringToAtom(), multicastMembershipHelper(), QNativeSocketEnginePrivate::nativeBind(), QNativeSocketEnginePrivate::nativeConnect(), QNativeSocketEnginePrivate::nativeListen(), QNativeSocketEnginePrivate::nativeReceiveDatagram(), QNativeSocketEnginePrivate::nativeSendDatagram(), QTDSDriver::open(), QWSPcMouseHandlerPrivate::openDevices(), QWSSoundServerPrivate::openFile(), operator<<(), QGtkPainter::paintCheckbox(), QGtkPainter::paintOption(), QDateTimeParser::parse(), QUrlPrivate::parse(), parseDateString(), QDateTimeParser::parseFormat(), QHttpResponseHeader::parseLine(), QHttpRequestHeader::parseLine(), QDBusMetaObjectGenerator::parseMethods(), QDBusMetaObjectGenerator::parseProperties(), QDBusMetaObjectGenerator::parseSignals(), Maemo::prepareDBusCall(), QFtpPI::processReply(), QFontEngineWin::properties(), QDBusAbstractInterfacePrivate::property(), qax_noSuchFunction(), qax_readClassInfo(), qax_readInterfaceInfo(), QTest::qCompare(), qDBusReplyFill(), qEncodeNtlmString(), qgl_use_font(), QGLXContext::QGLXContext(), QTest::qPrintDataTags(), QQnxMouseHandler::QQnxMouseHandler(), qStreamNtlmString(), qStringFromUcs2Le(), qt_ACE_do(), qt_create_commandline(), qt_get_screen(), qt_initIcu(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_display_change_callbk(), qt_u_strToCase(), qt_x11_set_fallback_font_family(), QTDSResult::QTDSResult(), QVFbKeyboardHandler::QVFbKeyboardHandler(), QVFbMouseHandler::QVFbMouseHandler(), QVFbScreenKeyboardHandler::QVFbScreenKeyboardHandler(), QVFbScreenMouseHandler::QVFbScreenMouseHandler(), QWaylandSelection::QWaylandSelection(), QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate(), QWSQnxKeyboardHandler::QWSQnxKeyboardHandler(), QXmlStreamReader::QXmlStreamReader(), QAudioInputPrivate::read(), MetaObjectGenerator::readClassInfo(), MetaObjectGenerator::readEnumInfo(), MetaObjectGenerator::readEventInfo(), MetaObjectGenerator::readEventInterface(), MetaObjectGenerator::readFuncsInfo(), MetaObjectGenerator::readInterfaceInfo(), QPatternist::XsdSchemaParser::readNamespaceAttribute(), QPatternist::XsdSchemaParser::readQNameAttribute(), MetaObjectGenerator::readVarsInfo(), QPatternist::XsdSchemaParser::readXPathAttribute(), registerComponent(), registerFont(), QWinSettingsPrivate::remove(), QDeclarativeEngineDebugService::resetBinding(), QWaylandClipboard::retrieveData(), QMimeSourceWrapper::retrieveData(), QPatternist::AccelTreeResourceLoader::retrieveUnparsedText(), QCharRef::row(), QDomDocumentPrivate::saveDocument(), QWSSoundServerClient::sendClientMessage(), QKeyMapper::sendKeyEvent(), QWSServerPrivate::sendQCopEvent(), QWinSettingsPrivate::set(), set_text(), QColor::setColorFromString(), QAxBase::setControl(), QXmlSimpleReader::setFeature(), QPainter::setFont(), QByteArray::setNum(), QTextBrowserPrivate::setSource(), Maemo::DBusDispatcher::setupDBus(), QXlibWindow::setWindowTitle(), sm_setProperty(), QFtpPI::startNextCmd(), QSettingsPrivate::stringToVariant(), QImageWriter::supportedImageFormats(), QImageReader::supportedImageFormats(), QUrl::swap(), QUrl::toAce(), toAscii(), QStringRef::toAscii(), QUrlPrivate::toEncoded(), QNetworkHeadersPrivate::toHttpDate(), QStringBuilder< QString, QString >::toLatin1(), toLocal8Bit(), QStringRef::toLocal8Bit(), QUrl::toPunycode(), QTest::toString(), translateWSAError(), QGLShaderProgram::uniformLocation(), QGLContext::updatePaintDevice(), MetaObjectGenerator::usertypeToString(), winIso639LangName(), QDBusMetaObjectGenerator::write(), QXmlStreamWriterPrivate::write(), QUdpSocket::writeDatagram(), QApplicationPrivate::x11_apply_settings(), QX11Data::xdndMimeStringToAtom(), and QWinSettingsPrivate::~QWinSettingsPrivate().
QByteArray QString::toLocal8Bit | ( | ) | const |
Returns the local 8-bit representation of the string as a QByteArray.
The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.
QTextCodec::codecForLocale() is used to perform the conversion from Unicode. If the locale encoding could not be determined, this function does the same as toLatin1().
If this string contains any characters that cannot be encoded in the locale, the returned byte array is undefined. Those characters may be suppressed or replaced by another.
Definition at line 4049 of file qstring.cpp.
Referenced by QProcessPrivate::_q_notified(), QBasicUnixFontDatabase::addApplicationFont(), QLayout::addChildLayout(), QGraphicsLayoutPrivate::addChildLayoutItem(), QLayout::addChildWidget(), QSqlDatabasePrivate::addDatabase(), QZipWriterPrivate::addEntry(), QResource::addSearchPath(), QGridLayout::addWidget(), arg(), QAudioDeviceInfoInternal::availableDevices(), QCoreApplicationPrivate::checkReceiverThread(), checkWidget(), QPdfBaseEnginePrivate::closePrintDevice(), QDirectFBScreen::connect(), QWSSocket::connectToLocalFile(), QDeclarativeEnginePrivate::consoleLog(), QStringRef::constData(), QWindowsMimeText::convertFromMime(), QWindowsMimeURI::convertFromMime(), QMacPasteboardMimeVCard::convertFromMime(), QLayoutPrivate::createSpacerItem(), QGraphicsAnchorLayoutPrivate::dumpGraph(), dumpRecursive(), QApplicationPrivate::enterModal_sys(), err_info_about_objects(), QSqlQuery::exec(), QPSQLDriverPrivate::exec(), QMinimalWindowSurface::flush(), QTextStreamPrivate::flushWriteBuffer(), QFontconfigDatabase::fontEngine(), QBasicUnixFontDatabase::fontEngine(), QDirectFBPixmapData::fromFile(), QDirectFbBlitterPlatformPixmap::fromFile(), QApplicationPrivate::globalEventProcessor(), QAuServerNAS::init(), QWSServerSocket::init(), init_platform(), initializeDb(), QDirectFbIntegration::initializeDirectFB(), QSqlDatabasePrivate::invalidateDb(), QApplicationPrivate::leaveModal_sys(), loadSingleEngine(), locale_encode(), QXlibMime::mimeDataForAtom(), multiArg(), QIBaseDriver::open(), QAudioDeviceInfoInternal::open(), QTDSDriver::open(), QMYSQLDriver::open(), QAudioInputPrivate::open(), QPSQLDriver::open(), QWSTslibMouseHandlerPrivate::open(), QAudioOutputPrivate::open(), QDeclarativeInfo::operator<<(), QProcessEnvironmentPrivate::OrderedMutexLocker::OrderedMutexLocker(), QAuServerNAS::play(), QSqlQuery::prepare(), qDecodeOCIType(), qErrnoWarning(), QTest::qExec(), qGetInterfaceType(), QLayout::QLayout(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), QLock::QLock(), qParseOpts(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), qSqlWarning(), qt_adopted_thread_watcher_function(), qt_message(), qt_nograb(), qt_tildeExpansion(), QByteArray::qvsnprintf(), qws_dataDir(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), QWSUmKeyboardHandlerPrivate::QWSUmKeyboardHandlerPrivate(), QMYSQLDriver::record(), QResource::registerResource(), QCoreApplicationPrivate::removePostedEvent(), QGraphicsLayoutPrivate::reparentChildItems(), QTDSResult::reset(), QToolBarAreaLayout::saveState(), QWidget::setLayout(), setOptionFlag(), QPrinter::setPrinterName(), QThreadPrivate::start(), QProcessPrivate::startDetached(), QProcessPrivate::startProcess(), QIBaseDriver::subscribeToNotificationImplementation(), QAudioDeviceInfoInternal::testSettings(), WinMain(), QPatternist::ColorOutputPrivate::write(), and QX11Data::xdndMimeDataForAtom().
long QString::toLong | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
Returns the string converted to a long
using base base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6027 of file qstring.cpp.
qint64 QString::toLongLong | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 5943 of file qstring.cpp.
Referenced by _q_parseDosDir(), _q_parseUnixDir(), QPSQLResult::data(), QMYSQLResult::data(), QBenchmarkValgrindUtils::extractResult(), QPatternist::Integer::fromLexical(), QPatternist::DerivedInteger< DerivedType >::fromLexical(), QNetworkAccessFtpBackend::ftpRawCommandReply(), QFtpPI::processReply(), toInt(), toLong(), and toShort().
QString QString::toLower | ( | ) | const |
Returns a lowercase copy of the string.
The case conversion will always happen in the 'C' locale. For locale dependent case folding use QLocale::toLower()
Definition at line 5389 of file qstring.cpp.
Referenced by QFileSystemModelPrivate::_q_directoryChanged(), _q_parseDosDir(), QComboBoxPrivate::_q_returnPressed(), QHttpPrivate::_q_slotReadyRead(), QDeclarativeTypeLoader::absoluteFilePath(), QDeclarativeEngine::addImageProvider(), QWindowsFileSystemWatcherEngine::addPaths(), QUrlModel::addUrls(), QHttpHeader::allValues(), QTextHtmlParser::applyAttributes(), QCss::StyleSheet::buildIndexes(), QUrlPrivate::canonicalHost(), QLocalePrivate::codeToLanguage(), comify(), QPatternist::CaseInsensitiveStringComparator::compare(), QMacPasteboardMimeFileUri::convertFromMime(), QMacPasteboardMimeUrl::convertFromMime(), QMacPasteboardMimeFileUri::convertToMime(), QMacPasteboardMimeUrl::convertToMime(), QNetworkCookieJar::cookiesForUrl(), QVGGraphicsSystemPlugin::create(), ShivaVGGraphicsSystemPlugin::create(), QTraceGraphicsSystemPlugin::create(), QEglIntegrationPlugin::create(), QLinuxFbIntegrationPlugin::create(), QOpenKODEPlugin::create(), QWaylandIntegrationPlugin::create(), QXcbIntegrationPlugin::create(), QXlibIntegrationPlugin::create(), QGLGraphicsSystemPlugin::create(), QBBIntegrationPlugin::create(), QMinimalIntegrationPlugin::create(), QVFbIntegrationPlugin::create(), QVNCIntegrationPlugin::create(), EGLNullWSScreenPlugin::create(), DecorationDefault::create(), DecorationStyled::create(), DecorationWindows::create(), TslibMouseDriver::create(), QAhiScreenPlugin::create(), PvrEglScreenPlugin::create(), QCocoaIntegrationPlugin::create(), QUIKitIntegrationPlugin::create(), DirectFBScreenDriverPlugin::create(), GfxTransformedDriver::create(), QScreenLinuxFbPlugin::create(), ScreenVfbDriver::create(), GfxVncDriver::create(), QDirectFbIntegrationPlugin::create(), QPlatformIntegrationFactory::create(), QNetworkAccessHttpBackendFactory::create(), QNetworkAccessManager::createRequest(), QLocalePrivate::dateTimeToString(), QKeySequencePrivate::decodeString(), QSymSQLResult::exec(), QFileSystemEngine::fillPermissions(), find_translation(), QDateTimeParser::findDay(), QDateTimeParser::findMonth(), QDeclarativeXMLHttpRequest::finished(), QMacPasteboardMimeUnicodeText::flavorFor(), Maemo::ProxyConfPrivate::flush(), QUrl::fromUserInput(), getFontWeight(), QHttpHeader::hasKey(), QDeclarativeXMLHttpRequest::header(), QDirModel::index(), QSortedModelEngine::indexHint(), QFont::insertSubstitution(), QFont::insertSubstitutions(), QFactoryLoader::instance(), QHttpHeader::keys(), QFactoryLoader::library(), loadEngine(), loadSingleEngine(), QCompletionEngine::lookupCache(), macQueryInternal(), makeCacheKey(), QCompletionEngine::matchHint(), Qt::mightBeRichText(), QFileSystemModelPrivate::node(), QUrlPrivate::normalized(), QWSPcMouseHandlerPrivate::openDevices(), QDirSortItemComparator::operator()(), QSettingsKey::originalKeyPosition(), QDateTimeParser::parse(), parseBrushValue(), QTextHtmlParser::parseCloseTag(), parseHttpOptionHeader(), QDateTimeParser::parseSection(), parseStyleNode(), QTextHtmlParser::parseTag(), QNetworkAccessHttpBackend::postRequest(), QTDSDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QApplicationPrivate::process_cmdline(), QSvgHandler::processingInstruction(), Q_GLOBAL_STATIC_WITH_ARGS(), qAxInit(), qExtractSecurityPolicyFromString(), QFontEngineQPF::QFontEngineQPF(), qGetColumnType(), qGetODBCVersion(), qGetTableInfo(), QMacSettingsPrivate::QMacSettingsPrivate(), qmlFilesInDirectory(), qt_init(), qt_mac_menu_merge_action(), qt_parseQconfig(), qt_set_x11_resources(), qTopLevelDomain(), QPSQLDriver::record(), QAxFactory::registerActiveObject(), QDir::relativeFilePath(), QHttpHeader::removeAllValues(), QWindowsFileSystemWatcherEngine::removePaths(), QFont::removeSubstitution(), QHttpHeader::removeValue(), QSslSocketPrivate::resetDefaultCiphers(), QCompletionEngine::saveInCache(), QAxBase::setControl(), QRegExpEngine::Box::setupHeuristics(), QHttpHeader::setValue(), QHttpSocketEngine::slotSocketReadNotification(), QSslSocketBackendPrivate::startHandshake(), QCss::StyleSelector::styleRulesForNode(), QFont::substitute(), QFont::substitutes(), QCss::Parser::testAndParseUri(), QLocale::toLower(), QFactoryLoader::updateDir(), QHttpHeader::value(), WinMain(), and QApplicationPrivate::x11_apply_settings().
short QString::toShort | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
Returns the string converted to a short
using base base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6150 of file qstring.cpp.
|
inline |
Returns a std::string object with the data contained in this QString.
The Unicode data is converted into 8-bit characters using the toAscii() function.
This operator is mostly useful to pass a QString to a function that accepts a std::string object.
If the QString contains Unicode characters that the QTextCodec::codecForCStrings() codec cannot handle, using this operator can lead to loss of information.
This operator is only available if Qt is configured with STL compatibility enabled.
Definition at line 1044 of file qstring.h.
|
inline |
Returns a std::wstring object with the data contained in this QString.
The std::wstring is encoded in utf16 on platforms where wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms where wchar_t is 4 bytes wide (most Unix systems).
This operator is mostly useful to pass a QString to a function that accepts a std::wstring object.
This operator is only available if Qt is configured with STL compatibility enabled.
Definition at line 1051 of file qstring.h.
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
UCS-4 is a Unicode codec and is lossless. All characters from this string can be encoded in UCS-4. The vector is not null terminated.
Definition at line 4095 of file qstring.cpp.
Referenced by QStringRef::constData(), and toSQLTCHAR().
uint QString::toUInt | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6120 of file qstring.cpp.
Referenced by colorFromName(), QHttpHeader::contentLength(), QMYSQLResult::data(), QNativeWifiEngine::disconnectFromId(), QSystemLocalePrivate::firstDayOfWeek(), QLibraryPrivate::isPlugin(), QNlaThread::parseBlob(), QTextHtmlParser::parseEntity(), parseIp4(), parseIp6(), QXmlSimpleReaderPrivate::parseReference(), parseServerList(), QHostAddress::parseSubnet(), qExtractSecurityPolicyFromString(), NamedNodeMapClass::queryProperty(), NodeListClass::queryProperty(), and QXmlStreamReaderPrivate::resolveCharRef().
ulong QString::toULong | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6059 of file qstring.cpp.
quint64 QString::toULongLong | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 5984 of file qstring.cpp.
Referenced by QPSQLResult::data(), QMYSQLResult::data(), QPatternist::DerivedInteger< DerivedType >::fromLexical(), toUInt(), toULong(), and toUShort().
QString QString::toUpper | ( | ) | const |
Returns an uppercase copy of the string.
The case conversion will always happen in the 'C' locale. For locale dependent case folding use QLocale::toUpper()
Definition at line 5483 of file qstring.cpp.
Referenced by _q_parseUnixDir(), QDeclarativeEngineDebugService::buildObjectDump(), classIDL(), QLocalePrivate::codeToCountry(), QLocalePrivate::dateTimeToString(), QKeySequencePrivate::decodeString(), QPatternist::NormalizeUnicodeFN::determineNormalizationForm(), QLocalePrivate::doubleToString(), DumpIDL(), QPatternist::AbstractFloat< isDouble >::fromLexical(), getFmtString(), QNativeWifiEngine::getInterfaceFromId(), QFileIconProviderPrivate::getWinIcon(), QSqlRecord::indexOf(), QMenuBar::keyPressEvent(), QFSFileEnginePrivate::longFileName(), QLocalePrivate::longLongToString(), nameToType(), QFileSystemModelPrivate::node(), QIBaseDriver::open(), QSplitter::operator>>(), QDB2Driver::primaryIndex(), QIBaseDriver::primaryIndex(), QOCIDriver::primaryIndex(), qCreatev2Hash(), qGetODBCVersion(), qmlxmlhttprequest_open(), qmlxmlhttprequest_setRequestHeader(), qStringFromUcs2Le(), rasterFallbacksMask(), MetaObjectGenerator::readClassInfo(), MetaObjectGenerator::readEventInfo(), MetaObjectGenerator::readInterfaceInfo(), QIBaseResult::record(), QDB2Driver::record(), QIBaseDriver::record(), QOCIDriver::record(), QInternalMimeData::renderDataHelper(), QDB2Driver::tables(), QOCIDriver::tables(), QLocale::toUpper(), QLocalePrivate::unsLongLongToString(), UpdateRegistry(), and xdndObtainData().
ushort QString::toUShort | ( | bool * | ok = 0 , |
int | base = 10 |
||
) | const |
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.
Returns 0 if the conversion fails.
If a conversion error occurs, *{ok} is set to false; otherwise {ok} is set to true.
If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.
Example:
Definition at line 6180 of file qstring.cpp.
Referenced by QNativeWifiEngine::disconnectFromId(), and QCss::Scanner::preprocess().
QByteArray QString::toUtf8 | ( | ) | const |
Returns a UTF-8 representation of the string as a QByteArray.
UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QString.
However, in the Unicode range, there are certain codepoints that are not considered characters. The Unicode standard reserves the last two codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF, inclusive, as non-characters. If any of those appear in the string, they may be discarded and will not appear in the UTF-8 representation, or they may be replaced by one or more replacement characters.
Definition at line 4074 of file qstring.cpp.
Referenced by QDBusConnectionPrivate::activateCall(), QDeclarativeImportsPrivate::add(), QZipWriterPrivate::addEntry(), QDeclarativeXMLHttpRequest::addHeader(), QDnotifyFileSystemWatcherEngine::addPaths(), QDBusMarshaller::append(), Maemo::appendVariantToDBusMessage(), QApplicationPrivate::applyX11SpecificCommandLineArguments(), QDeclarativeEnginePrivate::atob(), QJSDebuggerAgent::backtrace(), QDeclarativeEnginePrivate::btoa(), QDeclarativeCompiler::buildDynamicMeta(), QAuthenticatorPrivate::calculateResponse(), QFileSystemEngine::canonicalName(), QDeclarativePropertyMap::clear(), QDeclarativeCompiler::compile(), QDeclarativeCompiler::compileAlias(), QDeclarativeListModelParser::compileProperty(), QDBusConnection::connectToBus(), QDBusConnection::connectToPeer(), QStringRef::constData(), QDeclarativeContext::contextProperty(), QMacPasteboardMimeAny::convertFromMime(), QWindowsMimeHtml::convertFromMime(), QMacPasteboardMimeVCard::convertFromMime(), QWindowsMimeText::convertToMime(), QDeclarativePropertyCache::create(), QDeclarativePathView::createdItem(), QPatternist::ExpressionFactory::createExpression(), QDeclarativeEnginePrivate::createQmlObject(), QDeclarativeXmlQueryEngine::doQueryJob(), QPSPrintEnginePrivate::emitHeader(), encodeString(), QDeclarativeObjectMethodScriptClass::enumType(), QODBCResult::exec(), QPSQLDriverPrivate::exec(), QFontconfigDatabase::fallbacksForFamily(), QWSSoundServerPrivate::feedDevice(), QDeclarativeXMLHttpRequest::findTextCodec(), QFontconfigDatabase::fontEngine(), QBBClipboard::MimeData::formats(), fromScriptValue(), QUrl::fromUserInput(), Maemo::GConfItemFast::getEntries(), getFcPattern(), getImage(), QDeclarativePathViewPrivate::getItem(), getMacLocaleName(), getPixmap(), QFileIconProviderPrivate::getWinIcon(), QBBClipboard::MimeData::hasFormat(), QDeclarativeXMLHttpRequest::header(), QDeclarativeImportDatabase::importPlugin(), QDeclarativePropertyPrivate::initProperty(), QDeclarativePropertyMap::insert(), QScript::integerFromString(), QTextLine::layout_helper(), QLibraryPrivate::load_sys(), locale_encode(), QDBusMessagePrivate::makeLocal(), QSharedMemoryPrivate::makePlatformSafeKey(), QDeclarativeEnginePrivate::md5(), navigatorInvoke(), QSQLiteDriver::open(), QODBCDriver::open(), QDeclarativePropertyMap::operator[](), QDeclarativeBindingCompilerPrivate::parseName(), QODBCResult::prepare(), QODBCDriver::primaryIndex(), QFontEngineMac::properties(), QFontEngine::properties(), QTextStreamPrivate::putString(), QDBusError::QDBusError(), qDBusPropertyGet(), qDBusPropertySet(), QDBusServer::QDBusServer(), qExtractSecurityPolicyFromString(), qmlsqldatabase_open_sync(), qmlxmlhttprequest_open(), qmlxmlhttprequest_send(), qstring_to_xtp(), qt_addPatternProps(), qt_mac_create_fsref(), qt_mac_execute_apple_script(), QDeclarativeValueTypeScriptClass::queryProperty(), QDeclarativeTypeNameScriptClass::queryProperty(), QODBCDriver::record(), registerFont(), QSQLite2Result::reset(), QODBCResult::reset(), QDeclarativeTypeData::resolveTypes(), QTextBrowserPrivate::resolveUrl(), QBBClipboard::MimeData::retrieveData(), QMimeDataPrivate::retrieveTypedData(), QWSSoundServerClient::sendClientMessage(), set_text(), QXmlQuery::setFocus(), QBBClipboard::setMimeData(), ModelNode::setObjectValue(), ModelNode::setProperty(), QXmlQuery::setQuery(), QXcbWindow::setWindowTitle(), QWidgetPrivate::setWindowTitle_sys(), sm_setProperty(), QProcessPrivate::startDetached(), QProcessPrivate::startProcess(), QDeclarativeVisualDataModel::stringValue(), QODBCDriver::tables(), QDeclarativeCompiler::testQualifiedEnumAssignment(), QDomDocument::toByteArray(), QDBusMessagePrivate::toDBusMessage(), QUrlPrivate::toEncoded(), toPercentEncodingHelper(), toSQLTCHAR(), QDeclarativePathViewPrivate::updateItem(), QDeclarativePropertyMap::value(), QTextOdfWriter::writeInlineCharacter(), and xic_draw_callback().
int QString::toWCharArray | ( | wchar_t * | array | ) | const |
Fills the array with the data contained in this QString object.
The array is encoded in utf16 on platforms where wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms where wchar_t is 4 bytes wide (most Unix systems).
array has to be allocated by the caller and contain enough space to hold the complete string (allocating the array with the same length as the string is always sufficient).
returns the actual length of the string in array.
Definition at line 1086 of file qstring.cpp.
Referenced by toStdWString().
QString QString::trimmed | ( | ) | 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 the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.
Example:
Unlike simplified(), trimmed() leaves internal whitespace alone.
Definition at line 4506 of file qstring.cpp.
Referenced by QFtpPrivate::_q_startNextCommand(), QTransformedScreen::connect(), QHttpHeader::contentType(), createImageNode(), createSvgNode(), QPatternist::NormalizeUnicodeFN::determineNormalizationForm(), QAxBase::dynamicCallHelper(), QPatternist::NCNameConstructor::evaluateSingleton(), QSymSQLResult::exec(), QSqlQuery::exec(), familyList(), QDateTimeParser::findAmPm(), QIconLoader::findIconHelper(), fontPath(), fractionDigitsForDecimal(), QPatternist::HexBinary::fromLexical(), QPatternist::Decimal::fromLexical(), QPatternist::Boolean::fromLexical(), QPatternist::DerivedString< TypeToken >::fromLexical(), QSslCertificate::fromPath(), QUrl::fromUserInput(), QDeclarativeCompiler::genObjectBody(), getLocations(), QGtkStylePrivate::getThemeName(), QPatternist::XSLTTokenizer::insideSequenceConstructor(), QDeclarativeJS::integerFromString(), QScript::integerFromString(), Text::isElementContentWhitespace(), QMetaEnum::keysToValue(), launchWebBrowser(), QHttpHeader::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), QTextHtmlParser::parseCloseTag(), parseColorValue(), parseCompOp(), QFtpDTP::parseDir(), parseFont(), parseLength(), QHttpHeader::parseLine(), parseOpacity(), parseOthers(), QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(), qt_error_string(), qt_get_screen(), qt_mac_extract_filter(), qt_parsePrintcap(), qt_parseSpoolInterface(), qt_set_x11_resources(), qt_strippedText(), QFtp::rawCommand(), QPatternist::XSLTTokenizer::readAlternativeAttribute(), QNSOpenSavePanelDelegate::removeExtensions:, QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QUrlPrivate::setAuthority(), QScriptDebuggerLocalsModel::setData(), QUrl::setUserInfo(), setWidthAttribute(), standardLibraryErrorString(), QLocalePrivate::stringToDouble(), QLocalePrivate::stringToLongLong(), QLocalePrivate::stringToUnsLongLong(), QAbstractSpinBoxPrivate::stripped(), QCoreFuriCuri::timerEvent(), QDeclarativePropertyAction::transition(), QDeclarativePropertyAnimation::transition(), trimmed(), QAbstractXmlReceiver::whitespaceOnly(), QPatternist::AccelTreeBuilder< true >::whitespaceOnly(), and QPatternist::QAbstractXmlReceiver::whitespaceOnly().
void QString::truncate | ( | int | position | ) |
Truncates the string at the given position index.
If the specified position index is beyond the end of the string, nothing happens.
Example:
If position is negative, it is equivalent to passing zero.
Definition at line 4603 of file qstring.cpp.
Referenced by QHttpPrivate::_q_slotReadyRead(), QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), QDBusAbstractInterface::callWithArgumentList(), QVNCScreen::connect(), QTransformedScreen::connect(), QWindowsMimeText::convertFromMime(), QBuiltInMimes::convertFromMime(), QUtf8::convertToUnicode(), QUtf16::convertToUnicode(), QUtf32::convertToUnicode(), QLocalePrivate::doubleToString(), QLCDNumberPrivate::drawString(), errorCodeToString(), QPatternist::TranslateFN::evaluateSingleton(), QWSSoundServerPrivate::feedDevice(), find_translation(), QSqlDriver::formatValue(), QProcessEnvironmentPrivate::fromList(), QDBusConnectionPrivate::handleSignal(), iniChopTrailingSpaces(), QSettingsPrivate::normalizedKey(), parse_locale_tag(), QDateTimeParser::parseSection(), QHostAddress::parseSubnet(), QSettingsPrivate::processChild(), qt_get_screen(), qt_nameprep(), QDirPrivate::setPath(), simplified(), QAbstractSpinBox::sizeHint(), toLower(), toPunycodeHelper(), QKeySequence::toString(), toUpper(), QWSSoundServerClient::tryReadCommand(), vsprintf(), and write_xpm_image().
|
inline |
Returns a '\0'-terminated Unicode representation of the string.
The result remains valid until the string is modified.
Definition at line 706 of file qstring.h.
Referenced by QXmlStreamPrivateTagStack::addToStringStorage(), QStringRef::appendTo(), bidiItemize(), QFontMetrics::charWidth(), QDir::cleanPath(), QLocalePrivate::codeToCountry(), QLocalePrivate::codeToLanguage(), compare(), QStringRef::constData(), QWindowsMimeText::convertFromMime(), QBuiltInMimes::convertFromMime(), QIsciiCodec::convertToUnicode(), QUtf8::convertToUnicode(), QUtf16::convertToUnicode(), QUtf32::convertToUnicode(), count(), QStringRef::count(), QStringRef::data(), QKeySequencePrivate::decodeString(), QLocalePrivate::doubleToString(), QTextLine::draw(), drawMenuText(), QPainter::drawText(), DumpIDL(), QAxBase::dynamicCallHelper(), endsWith(), QStringRef::endsWith(), QRegExp::exactMatch(), findArgEscapes(), QAxServerBase::GetCurFile(), getEnglishName(), QRegExpEngine::goodStringMatch(), QStringMatcher::indexIn(), QRegExp::indexIn(), indexOf(), QStringRef::indexOf(), QFileSystemEntry::isAbsolute(), QFileSystemEntry::isRelative(), QDBusUtil::isValidBusName(), QDBusUtil::isValidMemberName(), QDBusUtil::isValidPartOfObjectPath(), QDBusUtil::isValidUniqueConnectionName(), QTextEngine::itemize(), QRegExp::lastIndexIn(), lastIndexOf(), QStringRef::lastIndexOf(), localizedName(), QLocalePrivate::longLongToString(), QScriptEnginePrivate::newRegExp(), nextDotDelimiter(), QLocalePrivate::numberToCLocale(), operator<<(), QStringRef::operator==(), QTextDocumentPrivate::plainText(), qHash(), QRegExpEngine::QRegExpEngine(), QStringMatcher::QStringMatcher(), QStringToBSTR(), QStringToOLESTR(), qt_keyrelease_scanner(), qt_mac_to_pascal_string(), qt_string_count(), qt_string_normalize(), QUuid::QUuid(), qwsSetClipboardText(), replace(), replaceArgEscapes(), QCharRef::row(), section(), QStringMatcher::setCaseSensitivity(), QScript::Lexer::setCode(), QDeclarativeJS::Lexer::setCode(), QXmlInputSource::setData(), QWSPlaySoundCommand::setFileName(), QWSQCopSendCommand::setMessage(), QStringMatcher::setPattern(), startsWith(), QStringRef::startsWith(), QTextBoundaryFinder::string(), QStringRef::toAscii(), toLatin1(), QStringRef::toLatin1(), QStringRef::toLocal8Bit(), toSQLTCHAR(), QUuid::toString(), QStringRef::toUcs4(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), QStringRef::unicode(), QLocalePrivate::unsLongLongToString(), and wc2rx().
|
private |
Definition at line 7510 of file qstring.cpp.
const ushort * QString::utf16 | ( | ) | const |
Returns the QString as a '\0\'-terminated array of unsigned shorts.
The result remains valid until the string is modified.
The returned string is in host byte order.
Definition at line 5290 of file qstring.cpp.
Referenced by QAxScriptEngine::addItem(), QLocalServerPrivate::addListener(), QFileSystemModelPrivate::addNode(), QOCIResultPrivate::bindValue(), QLastResortMimes::canConvertToMime(), QNativeWifiEngine::connectToId(), QWindowsMimeURI::convertFromMime(), QLastResortMimes::convertToMime(), QAxServerBase::create(), QAxServerBase::createMenu(), createOrOpenKey(), QAxServerBase::createPopup(), deleteChildGroups(), QAxMetaObject::dispIDofName(), QVistaHelper::drawTitleText(), QSQLiteResult::exec(), QOCICols::execBatch(), expandEnvStrings(), QFileSystemEngine::fillMetaData(), QFileSystemEngine::fillPermissions(), QSystemTrayIconSys::findTrayGeometry(), generateName(), getEnglishName(), getFindData(), XPThemeData::handle(), QFileIconProvider::icon(), QWindowsSystemProxy::init(), QAxScriptEngine::initialize(), QAxBase::initializeRemote(), isDirPath(), launchWebBrowser(), QSystemLibrary::load(), QAxServerBase::Load(), loadEngine(), QFSFileEnginePrivate::longFileName(), QFileDialogPrivate::maxNameLength(), QFileSystemEngine::nativeAbsoluteFilePath(), QFSFileEnginePrivate::nativeHandle(), QFileSystemModelPrivate::node(), QOCIDriver::open(), openDocument(), openKey(), QTest::outputMessage(), QFileSystemEngine::owner(), QProcessPrivate::pipeWriterBytesToWrite(), populate_database(), QOCIResult::prepare(), qAxInit(), QDeclarative_isFileCaseCorrect(), qStreamNtlmString(), qStringAsUcs2Le(), qt_create_commandline(), qt_create_internal_window(), qt_create_pipe(), qt_message_output(), QAxServerBase::qt_metacall(), qt_reg_winclass(), qt_tablet_cleanup_wce(), qt_wce_insert_action(), qt_wce_rename_menu_item(), qt_win_get_existing_directory(), qt_win_get_save_file_name(), qt_win_make_OFN(), qt_wince_is_platform(), QtCeSetClipboard(), qToTChar(), QtWndProc(), QWin32PrintEnginePrivate::queryDefault(), qWinCmdArgs(), qWinMsgHandler(), MetaObjectGenerator::readClassInfo(), QWinSettingsPrivate::readKey(), readLink(), readSymLink(), QAxScriptManager::registerEngine(), registerFont(), QWindowsMime::registerMimeType(), QWinSettingsPrivate::remove(), QAxServerBase::Save(), QWinSettingsPrivate::set(), QAxBase::setControl(), QSystemTrayIconSys::setIconContents(), QSystemTrayIconSys::showMessage(), SoundPlayProc(), QConfFileSettingsPrivate::syncConfFile(), QSystemLocalePrivate::toCurrencyString(), toUcs4(), toWCharArray(), QFileSystemEngine::uncListSharesOnServer(), unregWinClasses(), UpdateRegistry(), winGetExistDirCallbackProc(), WinMain(), QEventDispatcherWin32Private::~QEventDispatcherWin32Private(), and QWinSettingsPrivate::~QWinSettingsPrivate().
QString & QString::vsprintf | ( | const char * | cformat, |
va_list | ap | ||
) |
Equivalent method to sprintf(), but takes a va_list ap instead a list of variable arguments.
See the sprintf() documentation for an explanation of cformat.
This method does not call the va_end macro, the caller is responsible to call va_end on ap.
Definition at line 5587 of file qstring.cpp.
Referenced by qErrnoWarning(), qt_message(), QByteArray::qvsnprintf(), and sprintf().
|
related |
Returns true if s1 is not equal to s2; otherwise returns false.
For s1 != 0, this is equivalent to {compare
(} s1, s2 {
) != 0}. Note that no string is equal to s1 being 0.
Definition at line 938 of file qstring.h.
Returns a string which is the result of concatenating s1 and s2 (s2 is converted to Unicode using the QString::fromAscii() function).
Definition at line 1028 of file qstring.h.
Returns a string which is the result of concatenating s1 and s2 (s1 is converted to Unicode using the QString::fromAscii() function).
Definition at line 1030 of file qstring.h.
Returns a string which is the result of concatenating the string s and the character ch.
Definition at line 1034 of file qstring.h.
Returns a string which is the result of concatenating the character ch and the string s.
Definition at line 1032 of file qstring.h.
|
related |
Returns true if s1 is lexically less than s2; otherwise returns false. For s1 != 0, this is equivalent to {compare(s1, s2)
< 0}.
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 using the QString::localeAwareCompare() function.
Definition at line 940 of file qstring.h.
|
related |
Writes the given string to the specified stream.
Definition at line 8034 of file qstring.cpp.
Referenced by fromStdWString().
|
related |
Returns true if s1 is lexically less than or equal to s2; otherwise returns false. For s1 != 0, this is equivalent to {compare(s1, s2)
<= 0}.
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().
Definition at line 944 of file qstring.h.
|
related |
Returns true if s1 is equal to s2; otherwise returns false. Note that no string is equal to s1 being 0.
Equivalent to {s1
!= 0 && compare(s1, s2) == 0}.
|
related |
Returns true if s1 is lexically greater than s2; otherwise returns false. Equivalent to {compare(s1, s2)
> 0}.
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 using the QString::localeAwareCompare() function.
Definition at line 942 of file qstring.h.
|
related |
Returns true if s1 is lexically greater than or equal to s2; otherwise returns false. For s1 != 0, this is equivalent to {compare(s1, s2)
>= 0}.
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 using the QString::localeAwareCompare() function.
Definition at line 946 of file qstring.h.
|
related |
Reads a string from the specified stream into the given string.
Definition at line 8071 of file qstring.cpp.
Referenced by fromStdWString().
|
friend |
Definition at line 641 of file qstring.h.
Referenced by operator[]().
|
friend |
Definition at line 916 of file qstring.h.
Referenced by QByteArray::operator!=(), operator!=(), operator!=(), QByteArray::operator==(), operator==(), and operator==().
|
friend |
Definition at line 1228 of file qstring.h.
|
friend |
Definition at line 644 of file qstring.h.
Referenced by QStringRef::appendTo(), leftRef(), midRef(), QStringRef::QStringRef(), and rightRef().
|
friend |
|
staticprivate |
Definition at line 621 of file qstring.h.
Referenced by QTextCodec::codecForCStrings(), QAbstractConcatenable::convertFromAscii(), QAbstractConcatenable::convertToAscii(), fromAscii_helper(), qStringComparisonHelper(), QTextCodec::setCodecForCStrings(), toAscii(), QStringRef::toAscii(), and vsprintf().
|
private |
Definition at line 618 of file qstring.h.
Referenced by append(), at(), begin(), capacity(), chop(), compare(), constBegin(), constData(), constEnd(), data(), detach(), end(), endsWith(), expand(), fill(), findArgEscapes(), fromAscii_helper(), fromLatin1(), fromLatin1_helper(), fromStdWString(), insert(), isDetached(), isEmpty(), isSharedWith(), lastIndexOf(), left(), leftJustified(), length(), mid(), QCharRef::operator QChar(), operator<(), operator=(), QCharRef::operator=(), operator==(), operator>(), operator[](), QProcessEnvironmentPrivate::OrderedMutexLocker::OrderedMutexLocker(), QString(), qt_string_normalize(), realloc(), remove(), repeated(), replace(), replace_helper(), reserve(), resize(), right(), rightJustified(), setUnicode(), simplified(), startsWith(), swap(), toCaseFolded(), toFloat(), toLower(), toUpper(), trimmed(), unicode(), utf16(), vsprintf(), and ~QString().
|
static |
Definition at line 502 of file qstring.h.
Referenced by QMdiSubWindow::eventFilter(), getStringTok(), QScriptSyntaxHighlighter::highlightBlock(), QAccessibleDisplay::imageDescription(), qToLower(), and QMdiSubWindowPrivate::removeButtonsFromMenuBar().
|
staticprivate |
Definition at line 617 of file qstring.h.
Referenced by fromAscii_helper(), fromLatin1_helper(), QString(), qToLower(), resize(), simplified(), and trimmed().
|
staticprivate |
Definition at line 616 of file qstring.h.
Referenced by append(), fromAscii_helper(), fromLatin1_helper(), mid(), midRef(), QString(), qToLower(), and QStringRef::unicode().