![]() |
Qt 6.x
The Qt SDK
|
\macro QT_RESTRICTED_CAST_FROM_ASCII More...
#include <qstring.h>
Public Types | |
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 | NormalizationForm { NormalizationForm_D , NormalizationForm_C , NormalizationForm_KD , NormalizationForm_KC } |
This enum describes the various normalized forms of Unicode text. More... | |
typedef QStringPrivate | DataPointer |
typedef QChar * | iterator |
typedef const QChar * | const_iterator |
typedef iterator | Iterator |
Qt-style synonym for QString::iterator. | |
typedef const_iterator | ConstIterator |
Qt-style synonym for QString::const_iterator. | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef qsizetype | size_type |
typedef qptrdiff | difference_type |
typedef const QChar & | const_reference |
typedef QChar & | reference |
typedef QChar * | pointer |
The QString::pointer typedef provides an STL-style pointer to a QString element (QChar). | |
typedef const QChar * | const_pointer |
The QString::const_pointer typedef provides an STL-style const pointer to a QString element (QChar). | |
typedef QChar | value_type |
Public Member Functions | |
constexpr | QString () noexcept |
Constructs a null string. | |
QString (const QChar *unicode, qsizetype size=-1) | |
Constructs a string initialized with the first size characters of the QChar array unicode. | |
QString (QChar c) | |
Constructs a string of size 1 containing the character ch. | |
QString (qsizetype size, QChar c) | |
Constructs a string of the given size with every character set to ch. | |
QString (QLatin1StringView latin1) | |
Constructs a copy of the Latin-1 string viewed by str. | |
QString (const QString &) noexcept | |
Constructs a copy of other. | |
~QString () | |
Destroys the string. | |
QString & | operator= (QChar c) |
QString & | operator= (const QString &) noexcept |
Assigns other to this string and returns a reference to this string. | |
QString & | operator= (QLatin1StringView latin1) |
QString (QString &&other) noexcept=default | |
Move-constructs a QString instance, making it point at the same object that other was pointing to. | |
void | swap (QString &other) noexcept |
qsizetype | size () const |
Returns the number of characters in this string. | |
qsizetype | length () const |
Returns the number of characters in this string. | |
bool | isEmpty () const |
Returns true if the string has no characters; otherwise returns false . | |
void | resize (qsizetype size) |
Sets the size of the string to size characters. | |
void | resize (qsizetype size, QChar fillChar) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QString & | fill (QChar c, qsizetype size=-1) |
Sets every character in the string to character ch. | |
void | truncate (qsizetype pos) |
Truncates the string at the given position index. | |
void | chop (qsizetype n) |
Removes n characters from the end of the string. | |
qsizetype | capacity () const |
Returns the maximum number of characters that can be stored in the string without forcing a reallocation. | |
void | reserve (qsizetype size) |
Ensures the string has space for at least size characters. | |
void | squeeze () |
Releases any memory not required to store the character data. | |
const QChar * | unicode () const |
Returns a Unicode representation of the string. | |
QChar * | data () |
Returns a pointer to the data stored in the QString. | |
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. | |
const QChar * | constData () const |
Returns a pointer to the data stored in the QString. | |
void | detach () |
bool | isDetached () const |
bool | isSharedWith (const QString &other) const |
void | clear () |
Clears the contents of the string and makes it null. | |
const QChar | at (qsizetype i) const |
Returns the character at the given index position in the string. | |
const QChar | operator[] (qsizetype i) const |
QChar & | operator[] (qsizetype i) |
Returns the character at the specified position in the string as a modifiable reference. | |
QChar | front () const |
QChar & | front () |
QChar | back () const |
QChar & | back () |
QString | arg (qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (qulonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (long a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (ulong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (int a, int fieldWidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (uint a, int fieldWidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (short a, int fieldWidth=0, int base=10, QChar fillChar=u' ') const |
fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar. | |
QString | arg (ushort a, int fieldWidth=0, int base=10, QChar fillChar=u' ') const |
QString | arg (double a, int fieldWidth=0, char format='g', int precision=-1, QChar fillChar=u' ') const |
QString | arg (char a, int fieldWidth=0, QChar fillChar=u' ') const |
QString | arg (QChar a, int fieldWidth=0, QChar fillChar=u' ') const |
QString | arg (const QString &a, int fieldWidth=0, QChar fillChar=u' ') const |
Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1 , %2 , ..., %99 . | |
QString | arg (QStringView a, int fieldWidth=0, QChar fillChar=u' ') const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QString | arg (QLatin1StringView a, int fieldWidth=0, QChar fillChar=u' ') const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QString ::type | arg (Args &&...args) const |
static QString static QString qsizetype | indexOf (QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | indexOf (QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | indexOf (const QString &s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | indexOf (QStringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
qsizetype | lastIndexOf (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
qsizetype | lastIndexOf (QChar c, qsizetype from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | lastIndexOf (QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | lastIndexOf (QLatin1StringView s, qsizetype from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | lastIndexOf (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | lastIndexOf (const QString &s, qsizetype from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | lastIndexOf (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
qsizetype | lastIndexOf (QStringView s, qsizetype from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
bool | contains (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | 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 . | |
bool | contains (QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | contains (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
qsizetype | count (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
qsizetype | count (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns the number of (potentially overlapping) occurrences of the string str in this string. | |
qsizetype | count (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QString | section (QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const |
This function returns a section of the string. | |
QString | section (const QString &in_sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const |
QString | left (qsizetype n) const |
Returns a substring that contains the n leftmost characters of the string. | |
QString | right (qsizetype n) const |
Returns a substring that contains the n rightmost characters of the string. | |
QString | mid (qsizetype position, qsizetype n=-1) const |
Returns a string that contains n characters of this string, starting at the specified position index. | |
QString | first (qsizetype n) const |
QString | last (qsizetype n) const |
QString | sliced (qsizetype pos) const |
QString | sliced (qsizetype pos, qsizetype n) const |
QString | chopped (qsizetype n) const |
bool | startsWith (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if the string starts with s; otherwise returns false . | |
bool | startsWith (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
bool | startsWith (QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | startsWith (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Returns true if the string ends with s; otherwise returns false . | |
bool | endsWith (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
bool | endsWith (QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | isUpper () const |
Returns true if the string is uppercase, that is, it's identical to its toUpper() folding. | |
bool | isLower () const |
Returns true if the string is lowercase, that is, it's identical to its toLower() folding. | |
QString | leftJustified (qsizetype width, QChar fill=u' ', bool trunc=false) const |
Returns a string of size width that contains this string padded by the fill character. | |
QString | rightJustified (qsizetype width, QChar fill=u' ', bool trunc=false) const |
Returns a string of size() width that contains the fill character followed by the string. | |
QString | toLower () const & |
QString | toLower () && |
QString | toUpper () const & |
QString | toUpper () && |
QString | toCaseFolded () const & |
QString | toCaseFolded () && |
QString | trimmed () const & |
QString | trimmed () && |
QString | simplified () const & |
QString | simplified () && |
QString | toHtmlEscaped () const |
QString & | insert (qsizetype i, QChar c) |
QString & | insert (qsizetype i, const QChar *uc, qsizetype len) |
QString & | insert (qsizetype i, const QString &s) |
QString & | insert (qsizetype i, QStringView v) |
QString & | insert (qsizetype i, QLatin1StringView s) |
QString & | insert (qsizetype i, QUtf8StringView s) |
QString & | append (QChar c) |
QString & | append (const QChar *uc, qsizetype len) |
QString & | append (const QString &s) |
Appends the string str onto the end of this string. | |
QString & | append (QStringView v) |
QString & | append (QLatin1StringView s) |
QString & | append (QUtf8StringView s) |
QString & | prepend (QChar c) |
QString & | prepend (const QChar *uc, qsizetype len) |
QString & | prepend (const QString &s) |
Prepends the string str to the beginning of this string and returns a reference to this string. | |
QString & | prepend (QStringView v) |
QString & | prepend (QLatin1StringView s) |
QString & | prepend (QUtf8StringView s) |
QString & | assign (QAnyStringView s) |
QString & | assign (qsizetype n, QChar c) |
template<typename InputIterator , if_compatible_iterator< InputIterator > = true> | |
QString & | assign (InputIterator first, InputIterator last) |
QString & | operator+= (QChar c) |
QString & | operator+= (const QString &s) |
Appends the string other onto the end of this string and returns a reference to this string. | |
QString & | operator+= (QStringView v) |
QString & | operator+= (QLatin1StringView s) |
QString & | operator+= (QUtf8StringView s) |
QString & | remove (qsizetype i, qsizetype len) |
Removes n characters from the string, starting at the given position index, and returns a reference to the string. | |
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. | |
QString & | remove (QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
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. | |
QString & | removeAt (qsizetype pos) |
QString & | removeFirst () |
QString & | removeLast () |
template<typename Predicate > | |
QString & | removeIf (Predicate pred) |
QString & | replace (qsizetype i, qsizetype len, QChar after) |
QString & | replace (qsizetype i, qsizetype len, const QChar *s, qsizetype slen) |
QString & | replace (qsizetype i, qsizetype len, const QString &after) |
Replaces n characters beginning at index position with the string after and returns a reference to this string. | |
QString & | replace (QChar before, QChar after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QChar *before, qsizetype blen, const QChar *after, qsizetype alen, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (QLatin1StringView before, QLatin1StringView after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (QLatin1StringView before, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString & | replace (const QString &before, QLatin1StringView 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, QLatin1StringView after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QStringList | split (const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
Splits the string into substrings wherever sep occurs, and returns the list of those strings. | |
QStringList | split (QChar sep, Qt::SplitBehavior behavior=Qt::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. | |
QStringList | split (const QRegularExpression &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts) const |
template<typename Needle , typename... Flags> | |
auto | tokenize (Needle &&needle, Flags...flags) const &noexcept(noexcept(qTokenize(std::declval< const QString & >(), std::forward< Needle >(needle), flags...))) -> decltype(qTokenize(*this, std::forward< Needle >(needle), flags...)) |
template<typename Needle , typename... Flags> | |
auto | tokenize (Needle &&needle, Flags...flags) const &&noexcept(noexcept(qTokenize(std::declval< const QString >(), std::forward< Needle >(needle), flags...))) -> decltype(qTokenize(std::move(*this), std::forward< Needle >(needle), flags...)) |
template<typename Needle , typename... Flags> | |
auto | tokenize (Needle &&needle, Flags...flags) &&noexcept(noexcept(qTokenize(std::declval< QString >(), std::forward< Needle >(needle), flags...))) -> decltype(qTokenize(std::move(*this), std::forward< Needle >(needle), flags...)) |
QString | normalized (NormalizationForm mode, QChar::UnicodeVersion version=QChar::Unicode_Unassigned) const |
Returns the string in the given Unicode normalization mode, according to the given version of the Unicode standard. | |
QString | repeated (qsizetype times) const |
const ushort * | utf16 () const |
Returns the QString as a '\0\'-terminated array of unsigned shorts. | |
QByteArray | toLatin1 () const & |
QByteArray | toLatin1 () && |
QByteArray | toUtf8 () const & |
QByteArray | toUtf8 () && |
QByteArray | toLocal8Bit () const & |
QByteArray | toLocal8Bit () && |
QList< uint > | toUcs4 () const |
qsizetype | toWCharArray (wchar_t *array) const |
QString & | setRawData (const QChar *unicode, qsizetype size) |
QString & | setUnicode (const QChar *unicode, qsizetype size) |
Resizes the string to size characters and copies unicode into the string. | |
QString & | setUtf16 (const ushort *utf16, qsizetype size) |
Resizes the string to size characters and copies unicode into the string. | |
int | compare (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
int | compare (QLatin1StringView other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
int | compare (QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
int | compare (QChar ch, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept |
int | localeAwareCompare (const QString &s) const |
int | localeAwareCompare (QStringView s) const |
short | toShort (bool *ok=nullptr, 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. | |
ushort | toUShort (bool *ok=nullptr, 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. | |
int | toInt (bool *ok=nullptr, 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. | |
uint | toUInt (bool *ok=nullptr, 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. | |
long | toLong (bool *ok=nullptr, 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. | |
ulong | toULong (bool *ok=nullptr, 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. | |
qlonglong | toLongLong (bool *ok=nullptr, 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. | |
qulonglong | toULongLong (bool *ok=nullptr, 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. | |
float | toFloat (bool *ok=nullptr) const |
Returns the string converted to a float value. | |
double | toDouble (bool *ok=nullptr) const |
Returns the string converted to a double value. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
QString & | setNum (float, char format='g', int precision=6) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string. | |
QString & | setNum (double, char format='g', int precision=6) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string. | |
QT_ASCII_CAST_WARN | QString (const char *ch) |
Constructs a string initialized with the 8-bit string str. | |
QT_ASCII_CAST_WARN | QString (const QByteArray &a) |
Constructs a string initialized with the byte array ba. | |
QT_ASCII_CAST_WARN QString & | operator= (const char *ch) |
QT_ASCII_CAST_WARN QString & | operator= (const QByteArray &a) |
QT_ASCII_CAST_WARN QString & | prepend (const char *s) |
QT_ASCII_CAST_WARN QString & | prepend (const QByteArray &s) |
QT_ASCII_CAST_WARN QString & | append (const char *s) |
QT_ASCII_CAST_WARN QString & | append (const QByteArray &s) |
QT_ASCII_CAST_WARN QString & | insert (qsizetype i, const char *s) |
QT_ASCII_CAST_WARN QString & | insert (qsizetype i, const QByteArray &s) |
QT_ASCII_CAST_WARN QString & | operator+= (const char *s) |
QT_ASCII_CAST_WARN QString & | operator+= (const QByteArray &s) |
QT_ASCII_CAST_WARN bool | operator== (const char *s) const |
QT_ASCII_CAST_WARN bool | operator!= (const char *s) const |
QT_ASCII_CAST_WARN bool | operator< (const char *s) const |
QT_ASCII_CAST_WARN bool | operator<= (const char *s) const |
QT_ASCII_CAST_WARN bool | operator> (const char *s) const |
QT_ASCII_CAST_WARN bool | operator>= (const char *s) const |
QT_ASCII_CAST_WARN bool | operator== (const QByteArray &s) const |
QT_ASCII_CAST_WARN bool | operator!= (const QByteArray &s) const |
QT_ASCII_CAST_WARN bool | operator< (const QByteArray &s) const |
QT_ASCII_CAST_WARN bool | operator> (const QByteArray &s) const |
QT_ASCII_CAST_WARN bool | operator<= (const QByteArray &s) const |
QT_ASCII_CAST_WARN bool | operator>= (const QByteArray &s) const |
iterator | begin () |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string. | |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | constBegin () const |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string. | |
iterator | end () |
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the string. | |
const_iterator | end () const |
const_iterator | cend () const |
const_iterator | constEnd () const |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the string. | |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
void | push_back (QChar c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Appends the given ch character onto the end of this string. | |
void | push_back (const QString &s) |
This function is provided for STL compatibility, appending the given other string onto the end of this string. | |
void | push_front (QChar c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Prepends the given ch character to the beginning of this string. | |
void | push_front (const QString &s) |
This function is provided for STL compatibility, prepending the given other string to the beginning of this string. | |
void | shrink_to_fit () |
iterator | erase (const_iterator first, const_iterator last) |
iterator | erase (const_iterator it) |
std::string | toStdString () const |
Returns a std::string object with the data contained in this QString. | |
std::wstring | toStdWString () const |
Returns a std::wstring object with the data contained in this QString. | |
std::u16string | toStdU16String () const |
std::u32string | toStdU32String () const |
bool | isNull () const |
Returns true if this string is null; otherwise returns false . | |
bool | isSimpleText () const |
bool | isRightToLeft () const |
Returns true if the string is read right to left. | |
bool | isValidUtf16 () const noexcept |
QString (qsizetype size, Qt::Initialization) | |
QString (DataPointer &&dd) | |
DataPointer & | data_ptr () |
const DataPointer & | data_ptr () const |
Static Public Member Functions | |
static QString | vasprintf (const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(1 |
static QString static QString | asprintf (const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1 |
static QString | fromLatin1 (QByteArrayView ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static Q_WEAK_OVERLOAD QString | fromLatin1 (const QByteArray &ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static QString | fromLatin1 (const char *str, qsizetype size) |
Returns a QString initialized with the first size characters of the Latin-1 string str. | |
static QString | fromUtf8 (QByteArrayView utf8) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static Q_WEAK_OVERLOAD QString | fromUtf8 (const QByteArray &ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static QString | fromUtf8 (const char *utf8, qsizetype size) |
Returns a QString initialized with the first size bytes of the UTF-8 string str. | |
static QString | fromLocal8Bit (QByteArrayView ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static Q_WEAK_OVERLOAD QString | fromLocal8Bit (const QByteArray &ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static QString | fromLocal8Bit (const char *str, qsizetype size) |
Returns a QString initialized with the first size characters of the 8-bit string str. | |
static QString | fromUtf16 (const char16_t *, qsizetype size=-1) |
static QString | fromUcs4 (const char32_t *, qsizetype size=-1) |
static QString | fromRawData (const QChar *, qsizetype size) |
Constructs a QString that uses the first size Unicode characters in the array unicode. | |
static QString | fromWCharArray (const wchar_t *string, qsizetype size=-1) |
static int | compare (const QString &s1, const QString &s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept |
static int | compare (const QString &s1, QLatin1StringView s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept |
static int | compare (QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept |
static int | compare (const QString &s1, QStringView s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept |
static int | compare (QStringView s1, const QString &s2, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept |
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. | |
static int | localeAwareCompare (QStringView s1, QStringView 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. | |
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. | |
static QString | number (long, int base=10) |
Returns a string equivalent of the number n according to the specified base. | |
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. | |
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. | |
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. | |
static QString | number (double, char format='g', int precision=6) |
Returns a string representing the floating-point number n. | |
static QString | fromStdString (const std::string &s) |
static QString | fromStdWString (const std::wstring &s) |
Returns a copy of the str string. | |
static QString | fromStdU16String (const std::u16string &s) |
static QString | fromStdU32String (const std::u32string &s) |
Friends | |
class | ::tst_QString |
class | QStringView |
class | QByteArray |
struct | QAbstractConcatenable |
bool | operator== (const QString &s1, const QString &s2) noexcept |
bool | operator< (const QString &s1, const QString &s2) noexcept |
bool | operator> (const QString &s1, const QString &s2) noexcept |
Returns true if string s1 is lexically greater than string s2; otherwise returns false . | |
bool | operator!= (const QString &s1, const QString &s2) noexcept |
Returns true if string s1 is not equal to string s2; otherwise returns false . | |
bool | operator<= (const QString &s1, const QString &s2) noexcept |
Returns true if string s1 is lexically less than or equal to string s2; otherwise returns false . | |
bool | operator>= (const QString &s1, const QString &s2) noexcept |
Returns true if string s1 is lexically greater than or equal to string s2; otherwise returns false . | |
bool | operator== (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator< (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator> (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator!= (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator<= (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator>= (const QString &s1, QLatin1StringView s2) noexcept |
bool | operator== (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator< (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator> (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator!= (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator<= (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator>= (QLatin1StringView s1, const QString &s2) noexcept |
bool | operator== (const QString &s1, std::nullptr_t) noexcept |
bool | operator!= (const QString &s1, std::nullptr_t) noexcept |
bool | operator< (const QString &, std::nullptr_t) noexcept |
bool | operator> (const QString &s1, std::nullptr_t) noexcept |
bool | operator<= (const QString &s1, std::nullptr_t) noexcept |
bool | operator>= (const QString &, std::nullptr_t) noexcept |
bool | operator== (std::nullptr_t, const QString &s2) noexcept |
bool | operator!= (std::nullptr_t, const QString &s2) noexcept |
bool | operator< (std::nullptr_t, const QString &s2) noexcept |
bool | operator> (std::nullptr_t, const QString &s2) noexcept |
bool | operator<= (std::nullptr_t, const QString &s2) noexcept |
bool | operator>= (std::nullptr_t, const QString &s2) noexcept |
bool | operator== (const QString &s1, const char16_t *s2) noexcept |
bool | operator!= (const QString &s1, const char16_t *s2) noexcept |
bool | operator< (const QString &s1, const char16_t *s2) noexcept |
bool | operator> (const QString &s1, const char16_t *s2) noexcept |
bool | operator<= (const QString &s1, const char16_t *s2) noexcept |
bool | operator>= (const QString &s1, const char16_t *s2) noexcept |
bool | operator== (const char16_t *s1, const QString &s2) noexcept |
bool | operator!= (const char16_t *s1, const QString &s2) noexcept |
bool | operator< (const char16_t *s1, const QString &s2) noexcept |
bool | operator> (const char16_t *s1, const QString &s2) noexcept |
bool | operator<= (const char16_t *s1, const QString &s2) noexcept |
bool | operator>= (const char16_t *s1, const QString &s2) noexcept |
bool | operator== (QChar lhs, const QString &rhs) noexcept |
bool | operator< (QChar lhs, const QString &rhs) noexcept |
bool | operator> (QChar lhs, const QString &rhs) noexcept |
bool | operator!= (QChar lhs, const QString &rhs) noexcept |
bool | operator<= (QChar lhs, const QString &rhs) noexcept |
bool | operator>= (QChar lhs, const QString &rhs) noexcept |
bool | operator== (const QString &lhs, QChar rhs) noexcept |
bool | operator!= (const QString &lhs, QChar rhs) noexcept |
bool | operator< (const QString &lhs, QChar rhs) noexcept |
bool | operator> (const QString &lhs, QChar rhs) noexcept |
bool | operator<= (const QString &lhs, QChar rhs) noexcept |
bool | operator>= (const QString &lhs, QChar rhs) noexcept |
QT_ASCII_CAST_WARN friend bool | operator== (const char *s1, const QString &s2) |
QT_ASCII_CAST_WARN friend bool | operator!= (const char *s1, const QString &s2) |
Returns true if s1 is not equal to s2; otherwise returns false . | |
QT_ASCII_CAST_WARN friend bool | operator< (const char *s1, const QString &s2) |
Returns true if s1 is lexically less than s2; otherwise returns false . | |
QT_ASCII_CAST_WARN friend bool | operator> (const char *s1, const QString &s2) |
Returns true if s1 is lexically greater than s2; otherwise returns false . | |
QT_ASCII_CAST_WARN friend bool | operator<= (const char *s1, const QString &s2) |
Returns true if s1 is lexically less than or equal to s2; otherwise returns false . | |
QT_ASCII_CAST_WARN friend bool | operator>= (const char *s1, const QString &s2) |
Returns true if s1 is lexically greater than or equal to s2; otherwise returns false . | |
template<typename T > | |
qsizetype | erase (QString &s, const T &t) |
template<typename Predicate > | |
qsizetype | erase_if (QString &s, Predicate pred) |
Related Symbols | |
(Note that these are not member symbols.) | |
QString | operator+ (QString &&s1, const QString &s2) |
Returns a string which is the result of concatenating s1 and s2. | |
QString | operator+ (const QString &s1, const char *s2) |
Returns a string which is the result of concatenating s1 and s2 (s2 is converted to Unicode using the QString::fromUtf8() function). | |
QString | operator+ (const char *s1, const QString &s2) |
Returns a string which is the result of concatenating s1 and s2 (s1 is converted to Unicode using the QString::fromUtf8() function). | |
QDataStream & | operator<< (QDataStream &stream, const QString &string) |
Writes the given string to the specified stream. | |
QDataStream & | operator>> (QDataStream &stream, QString &string) |
Reads a string from the specified stream into the given string. | |
operator""_s (const char16_t *str, size_t size) | |
\macro QStringLiteral(str) | |
template< typename T > qsizetype | erase (QString &s, const T &t) |
template< typename Predicate > qsizetype | erase_if (QString &s, Predicate pred) |
\macro QT_RESTRICTED_CAST_FROM_ASCII
Disables most automatic conversions from source literals and 8-bit data to unicode QStrings, but allows the use of the {QChar(char)} and
{QString(const char (&ch)[N]} constructors, and the
{QString::operator=(const char (&ch)[N])} assignment operator. This gives most of the type-safety benefits of \l QT_NO_CAST_FROM_ASCII but does not require user code to wrap character and string literals with QLatin1Char, QLatin1StringView or similar.
Using this macro together with source strings outside the 7-bit range, non-literals, or literals with embedded NUL characters is undefined.
\macro QT_NO_CAST_FROM_ASCII
Disables automatic conversions from 8-bit strings ({char *}) to Unicode QStrings, as well as from 8-bit
{char} types (
{char} and
{unsigned char}) to QChar.
\macro QT_NO_CAST_TO_ASCII
Disables automatic conversion from QString to 8-bit strings ({char *}).
\macro QT_ASCII_CAST_WARNINGS
This macro can be defined to force a warning whenever a function is called that automatically converts between unicode and 8-bit encodings.
Note: This only works for compilers that support warnings for deprecated API.
\inmodule QtCore \reentrant
The QString class provides a Unicode character string.
QString stores a string of 16-bit \l{QChar}s, where each QChar corresponds to one UTF-16 code unit. (Unicode characters with code values above 65535 are stored using surrogate pairs, i.e., two consecutive \l{QChar}s.)
\l{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 \l{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 (like in embedded systems).
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 fromUtf8() function.
In all of the QString functions that take {const char *} parameters, the
{const char *} is interpreted as a classic C-style '\0'-terminated string encoded in UTF-8. It is legal for the
{const char *} parameter to be \nullptr.
You can also provide string data as an array of \l{QChar}s:
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 \l operator[](). On non-{const} strings, \l 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 \l operator[](), because it never causes a \l{deep copy} to occur. Alternatively, use the first(), last(), or sliced() 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 \l 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:
In the above example the replace() function's first two arguments are the position from which to start replacing and the number of characters that should be replaced.
When data-modifying functions increase the size of the string, they may lead to reallocation of memory for the QString object. When this happens, QString expands by more than it immediately needs so as to have space for further expansion without reallocation until the size of the string has greatly increased.
The insert(), remove() and, when replacing a sub-string with one of different size, replace() functions can be slow (\l{linear time}) for large strings, because they require moving many characters in the string by at least one position in memory.
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 the QString actually has allocated.
QString provides \l{STL-style iterators} (QString::const_iterator and QString::iterator). In practice, iterators are handy when working with generic algorithms provided by the C++ standard library.
{const} method of the QString is called. Accessing such an iterator or reference after the call to a non-
{const} method leads to undefined behavior. When stability for iterator-like functionality is required, you should use indexes instead of iterators as they are not tied to QString's internal state and thus do not get invalidated.
{const} operator or function used on a given QString may cause it to, internally, perform a deep copy of its data. This invalidates all iterators over the string and references to individual characters within it. After the first non-
{const} operator, operations that modify QString may completely (in case of reallocation) or partially invalidate iterators and references, but other methods (such as begin() or end()) will not. Accessing an iterator or reference after it has been invalidated leads to undefined behavior.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 is 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 QRegularExpression 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().
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.
QStrings can be compared using overloaded operators such as \l operator<(), \l operator<=(), \l operator==(), \l 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 usually a better choice for sorting user-interface strings, when such a comparison is available.
On Unix-like platforms (including Linux, \macos and iOS), when Qt is linked with the ICU library (which it usually is), its locale-aware sorting is used. Otherwise, on \macos and iOS, \l localeAwareCompare() compares according the "Order for sorted
lists" setting in the International preferences panel. On other Unix-like systems without ICU, the comparison falls back to the system library's strcoll()
,
QString provides the following three functions that return a {const char *} version of the string as QByteArray: toUtf8(), toLatin1(), and toLocal8Bit().
\list
To convert from one of these encodings, QString provides fromLatin1(), fromUtf8(), and fromLocal8Bit(). Other encodings are supported through the QStringEncoder and QStringDecoder classes.
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 some of the following preprocessor symbols:
\list
You then need to explicitly call fromUtf8(), fromLatin1(), or fromLocal8Bit() to construct a QString from an 8-bit string, or use the lightweight QLatin1StringView class, for example:
Similarly, you must call toLatin1(), toUtf8(), or toLocal8Bit() explicitly to convert the QString to an 8-bit string.
\table 100 % \header
\row
{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.
\endtable
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, toUtf8().constData() returns a valid pointer (not nullptr) to a '\0' character for a null string. We recommend that you always use the isEmpty() function and avoid isNull().
When a QString::arg() {''} format specifier includes the
{'L'} locale qualifier, and the base is ten (its default), the default locale is used. This can be set using \l{QLocale::setDefault()}. For more refined control of localized string representations of numbers, see QLocale::toString(). All other number formatting done by QString follows the C locale's representation of numbers.
When QString::arg() applies left-padding to numbers, the fill character {'0'} is treated specially. If the number is negative, its minus sign will appear before the zero-padding. If the field is localized, the locale-appropriate zero character is used in place of
{'0'}. For floating-point numbers, this special treatment only applies if the number is finite.
In member functions (e.g., arg(), number()) that represent floating-point numbers (float
or double
) as strings, the form of display can be controlled by a choice of format and precision, whose meanings are as for \l {QLocale::toString(double, char, int)}.
If the selected format includes an exponent, localized forms follow the locale's convention on digits in the exponent. For non-localized formatting, the exponent shows its sign and includes at least two digits, left-padding with zero if needed.
Many strings are known at compile time. The QString constructor from C++ string literals will copy the contents of the string, treating the contents as UTF-8. This requires a memory allocation and the re-encoding of the string data, operations that will happen at runtime. If the string data is known at compile time, you can use the QStringLiteral macro or similarly {operator""_s} to create QString's payload at compile time instead.
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.
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.
Additional efficiency is gained by inlining and reduced reference counting (the QString created from a {QStringBuilder} has a ref count of 1, whereas QString::append() needs an extra test).
There are two 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 more convenient but not entirely source compatible, is to define QT_USE_QSTRINGBUILDER
(by adding it to the compiler flags) at build time. This will make concatenating strings with {'+'} work the same way as
{QStringBuilder}
{''}.
auto
keyword) with the result of string concatenation when QStringBuilder is enabled will show that the concatenation is indeed an object of a QStringBuilder specialization:This does not cause any harm, as QStringBuilder will implictly convert to QString when required. If this is undesirable, then one should specify the required types instead of having the compiler deduce them:
The maximum size of QString depends on the architecture. Most 64-bit systems can allocate more than 2 GB of memory, with a typical limit of 2^63 bytes. The actual value also depends on the overhead required for managing the data block. As a result, you can expect the maximum size of 2 GB minus overhead on 32-bit platforms, and 2^63 bytes minus overhead on 64-bit platforms. The number of elements that can be stored in a QString is this maximum size divided by the size of QChar.
When memory allocation fails, QString throws a std::bad_alloc
exception if the application was compiled with exception support. Out of memory conditions in Qt containers are the only case where Qt will throw exceptions. If exceptions are disabled, then running out of memory is undefined behavior.
Note that the operating system may impose further limits on applications holding a lot of allocated memory, especially large, contiguous blocks. Such considerations, the configuration of such behavior or any mitigation are outside the scope of the Qt API.
The QString::const_pointer typedef provides an STL-style const pointer to a QString element (QChar).
Qt-style synonym for QString::const_iterator.
typedef QStringPrivate QString::DataPointer |
Qt-style synonym for QString::iterator.
The QString::pointer typedef provides an STL-style pointer to a QString element (QChar).
This enum describes the various normalized forms of Unicode text.
\value NormalizationForm_D Canonical Decomposition \value NormalizationForm_C Canonical Decomposition followed by Canonical Composition \value NormalizationForm_KD Compatibility Decomposition \value NormalizationForm_KC Compatibility Decomposition followed by Canonical Composition
Enumerator | |
---|---|
NormalizationForm_D | |
NormalizationForm_C | |
NormalizationForm_KD | |
NormalizationForm_KC |
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.
\value SectionDefault Empty fields are counted, leading and trailing separators are not included, and the separator is compared case sensitively.
\value SectionSkipEmpty Treat empty fields as if they don't exist, i.e. they are not considered as far as start and end are concerned.
\value SectionIncludeLeadingSep Include the leading separator (if any) in the result string.
\value SectionIncludeTrailingSep Include the trailing separator (if any) in the result string.
\value SectionCaseInsensitiveSeps Compare the separator case-insensitively.
Enumerator | |
---|---|
SectionDefault | |
SectionSkipEmpty | |
SectionIncludeLeadingSep | |
SectionIncludeTrailingSep | |
SectionCaseInsensitiveSeps |
|
inlineconstexprnoexcept |
Constructs a null string.
Null strings are also considered empty.
Definition at line 1170 of file qstring.h.
Referenced by clear(), fromLatin1(), fromLocal8Bit(), fromRawData(), fromUcs4(), fromUtf16(), fromUtf8(), left(), mid(), operator=(), repeated(), right(), section(), and section().
Constructs a string initialized with the first size characters of the QChar array unicode.
If unicode is 0, a null string is constructed.
If size is negative, unicode is assumed to point to a \0'-terminated array and its length is determined dynamically. The terminating null character is not considered part of the string.
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 2482 of file qstring.cpp.
References QTypedArrayData< char16_t >::allocate(), QArrayDataPointer< T >::clear(), QArrayDataPointer< T >::data(), QArrayDataPointer< char16_t >::fromRawData(), isNull(), Q_CHECK_PTR(), and unicode().
QString::QString | ( | QChar | c | ) |
Constructs a string of size 1 containing the character ch.
Definition at line 2551 of file qstring.cpp.
References QTypedArrayData< char16_t >::allocate(), ch, QArrayDataPointer< T >::data(), and Q_CHECK_PTR().
Constructs a string of the given size with every character set to ch.
Definition at line 2509 of file qstring.cpp.
References QTypedArrayData< char16_t >::allocate(), ch, QArrayDataPointer< T >::data(), e, QArrayDataPointer< char16_t >::fromRawData(), and Q_CHECK_PTR().
|
inline |
Constructs a copy of the Latin-1 string viewed by str.
Definition at line 1077 of file qstring.h.
References QLatin1StringView::data(), fromLatin1(), and QLatin1StringView::size().
|
inlinenoexcept |
Constructs a copy of other.
This operation takes \l{constant time}, because QString is \l{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 \l{linear time}.
|
inlinedefaultnoexcept |
Move-constructs a QString instance, making it point at the same object that other was pointing to.
|
inline |
Constructs a string initialized with the 8-bit string str.
The given const char pointer is converted to Unicode using the fromUtf8() function.
You can disable this constructor by defining \l 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.
{QString(const char (&ch)[N])} constructor instead. Using non-literal input, or input with embedded NUL characters, or non-7-bit characters is undefined in this case.
|
inline |
Constructs a string initialized with the byte array ba.
The given byte array is converted to Unicode using fromUtf8().
You can disable this constructor by defining \l 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.
QString::QString | ( | qsizetype | size, |
Qt::Initialization | |||
) |
Constructs a string of the given size without initializing the characters. This is only used in QStringBuilder::toString()
.
Definition at line 2530 of file qstring.cpp.
References QTypedArrayData< char16_t >::allocate(), QArrayDataPointer< T >::data(), QArrayDataPointer< char16_t >::fromRawData(), and Q_CHECK_PTR().
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 3161 of file qstring.cpp.
References QArrayDataPointer< T >::data(), QtPrivate::QCommonArrayOps< T >::growAppend(), QArrayDataPointer< T >::size, and str.
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 (\l{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 3135 of file qstring.cpp.
References append(), constData(), isNull(), operator=(), size(), and str.
Definition at line 3227 of file qstring.cpp.
References ch, QtPrivate::QGenericArrayOps< T >::copyAppend(), QArrayDataPointer< T >::data(), QArrayDataPointer< T >::detachAndGrow(), QArrayData::GrowsAtEnd, and QArrayDataPointer< T >::size.
Referenced by QQmlJS::Dom::OutWriter::OutWriter(), QTemporaryFileName::QTemporaryFileName(), QFileSystemEngine::absoluteName(), CPP::WriteDeclaration::acceptUI(), QQmlJS::Dom::ImportScope::addImport(), addressLine(), QXmlStreamPrivateTagStack::addToStringStorage(), QQmlDelayedCallQueue::addUniquelyAndExecuteLater(), append(), Widget::appendFunction(), QQuickStyledTextPrivate::appendText(), assign(), QQmlJSImportVisitor::breakInheritanceCycles(), buildAndroidProject(), QV4DataCollector::collectScope(), QColorOutput::colorify(), comify(), QSqlQueryModelSql::comma(), QQuickStateGroup::componentComplete(), QSqlQueryModelSql::concat(), QPlaceManagerEngineNokiaV2::constructIconUrl(), convertToAscii(), convertToUnicode(), cpp(), createChangeNotification(), QKmsDevice::createScreenForConnector(), QAbstractFileEngineIterator::currentFilePath(), QMimerSQLResult::data(), QCalendarBackend::dateTimeToString(), deployQmlImports(), QQmlJS::Dom::FieldFilter::describeFieldsFilter(), QQmlData::destroyed(), QLocaleData::doubleToString(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QTextEngine::elidedText(), QSqlQueryModelSql::eq(), QMimerSQLResult::exec(), QWindowsFontDatabaseBase::extraTryFontsForFamily(), SharedTextureImageResponse::fallbackPath(), QFileSystemModelPrivate::filePath(), FolderIterator::fileType(), QV4::Moth::BytecodeGenerator::finalize(), QSSGRenderEffect::finalizeShaders(), findQtPlugins(), QmlTypesClassDescription::findType(), QQmlJS::Dom::Path::fromString(), QTlsBackendOpenSSL::getErrorsFromOpenSsl(), QQmlDebugTranslationServicePrivate::getStyleNameForFont(), header(), Driver::headerFileName(), QQuickTest::initView(), QTextDocumentPrivate::insert(), insert(), QTextDocumentPrivate::insertBlock(), QXcbMime::mimeAtomForFormat(), Widget::modify(), QQmlJS::Dom::PathEls::Root::name(), QQmlJS::Dom::PathEls::Current::name(), QFileSystemModelPrivate::node(), QPSQLDriver::open(), QIconTheme::parents(), QQuickStyledTextPrivate::parseCloseTag(), parseCSStoXMLAttrs(), SyncScanner::parseHeader(), parseNumbersArray(), parseNumbersArray(), parseNumbersList(), Parser::parseParamReplace(), parsePercentageList(), parseStopNode(), QQuickStyledTextPrivate::parseTag(), QSvgIconEnginePrivate::pmcKey(), QV4::Function::prettyName(), QMimerSQLDriver::primaryIndex(), QODBCDriver::primaryIndex(), QApplicationPrivate::process_cmdline(), qDBusInterfaceFromMetaObject(), qQuote(), qRelocateResourceFile(), QTest::qSignalDumperCallback(), DomInclude::read(), DomHeader::read(), DomResourcePixmap::read(), DomResourceIcon::read(), DomString::read(), QMimerSQLDriver::record(), AppendText::redo(), QGeoRouteParserOsrmV5Private::requestUrl(), resolveImagePath(), QToolBarAreaLayout::restoreState(), QQmlJSCodeGenerator::run(), runMoc(), runQmlImportScanner(), QQmlJS::Lexer::scanDirectives(), QQuickTextInput::setInputMask(), QMessagePattern::setPattern(), QWindowsSystemTrayIcon::showMessage(), QSqlDriver::sqlStatement(), QMimeType::suffixes(), QGeoCoordinate::toString(), ToString(), QIPAddressUtils::toString(), QSSGQmlUtilities::valueToQml(), vcRedistDir(), QmlIR::IRBuilder::visit(), QQmlJS::Dom::LineWriter::write(), and write_pbm_image().
QString & QString::append | ( | QLatin1StringView | s | ) |
Definition at line 3178 of file qstring.cpp.
References str.
|
inline |
QString & QString::append | ( | QUtf8StringView | s | ) |
Definition at line 3190 of file qstring.cpp.
References str.
|
inline |
Replaces occurrences of {N} in this string with the corresponding argument from args. The arguments are not positional: the first of the args replaces the
{N} with the lowest
{N} (all of them), the second of the args the
{N} with the next-lowest
{N} etc.
Args
can consist of anything that implicitly converts to QString, QStringView or QLatin1StringView.
In addition, the following types are also supported: QChar, QLatin1Char.
Definition at line 268 of file qstring.h.
References QStringView::arg(), args, and qToStringViewIgnoringNull().
Definition at line 8734 of file qstring.cpp.
References arg.
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 asprintf() 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 8440 of file qstring.cpp.
References arg, and qToStringViewIgnoringNull().
QString QString::arg | ( | double | a, |
int | fieldWidth = 0 , |
||
char | format = 'g' , |
||
int | precision = -1 , |
||
QChar | fillChar = u' ' |
||
) | const |
Definition at line 8754 of file qstring.cpp.
References QLocaleData::AddTrailingZeroes, arg, QLocaleData::c(), QLocaleData::CapitalEorX, d, data(), QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocaleData::DFSignificantDigits, QLocaleData::doubleToString(), findArgEscapes(), form, QLocaleData::GroupDigits, QLocale::IncludeTrailingZeroesAfterDot, QtMiscUtils::isAsciiUpper(), QLocaleData::NoFlags, QLocale::OmitGroupSeparator, QLocale::OmitLeadingZeroInExponent, Q_ASSERT, qIsFinite(), qWarning, replaceArgEscapes(), size(), QtMiscUtils::toAsciiLower(), toLocal8Bit(), QLocaleData::ZeroPadded, and QLocaleData::ZeroPadExponent.
Definition at line 8724 of file qstring.cpp.
References arg.
QString QString::arg | ( | QLatin1StringView | a, |
int | fieldWidth = 0 , |
||
QChar | fillChar = u' ' |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a copy of this string with the lowest-numbered place-marker replaced by the Latin-1 string viewed by a, i.e., %1
, %2
, ..., %99
.
fieldWidth specifies the minimum amount of space that 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.
One advantage of using arg() over asprintf() 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, arg() replaces all of them.
If there is no unreplaced place-marker remaining, a warning message is printed and the result is undefined. Place-marker numbers must be in the range 1 to 99.
Definition at line 8513 of file qstring.cpp.
References arg, QStringView, qt_from_latin1_to_qvla(), and utf16().
QString QString::arg | ( | qlonglong | a, |
int | fieldwidth = 0 , |
||
int | base = 10 , |
||
QChar | fillChar = u' ' |
||
) | const |
Definition at line 8606 of file qstring.cpp.
References arg, base, QLocaleData::c(), d, findArgEscapes(), QLocaleData::GroupDigits, QLocaleData::longLongToString(), QLocaleData::NoFlags, QLocale::OmitGroupSeparator, Q_ASSERT, qIsFinite(), qWarning, replaceArgEscapes(), size(), and QLocaleData::ZeroPadded.
Referenced by GeoRouteJsonParserEsri::GeoRouteJsonParserEsri(), QtGraphicsAnchorLayout::ParallelAnchorData::ParallelAnchorData(), QNetworkReplyDataImpl::QNetworkReplyDataImpl(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), QQuickVisualTestUtils::QQuickApplicationHelper::QQuickApplicationHelper(), QtGraphicsAnchorLayout::SequentialAnchorData::SequentialAnchorData(), QMessageBox::aboutQt(), QGraphicsAnchorLayoutPrivate::addAnchor_helper(), addFunction(), QQmlJSLinter::applyFixes(), Widget::argFunction(), QQuickSpriteEngine::assembledImage(), buildAndroidProject(), buildMatchRule(), QV4::CallMethod(), QImageWriterPrivate::canWriteHelper(), checkRegistration(), QBenchmarkValgrindUtils::cleanup(), Collector::collect(), colorValue(), conflictingVersionToString(), QBluetoothSocketPrivateAndroid::connectToServiceHelper(), containsApplicationBinary(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertStored(), copyStdCpp(), QWindowsDirect2DIntegration::create(), createDirectory(), QV4::Script::createFromFileOrCache(), createPixmapDataSync(), QQuickDesignerSupportItems::createPrimitive(), QQuickAbstractAnimationPrivate::createProperty(), createSequence(), createSymbolicLink(), QOutputStrategy::createUniqueImageName(), TableModel::data(), QGraphicsSceneBspTree::debug(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QSimplex::dumpMatrix(), QHttpNetworkConnectionPrivate::errorDetail(), QPcsc::errorMessage(), QJSEngine::evaluate(), QWasmScreen::eventTargetId(), exitDirection(), QBluetoothSocketPrivateAndroid::fallBackReversedConnect(), fallbackStyleUri(), fboStatusString(), QSqlResultPrivate::fieldSerial(), fileArchitecture(), fileInfoListToString(), findPatternUnloaded(), QHttpThreadDelegate::finishedSlot(), QMinimalBackingStore::flush(), QSGDefaultRenderContext::fontKey(), QTest::Internal::formatTryTimeoutDebugMessage(), GLSL::Semantic::functionIdentifier(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), QLocalSocketPrivate::generateErrorString(), generateFileName(), QSvgPaintEnginePrivate::generateGradientName(), generateInterfaceXml(), generateInterfaceXml(), genVulkanFunctionsPC(), AndroidCamcorderProfile::get(), QCacheUtils::getCachedFilename(), QGeoUriProvider::getCurrentHost(), QBenchmarkValgrindUtils::getNewestFileName(), getQtLibsFromElf(), QNearFieldTargetPrivateImpl::getTagTechnology(), GeoTileFetcherEsri::getTileImage(), QCommandLineParserPrivate::helpText(), if(), init_platform(), inputStreamStateCallback(), QQuickGridLayout::insertLayoutItems(), instructionUseLane(), QKeySequencePrivate::keyName(), QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), QGeoServiceProviderPrivate::loadMeta(), main(), QDnsLookupReply::makeDnsRcodeError(), makeFpString(), maxExpression(), QQuickJSContext2D::method_get_fillStyle(), QQuickJSContext2D::method_get_strokeStyle(), minExpression(), mmErrorMessage(), msgCouldNotGet(), msgCouldNotSet(), QTlsBackendOpenSSL::msgErrorsDuringHandshake(), msgErrorSettingBackendConfig(), msgErrorSettingEllipticCurves(), dtlsopenssl::msgFunctionFailed(), msgImperialPageSizeInch(), msgOpenReadFailed(), notfound(), QNetworkFile::open(), QNetworkAccessCacheBackend::open(), QNetworkAccessFileBackend::open(), QOCIDriver::open(), QSaveFile::open(), QQmlJSTypeDescriptionReader::operator()(), QWasmScreen::outerScreenId(), QBenchmarkValgrindUtils::outFileBase(), outputStreamStateCallback(), QStaticTextPrivate::paintText(), GLSL::Parser::parse(), QMimeTypeParserBase::parse(), parseBoolean(), RCCResourceLibrary::parseCompressionAlgorithm(), RCCResourceLibrary::parseCompressionLevel(), QT_BEGIN_NAMESPACE::parseLocation(), parseOptions(), QCommandLineParserPrivate::parseOptionValue(), patchQtCore(), QMYSQLDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QQmlAbstractBinding::printBindingLoopError(), QGstreamerAudioDecoder::processBusMessage(), QQmlModelIndexValueType::propertiesString(), QSvgPaintEngine::qbrushToSvg(), qDBusGenerateClassDefXml(), qDBusReplyFill(), qffmpegLogCallback(), QTest::qFindTestData(), qFormatTimeStamps(), qMakeError(), qMakeError(), qQmlResolveImportPaths(), qRequireVersion(), Http2::qt_error(), qt_get_metadata(), QQmlJSScope::qualifiedNameFrom(), reachableSymbols(), QAlsaAudioSource::read(), QPulseAudioSource::read(), QNetworkAccessFileBackend::read(), RCCResourceLibrary::readFiles(), readImage(), readInputFile(), QOCIDriver::record(), QGraphicsAnchorLayoutPrivate::replaceVertex(), QQuickWindowPrivate::rhiCreationFailureMessage(), ValueLookupJob::run(), QQmlJSCodeGenerator::run(), QQmlJSFunctionInitializer::run(), PragmaParser< Argument >::run(), runAdb(), QmlTypeRegistrar::runExtract(), QV4::MemoryManager::runGC(), runRcc(), QSSGBufferManager::runtimeMeshSourceName(), QSvgPaintEngine::savePatternBrush(), QSvgPaintEngine::savePatternMask(), scanImports(), QQmlJS::Lexer::scanRegExp(), PlaceManagerEngineEsri::search(), QQmlToolingSettings::search(), QSqlRelationalTableModel::selectStatement(), QQmlDebugTranslationServicePrivate::sendTranslatableTextOccurrences(), serverInfoCallback(), QDecompressHelper::setEncoding(), QLocalServerPrivate::setError(), QMdiSubWindowPrivate::setNewWindowTitle(), signAAB(), QQmlPropertyCache::signalParameterStringForJS(), signPackage(), simpleTypeString(), sinkInfoCallback(), sourceInfoCallback(), QuickTestResult::stringify(), QMediaMetaData::stringValue(), styleUri(), QHttpThreadDelegate::synchronousFinishedSlot(), QQuickTableViewPrivate::tableLayoutToString(), QSQLiteDriver::tables(), QSchannelBackend::tlsLibraryBuildVersionString(), QQmlDebugTranslation::TranslationIssue::toDebugString(), QBenchmarkContext::toString(), QQmlItemSelectionRangeValueType::toString(), QQuickVector2DValueType::toString(), QQuickVector3DValueType::toString(), QQuickVector4DValueType::toString(), QQuickQuaternionValueType::toString(), QQuickFontValueType::toString(), QPdfLink::toString(), GLSL::VectorType::toString(), GLSL::MatrixType::toString(), QGeoCoordinate::toString(), translate_color(), translate_dashPattern(), updateAndroidManifest(), updateFile(), updateFile(), updateLibsXml(), QLibraryPrivate::updatePluginState(), MainWindow::updateSelection(), QNetworkAccessFileBackend::uploadReadyReadSlot(), valueToKeySequence(), QV4::ExecutableCompilationUnit::verifyHeader(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), QV4::Compiler::Codegen::visit(), QmlIR::IRBuilder::visit(), warnIfHorizontallyAnchored(), Jpeg2000JasperReader::write(), QmlTypeRegistrar::write(), writeAttribute(), QBluetoothSocketPrivateBluez::writeData(), RCCFileInfo::writeDataBlob(), QTextOdfWriter::writeListFormat(), and QSSGQmlUtilities::writeQml().
QString QString::arg | ( | QStringView | a, |
int | fieldWidth = 0 , |
||
QChar | fillChar = u' ' |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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 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 asprintf() 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, arg() replaces all of them.
If there is no unreplaced place-marker remaining, a warning message is printed and the result is undefined. Place-marker numbers must be in the range 1 to 99.
Definition at line 8477 of file qstring.cpp.
References d, findArgEscapes(), Q_UNLIKELY, qUtf16Printable, qWarning, and replaceArgEscapes().
QString QString::arg | ( | qulonglong | a, |
int | fieldwidth = 0 , |
||
int | base = 10 , |
||
QChar | fillChar = u' ' |
||
) | const |
Definition at line 8654 of file qstring.cpp.
References arg, base, QLocaleData::c(), d, findArgEscapes(), QLocaleData::GroupDigits, QLocaleData::NoFlags, QLocale::OmitGroupSeparator, Q_ASSERT, qIsFinite(), qWarning, replaceArgEscapes(), size(), QLocaleData::unsLongLongToString(), and QLocaleData::ZeroPadded.
|
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 argument specifies the base to use when converting the integer a into a string. The base must be between 2 and 36, with 8 giving octal, 10 decimal, and 16 hexadecimal numbers.
|
static |
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments.
The format string supports the conversion specifiers, length modifiers, and flags provided by printf() in the standard C++ library. The cformat string and {s} arguments must be UTF-8 encoded.
{lc} escape sequence expects a unicode character of type char16_t
, or ushort
(as returned by QChar::unicode()). The
{ls} escape sequence expects a pointer to a zero-terminated array of unicode characters of type char16_t
, or ushort (as returned by QString::utf16()). This is at odds with the printf() in the standard C++ library, which defines {lc}
to print a wchar_t and
{ls} to print a
{wchar_t*}, and might also produce compiler warnings on platforms where the size of {wchar_t}
is not 16 bits.For \l {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 7005 of file qstring.cpp.
References vasprintf().
Referenced by addFunction(), addStartCond(), QSSGStageGeneratorBase::buildShaderSourcePass2(), QCoreApplicationPrivate::checkReceiverThread(), QRhiMetal::create(), QKmsDevice::discoverPlanes(), double2string(), dumpAttributeVariant(), DebugViewHelpers::ensureDebugObjectName(), QQmlJavaScriptExpression::expressionIdentifier(), funcCall(), funcSig(), generateInterfaceXml(), genVulkanFunctionsH(), genVulkanFunctionsPC(), genVulkanFunctionsPH(), QQmlPluginImporter::importPlugins(), int2string(), QTimeZonePrivate::isoOffsetFormat(), QSysInfo::kernelVersion(), main(), QMimeTypeParserBase::parse(), QSysInfo::prettyProductName(), printRenderPassDetails(), QSysInfo::productVersion(), QTest::qCaught(), QQmlEnginePrivate::singletonInstance(), timeUnit(), toOffsetString(), QQmlPointFValueType::toString(), QQmlPointValueType::toString(), QQmlSizeFValueType::toString(), QQmlSizeValueType::toString(), QQmlRectFValueType::toString(), QQmlRectValueType::toString(), updateLibsXml(), QPrintPreviewDialogPrivate::updateZoomFactor(), QSettingsPrivate::variantToString(), QQmlImports::versionString(), and write_xpm_image().
|
inline |
Definition at line 425 of file qstring.h.
References append(), ch, d, QChar::fromUcs4(), reserve(), resize(), and q20::to_address().
QString & QString::assign | ( | QAnyStringView | v | ) |
Replaces the contents of this string with a copy of v and returns a reference to this string.
The size of this string will be equal to the size of v, converted to UTF-16 as if by {v.toString()}. Unlike QAnyStringView::toString(), however, this function only allocates memory if the estimated size exceeds the capacity of this string or this string is shared.
Definition at line 3377 of file qstring.cpp.
References append(), QArrayDataPointer< T >::begin(), capacity(), QArrayDataPointer< T >::freeSpaceAtBegin(), isDetached(), resize(), and QArrayDataPointer< T >::setBegin().
Replaces the contents of this string with n copies of c and returns a reference to this string.
The size of this string will be equal to n, which has to be non-negative.
This function will only allocate memory if n exceeds the capacity of this string or this string is shared.
Definition at line 419 of file qstring.h.
References fill(), and Q_ASSERT.
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 1079 of file qstring.h.
References d, i, Q_ASSERT, and size().
Referenced by QQmlJS::Dom::CommentInfo::CommentInfo(), CompletionContextStrings::CompletionContextStrings(), QQmlTypeLoader::absoluteFilePath(), addFontToDatabase(), addFontToDatabase(), addressLine(), advanceStringIndex(), QUrlPrivate::appendHost(), appendReplacementString(), QQmlPropertyCache::appendSignal(), QCoreApplication::applicationFilePath(), QToolBarAreaLayout::apply(), Widget::atFunction(), QTextEngine::atWordSeparator(), QWidgetLineControl::backspace(), QQuickTextInputPrivate::backspace(), QFileSystemEntry::baseName(), Utils::TextDocument::characterAt(), checkArgumentsObjectUseInSignalHandlers(), QQmlJS::Dom::AstComments::collectComments(), colorValue(), comify(), QFileSystemEntry::completeBaseName(), convertMnemonics(), createDirectoryWithParents(), QTextLayout::createLine(), QQuickPropertyAnimation::createTransitionActions(), decodeFsEncString(), QTextCursor::deletePreviousChar(), QmlLsp::QmlLintSuggestions::diagnose(), QMacStyle::drawControl(), QAbstractItemModel::dropMimeData(), QAbstractTableModel::dropMimeData(), QAbstractListModel::dropMimeData(), QTextHtmlParser::eatSpace(), QTextEngine::elidedText(), encodeText(), QQmlJS::SourceLocation::endZeroLengthLocation(), QQmlJS::Dom::LineWriter::ensureSpace(), QQmlJS::Dom::LineWriter::ensureSpace(), QQuickDialogTestUtils::enterText(), errorMessage(), QRegularExpression::escape(), QtPrivate::QCalendarTextNavigator::eventFilter(), QFontEngineMulti::fallbackFamilyAt(), QFileSystemEntry::fileName(), findDependentQtLibraries(), findInBlock(), findObject(), findTextEntry(), QToolBarAreaLayout::findToolBar(), QUrl::fromLocalFile(), QQmlJS::Dom::Path::fromString(), QToolBarAreaLayoutInfo::gapIndex(), QToolBarAreaLayout::getStyleOptionInfo(), QV4::RegExp::getSubstitution(), QQmlJS::Dom::LineWriter::handleTrailingSpace(), QTextHtmlParserNode::hasOnlyWhitespace(), QTextHtmlParser::hasPrefix(), hasValidSignal(), Driver::headerFileName(), QDeclarativeSupportedCategoriesModel::index(), QToolBarAreaLayout::indexOf(), iniChopTrailingSpaces(), QGeoSatelliteInfoSourceGypsy::init(), init_platform(), QQmlDelegateModelItemMetaType::initializeMetaObject(), QQmlDelegateModelItemMetaType::initializePrototype(), QQmlPropertyPrivate::initProperty(), QSettingsPrivate::iniUnescapedKey(), QSettingsPrivate::iniUnescapedStringList(), QQuickTextInput::insert(), QToolBarAreaLayoutInfo::insertItem(), QTextCursor::insertText(), QToolBarAreaLayoutInfo::insertToolBarBreak(), QFileSystemEntry::isAbsolute(), QInputControl::isAcceptableInput(), isLineSeparatorBlockAfterTable(), QUrl::isParentOf(), isParentOf(), isQtModule(), QDateTimeEditPrivate::isSeparatorKey(), QQmlJS::Dom::Binding::isSignalHandler(), isSignalPropertyName(), isSpecialKey(), QToolBarAreaLayout::itemAt(), QToolBarAreaLayoutInfo::itemRect(), QTextEdit::keyPressEvent(), QCss::Symbol::lexem(), loadTzTimeZones(), QQmlImportDatabase::locateLocalQmldir(), mangledIdentifier(), maybeEscapeFirstChar(), QV4::ExecutionEngine::metaTypeFromJS(), QV4::StringPrototype::method_charAt(), QV4::StringPrototype::method_charCodeAt(), QV4::StringIteratorPrototype::method_next(), Qt::mightBeRichText(), QAbstractItemModel::mimeData(), QKeySequence::mnemonic(), QTextDocumentPrivate::move(), QTextCursorPrivate::movePosition(), QToolBarAreaLayoutInfo::moveToolBar(), QTextHtmlParser::newNode(), QTextLineItemIterator::next(), nextNonWhitespace(), QQmlError::operator<<(), QTextHtmlParser::parse(), QTextHtmlParser::parseCloseTag(), parseColorValue(), QTextHtmlParser::parseEntity(), QTextHtmlParser::parseExclamationTag(), parseFlags(), parseFont(), SyncScanner::parseHeader(), parseHtmlMetaForEncoding(), parseHttpOptionHeader(), parseInt(), parseIntOption(), QTextHtmlParser::parseTag(), QTextHtmlParser::parseWord(), QFileSystemEntry::path(), pythonRoot(), qGetTableInfo(), QQml_isFileCaseCorrect(), qt_mac_removeMnemonics(), QQC2_NAMESPACE::qt_mac_removeMnemonics(), qt_punycodeDecoder(), Driver::qtify(), quote(), QOCICols::readPiecewise(), QPSQLDriver::record(), QQmlJS::Dom::IndentingLineWriter::reindentAndSplit(), removeDuplicateProxies(), QPlatformTheme::removeMnemonics(), QToolBarAreaLayoutInfo::removeToolBarBreak(), runMoc(), runRcc(), QSSGQmlUtilities::sanitizeQmlId(), QToolBarAreaLayout::saveState(), QQmlJS::Lexer::scanDirectives(), QV4::Compiler::StringTableGenerator::serialize(), QUrlPrivate::setAuthority(), QmlIR::IRBuilder::setId(), QQmlJS::Dom::LineWriter::setLineIndent(), QQuick3DRenderStatsMeshesModel::setMeshData(), QQuick3DRenderStatsPassesModel::setPassData(), QQuick3DRenderStatsTexturesModel::setTextureData(), QQuickTextPrivate::setupTextLayout(), QmlIR::IRBuilder::signalNameFromSignalPropertyName(), QV4::Compiler::StringTableGenerator::stringForIndex(), QSettingsPrivate::stringListToVariantList(), QCss::StyleSelector::styleRulesForNode(), QQmlLSUtils::textOffsetFrom(), QUrlPrivate::toLocalFile(), QToolBarAreaLayout::toolBarBreak(), toVariant(), tryDriveUNCFallback(), QToolBarAreaLayout::unplug(), unquote(), QDateTimeEditPrivate::validateAndInterpret(), QQmlConnectionsParser::verifyBindings(), GLSL::Semantic::visit(), QmlIR::IRBuilder::visit(), QmlIR::IRBuilder::visit(), TestHTTPServer::wait(), doc_src_richtext::wrapper2(), wrapText(), QTextMarkdownWriter::writeBlock(), QTextOdfWriter::writeBlock(), xpmHash(), and QLocaleData::zeroUcs().
|
inline |
Returns a reference to the last character in the string. Same as {operator[](size() - 1)}.
This function is provided for STL compatibility.
Definition at line 1196 of file qstring.h.
References operator[](), and size().
|
inline |
Returns the last character in the string. Same as {at(size() - 1)}.
This function is provided for STL compatibility.
Definition at line 216 of file qstring.h.
References at.
Referenced by QWindowsNativeFileDialogBase::setNameFilters().
|
inline |
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
! [iterator-invalidation-func-desc]
\sa constBegin(), end()
Definition at line 1197 of file qstring.h.
Referenced by QQmlDelayedCallQueue::addUniquelyAndExecuteLater(), decode(), erase(), isIp6(), Parser::lineNumber(), remove(), remove(), replace(), QQmlJSScope::resolveEnums(), and set_text().
|
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 1111 of file qstring.h.
References d.
Referenced by assign(), QDB2Result::exec(), QOCICols::execBatch(), needsReallocate(), operator=(), operator=(), reserve(), and squeeze().
|
inline |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
iterator-invalidation-func-desc
Definition at line 1201 of file qstring.h.
References d.
Referenced by language::_formatString(), erase(), getIcuVersion(), insert(), insert_helper(), QSSGMesh::Mesh::save(), QStringAlgorithms< StringType >::simplified_helper(), QStringAlgorithms< StringType >::trimmed_helper(), QStringAlgorithms< StringType >::trimmed_helper_inplace(), and QQmlJS::Dom::AttachedInfoT< Info >::visitTree().
|
inline |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the string.
iterator-invalidation-func-desc
Definition at line 1209 of file qstring.h.
References d.
Referenced by getIcuVersion(), insert(), insert_helper(), QSSGMesh::Mesh::save(), QStringAlgorithms< StringType >::simplified_helper(), QStringAlgorithms< StringType >::trimmed_helper(), and QQmlJS::Dom::AttachedInfoT< Info >::visitTree().
Removes n characters from the end of the string.
If n is greater than or equal to size(), the result is an empty string; if n is negative, it is equivalent to passing zero.
Example:
If you want to remove characters from the beginning of the string, use remove() instead.
Definition at line 6180 of file qstring.cpp.
References resize(), and QArrayDataPointer< T >::size.
Referenced by QQmlImports::addFileImport(), QFseventsFileSystemWatcherEngine::addPaths(), addressLine(), buildMatchRule(), QCommonStylePrivate::calculateElidedText(), QQC2::QCommonStylePrivate::calculateElidedText(), Widget::chopFunction(), colorValue(), QQmlPreviewFileEngineHandler::create(), QNetworkInformationPrivate::create(), QFileSystemEngine::createDirectory(), createDiskImage(), QUrl::errorString(), formattedAddress(), genVulkanFunctionsPC(), QAndroidInputContext::getTextBeforeCursor(), QCommandLineParserPrivate::helpText(), jump(), QCompletionEngine::matchHint(), QPdfDocument::metaData(), QQuickJSContext2D::method_get_fillStyle(), QQuickJSContext2D::method_get_strokeStyle(), QV4::UrlSearchParamsPrototype::method_toString(), QXcbMime::mimeConvertToFormat(), QFileSystemModelPrivate::node(), packagePath(), parseClockValue(), QHttpHeaderParser::parseHeaders(), parseOtoolLibraryLine(), QCss::Parser::parsePseudo(), QCss::Parser::parseTerm(), QTest::qSignalDumperCallback(), removeOptionalQuotes(), QFseventsFileSystemWatcherEngine::removePaths(), QMimeDataPrivate::retrieveTypedData(), rolesToString(), QAndroidInputContext::setComposingRegion(), setFontSizeFromValue(), QWindowsNativeFileDialogBase::setNameFilters(), setWordSpacingFromValue(), QSqlDriver::sqlStatement(), QDB2Driver::tables(), QIBaseDriver::tables(), QImage::text(), translate_dashPattern(), translateDriveName(), AppendText::undo(), updateLibsXml(), QQmlJSImportVisitor::visit(), and QTextMarkdownWriter::writeBlock().
Returns a string that contains the size() - len leftmost characters of this string.
Definition at line 345 of file qstring.h.
References Q_ASSERT.
Referenced by QQmlJSTypeReader::operator()(), and QQmlJSFunctionInitializer::run().
|
inline |
Clears the contents of the string and makes it null.
Definition at line 1107 of file qstring.h.
References QString(), and isNull().
Referenced by GeoCodingManagerEngineEsri::GeoCodingManagerEngineEsri(), GeoRoutingManagerEngineEsri::GeoRoutingManagerEngineEsri(), GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(), KeyEvent::KeyEvent(), PlaceManagerEngineEsri::PlaceManagerEngineEsri(), QGeoCodingManagerEngineMapbox::QGeoCodingManagerEngineMapbox(), QGeoCodingManagerEngineOsm::QGeoCodingManagerEngineOsm(), QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(), QGeoRoutingManagerEngineMapbox::QGeoRoutingManagerEngineMapbox(), QGeoRoutingManagerEngineOsm::QGeoRoutingManagerEngineOsm(), QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QPlaceManagerEngineMapbox::QPlaceManagerEngineMapbox(), QPlaceManagerEngineNokiaV2::QPlaceManagerEngineNokiaV2(), QPlaceManagerEngineOsm::QPlaceManagerEngineOsm(), QLocalSocketPrivate::_q_connectToSocket(), QLocalSocketPrivate::_q_stateChanged(), CPP::WriteInitialization::acceptWidget(), QPixmapIconEngine::addPixmap(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), QAndroidCameraSession::captureToBuffer(), QTextMarkdownImporter::cbLeaveBlock(), QFileInfoPrivate::clear(), QResourcePrivate::clear(), QTranslatorPrivate::clear(), QMimeTypePrivate::clear(), QTextDocumentPrivate::clear(), QDecompressHelper::clear(), QHttpHeaderParser::clear(), QAndroidInputContext::ExtractedText::clear(), QAndroidInputContext::clear(), QSqlTableModelPrivate::clear(), QQmlDirParser::clear(), QQmlProfilerEventLocation::clear(), QPlaceContactDetail::clear(), QPlaceSearchRequestPrivate::clear(), QGeoAddress::clear(), QQuickPdfSelection::clear(), QAbstractSpinBoxPrivate::clearCache(), QLabelPrivate::clearContents(), QDtlsBasePrivate::clearDtlsError(), QV4::Compiler::Codegen::Result::clearResultName(), QQuickFontDialogImplAttached::clearSearch(), QDBusConnectionPrivate::closeConnection(), QCupsPrintEnginePrivate::closePrintDevice(), QQmlJS::Dom::LineWriter::commitLine(), contextFactory(), convertToAscii(), QDomImplementation::createDocumentType(), QDBusMetaObject::createMetaObject(), QPSQLResultPrivate::deallocatePreparedStmt(), deploy(), QIBusEngineDesc::deserializeFrom(), QDomBuilder::endEntity(), QQmlJSImportVisitor::endVisit(), QQmlJS::Dom::ModuleIndex::exportsWithNameAndMinorVersion(), QDBusConnectionPrivate::findSlot(), QUrl::fromLocalFile(), QSslCertificate::fromPath(), QFont::fromString(), getIBaseError(), QSSGShaderLibraryManager::getIncludeContents(), QDomDocumentTypePrivate::init(), QCss::Parser::init(), QApplicationPrivate::initialize(), QSettingsPrivate::iniUnescapedStringList(), QMimeXMLProvider::load(), QMimeDatabasePrivate::loadGenericIcon(), QMimeDatabasePrivate::loadIcon(), QMimeBinaryProvider::loadMimeTypePrivate(), QGeoServiceProviderPrivate::manager(), QWhatsThat::mouseReleaseEvent(), QDeclarativeGeoMapCopyrightNotice::mouseReleaseEvent(), QNativeSocketEnginePrivate::nativeReceiveDatagram(), QTextHtmlParser::newNode(), Recognizer::nextToken(), QDBusError::operator=(), operator>>(), CategoryParser::parse(), Recognizer::parse(), QUrlPrivate::parse(), QCommandLineParserPrivate::parse(), parseFontName(), SyncScanner::parseHeader(), QAuthenticatorPrivate::parseHttpResponse(), parseIp6(), parseOptions(), QtModuleInfoStore::populate(), QDBusConnectionPrivate::prepareHook(), qCompileJSFile(), qExtractFontFamiliesFromString(), qGetStringData(), qMakeFieldInfo(), qQmlJSSymbolNamespaceForPath(), Http2::qt_error(), qt_split_namespace(), readGpuFeatures(), readGpuFeatures(), readGpuFeatures(), QConfFileSettingsPrivate::readIniFile(), QMdiSubWindowPrivate::removeBaseWidget(), FileInfoThread::removePath(), QWindowsSystemProxy::reset(), QUrlPrivate::setAuthority(), QQmlJS::Lexer::setCode(), QDBusConnectionPrivate::setConnection(), QFileDevicePrivate::setError(), QWaylandTextInputV4Private::setFocus(), setFontFamilyFromValues(), QUrl::setFragment(), QUrlPrivate::setHost(), QLibrary::setLoadHints(), QUrl::setPassword(), QUrl::setPath(), QMessagePattern::setPattern(), QColorSpace::setPrimaries(), QColorSpace::setPrimaries(), QUrl::setQuery(), QDeclarativeGeocodeModel::setQuery(), setRawData(), QUrl::setScheme(), QUrlPrivate::setScheme(), QColorSpace::setTransferFunction(), QColorSpace::setTransferFunction(), QColorSpace::setTransferFunctions(), QV4::CompiledData::CompilationUnit::setUnitData(), QUrl::setUserInfo(), QUrlPrivate::setUserInfo(), QUrl::setUserName(), QQuickPlatformFileDialog::show(), QDBusTrayIcon::showMessage(), QSqlDriver::sqlStatement(), QBluetoothDeviceDiscoveryAgentPrivate::start(), QLowEnergyControllerPrivateBluezDBus::startAdvertising(), QQmlJSCodeGenerator::startInstruction(), QQmlApplicationEnginePrivate::startLoad(), QSQLiteDriver::tables(), QtQuickControls2Plugin::unregisterTypes(), QCameraPrivate::unsetError(), QImageCapturePrivate::unsetError(), QAuthenticatorPrivate::updateCredentials(), QQuickListViewPrivate::updateCurrentSection(), updateLibrary(), QLibraryPrivate::updatePluginState(), QQuickGridMesh::validateAttributes(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), Uic::write(), QTextMarkdownWriter::writeBlock(), QV4::CompiledData::SaveableUnitPointer::writeDataToFile(), QTextMarkdownWriter::writeFrame(), QtWaylandClient::QWaylandTextInputv1::zwp_text_input_v1_commit_string(), QtWaylandClient::QWaylandTextInputv4::zwp_text_input_v4_done(), and QtWaylandClient::QWaylandTextInputv4::zwp_text_input_v4_enter().
|
noexcept |
Definition at line 6498 of file qstring.cpp.
References QtPrivate::compareStrings(), and other().
Referenced by QFileSystemModelPrivate::_q_fileSystemChanged(), QUrlModel::addUrls(), QFontDatabase::bold(), QWindowsFileIconEngine::cacheKey(), QCacheItem::canCompress(), CPP::FontHandle::compare(), CPP::IconHandle::compare(), CPP::SizePolicyHandle::compare(), Widget::compareFunction(), Widget::compareSensitiveFunction(), QHttpNetworkConnectionPrivate::copyCredentials(), QCocoaIntegrationPlugin::create(), QIOSIntegrationPlugin::create(), QComposePlatformInputContextPlugin::create(), QIbusPlatformInputContextPlugin::create(), QBsdFbIntegrationPlugin::create(), QWindowsDirect2DIntegrationPlugin::create(), QDirectFbIntegrationPlugin::create(), QEglFSIntegrationPlugin::create(), QHaikuIntegrationPlugin::create(), QIntegrityFbIntegrationPlugin::create(), QLinuxFbIntegrationPlugin::create(), QMinimalIntegrationPlugin::create(), QMinimalEglIntegrationPlugin::create(), QOffscreenIntegrationPlugin::create(), QQnxIntegrationPlugin::create(), QVkKhrDisplayIntegrationPlugin::create(), QVncIntegrationPlugin::create(), QWasmIntegrationPlugin::create(), QWindowsIntegrationPlugin::create(), QXcbIntegrationPlugin::create(), QAndroidIntegrationPlugin::create(), QNetworkAccessFileBackendFactory::create(), detectMenuRole(), QSortedModelEngine::filter(), findObject(), QFontDatabase::font(), QNearFieldTargetPrivateImpl::getTagType(), QAndroidInputContext::handleLocationChanged(), QFontDatabase::hasFamily(), QCoreApplicationPrivate::initConsole(), QQuickListViewPrivate::initializeViewItem(), QFontDatabase::isBitmapScalable(), QFontDatabase::isSmoothlyScalable(), QExtendedInformation::isSymLink(), QQmlFile::isSynchronous(), QFontDatabase::italic(), QQmlJS::Dom::ModuleIndex::iterateDirectSubpaths(), QAmbientSoundPrivate::load(), GeoMapSource::mapStyle(), QV4::QQmlXMLHttpRequestCtor::method_get_response(), needsBasicRenderloopWorkaround(), QSvgStyleSelector::nodeNameEquals(), operator<(), QFileSystemModelPrivate::QFileSystemNode::operator<(), QFileSystemModelPrivate::QFileSystemNode::operator<(), operator<(), QUrl::operator<(), QDir::operator==(), QFileInfo::operator==(), QFileSystemWatcherPathKey::operator==(), QFileSystemModelPrivate::QFileSystemNode::operator==(), QFileSystemModelPrivate::QFileSystemNode::operator>(), parseBrushValue(), parseCmakeBoolean(), parseColorValue(), parseOptions(), QHttpNetworkConnectionPrivate::parseRedirectResponse(), QFontDatabase::pointSizes(), QNetworkDiskCache::prepare(), qt_gl_resolve_extensions(), quick_test_main_with_setup(), runUic(), QDomElementPrivate::save(), QQuickCanvasItem::setContextType(), QPrinter::setOutputFileName(), QFontDatabase::smoothSizes(), QSortedModelEngine::sortOrder(), QFontDatabase::styles(), toBool(), QQuickListViewPrivate::updateInlineSection(), QQuickListViewPrivate::updateStickySections(), QQmlFile::urlToLocalFileOrQrc(), QFontDatabase::weight(), and QDockWidgetLayout::wmSupportsNativeWindowDeco().
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
noexcept |
Definition at line 6523 of file qstring.cpp.
References QtPrivate::compareStrings(), and other().
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inline |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
iterator-invalidation-func-desc
Definition at line 1203 of file qstring.h.
References d.
Referenced by QUnicodeTables::convertCase(), QSvgFont::draw(), is_valid_domain_name(), QFileSystemEntry::isClean(), Recognizer::parse(), parseAnimateColorNode(), parseIpFuture(), and set_text().
|
inline |
Returns a pointer to the data stored in the QString.
The pointer can be used to access the characters that compose the string.
Note that the pointer remains valid only as long as the string is not modified.
Definition at line 1101 of file qstring.h.
References data().
Referenced by QDirIterator::QDirIterator(), QOffscreenX11Connection::QOffscreenX11Connection(), append(), append_utf8(), QmlIR::Object::appendAlias(), QmlIR::Object::appendProperty(), AndroidCameraPrivate::callParametersStringListMethod(), QRhiVulkan::create(), createPolygonNode(), createPolylineNode(), QFileSystemEngine::currentPath(), QODBCResult::exec(), getExtractedText(), getSelectedText(), getText(), getTextAfterCursor(), getTextBeforeCursor(), QQmlJS::Dom::inQString(), QQmlJS::Dom::inQString(), QMetaMethodInvoker::invokeImpl(), QTextEngine::itemize(), QQmlXMLHttpRequest::jsonResponseBody(), QGeoFileTileCache::loadTiles(), localeAwareCompare(), localeAwareCompare(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), QV4::JsonObject::method_parse(), mid(), normalizationQuickCheckHelper(), operator!=(), operator!=(), operator<(), operator<(), operator<<(), operator<=(), operator<=(), operator==(), operator==(), QDir::operator==(), operator>(), operator>(), operator>=(), operator>=(), QQuickStyledTextPrivate::parse(), parseAnimateTransformNode(), QQuickStyledTextPrivate::parseAttribute(), QQuickStyledTextPrivate::parseCloseTag(), QQuickStyledTextPrivate::parseEntity(), parseHttpOptionHeader(), parseModeline(), QQuickSvgParser::parsePathDataFast(), QQuickStyledTextPrivate::parseTag(), parseTransformationMatrix(), QQuickStyledTextPrivate::parseValue(), QQmlMetaType::qmlType(), qt_cbor_decoder_read(), qt_u_strToCase(), QLockFilePrivate::removeStaleLock(), replace(), replace(), replace(), replace(), right(), runMoc(), QV4::Compiler::StringTableGenerator::serialize(), serializeString(), QQuickTextInput::setPasswordCharacter(), QRhiD3D11::setPipelineCacheData(), QRhiGles2::setPipelineCacheData(), QRhiMetal::setPipelineCacheData(), QRhiVulkan::setPipelineCacheData(), QTimer::singleShot(), QV4::stringToArrayIndex(), QQuickTextInputPrivate::textDirection(), QQuickTextEditPrivate::textDirection(), toDouble(), tokenizeLine(), QLockFilePrivate::tryLock_sys(), QSystemLocalePrivate::uiLanguages(), writeStr(), and writeString().
|
inline |
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the string.
iterator-invalidation-func-desc
Definition at line 1211 of file qstring.h.
References d.
Referenced by QSvgFont::draw(), is_valid_domain_name(), QFileSystemEntry::isClean(), Recognizer::parse(), parseAnimateColorNode(), parseIpFuture(), QQmlJSScope::resolveEnums(), and set_text().
|
inline |
Returns true
if this string contains an occurrence of the string str; otherwise returns false
.
{search-comparison-case-sensitivity} {search}
Example:
Definition at line 1213 of file qstring.h.
References indexOf().
|
inline |
Definition at line 1217 of file qstring.h.
References indexOf().
Referenced by QtFontStyle::Key::Key(), QIOSScreen::QIOSScreen(), QTextHtmlImporter::QTextHtmlImporter(), CPP::WriteIncludes::WriteIncludes(), _q_escapeIdentifier(), QFileDialogPrivate::_q_updateOkButton(), QFileDialogPrivate::addDefaultSuffixToFiles(), QFileDialogPrivate::addDefaultSuffixToUrls(), QQuickTextNodeEngine::addTextBlock(), QQuickTextPrivate::anchorAt(), QCoreApplication::applicationFilePath(), QODBCDriverPrivate::checkDBMS(), Widget::containsFunction(), QNetworkCookieJar::cookiesForUrl(), QKeySequencePrivate::decodeString(), deployPlugins(), deployQtFrameworks(), detectMenuRole(), doFilter(), QZipReader::extractAll(), findDependencyInfo(), QStandardPaths::findExecutable(), Widget::fromRawDataFunction(), QToolBarAreaLayoutInfo::gapIndex(), gradleBuildFlags(), isBypassed(), FrameworkInfo::isDebugLibrary(), isHostExcluded(), loadCubeMap(), QQmlJS::Dom::DomEnvironment::loadModuleDependency(), macDateToString(), mailCommand(), QV4::RegExpPrototype::method_split(), noBlockInString(), openWebBrowser(), parseOtoolLibraryLine(), parseUri(), QFileSystemModelPrivate::passNameFilters(), platformFromMkSpec(), QGtk3Storage::populateMap(), qGetODBCVersion(), qt_aqua_get_known_size(), QQC2_NAMESPACE::qt_aqua_get_known_size(), qt_getImageText(), qt_mac_applicationName(), DocumentFile::rename(), QAndroidInputContext::setComposingText(), QFileSystemModel::setData(), QV4::UrlObject::setHost(), QMdiSubWindowPrivate::setNewWindowTitle(), QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QFileDialogPrivate::typedFiles(), updateFile(), QLabelPrivate::updateShortcut(), QFontDialogPrivate::updateStyles(), usePlatformSizeGrip(), GLSL::Semantic::visit(), QQmlJS::Dom::Rewriter::visit(), and QQmlJS::Dom::Rewriter::visit().
|
inline |
|
inlinenoexcept |
qsizetype 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.
{search-comparison-case-sensitivity} {search}
Definition at line 4717 of file qstring.cpp.
References QtPrivate::count(), QStringView, size(), str, and unicode().
qsizetype QString::count | ( | QChar | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 4732 of file qstring.cpp.
References ch, QtPrivate::count(), QStringView, and unicode().
Referenced by Widget::countFunction(), createDirectoryWithParents(), QQuick3DFileInstancing::loadFromBinaryFile(), QRhiD3D11::pipelineCacheData(), qt_alphamapblit_argb32(), qt_alphamapblit_generic(), qt_alphamapblit_quint16(), qt_alphargbblit_argb32(), qt_alphargbblit_generic(), recursiveCopyAndDeploy(), QTableViewPrivate::sectionSpanEndLogical(), QRhiD3D11::setPipelineCacheData(), QTableViewPrivate::spanContainsSection(), and writeInstanceTable().
qsizetype QString::count | ( | QStringView | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 4747 of file qstring.cpp.
References QtPrivate::count(), and str.
|
inline |
|
inline |
|
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.
Unlike constData() and unicode(), the returned data is always '\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 \l{deep copy} to occur.
Definition at line 1095 of file qstring.h.
References d, detach(), and Q_ASSERT.
Referenced by QAnyStringView::QAnyStringView(), QAnyStringView::QAnyStringView(), QAnyStringView::QAnyStringView(), QFileDialogPrivate::_q_deleteCurrent(), QFileDialogPrivate::_q_goToDirectory(), QtAndroidMenu::addAllMenuItemsToMenu(), QWindowsFontDatabase::addApplicationFont(), addZeroPrefixedInt(), allocateStringFn(), append_utf8(), arg(), constData(), QWindowsFontDatabase::createEngine(), createFontFile(), QV4::Heap::StringOrSymbol::createHashValue(), createLinkTitle(), Widget::dataFunction(), dataToUrls(), decode(), DomText(), doParseMountInfo(), QRegularExpression::errorString(), escapedKey(), QDB2Result::exec(), QSQLiteResult::exec(), QDrag::exec(), QQmlJS::Dom::DomUniverse::execQueue(), QBenchmarkValgrindUtils::extractResult(), QCompletionEngine::filterHistory(), QWindowsDirect2DPaintEnginePrivate::fontFaceFromFontEngine(), getMessage(), QRawFont::glyphIndexesForString(), QByteArray::insert(), QLocale::languageToCode(), main(), QV4::StringCtor::method_fromCharCode(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), QXcbMime::mimeDataForAtom(), QLocale::name(), QtAndroidMenu::onCreateContextMenu(), QtAndroidMenu::onPrepareOptionsMenu(), operator>>(), operator[](), QFontFamilyDelegate::paint(), parseFontName(), qFillBufferWithString(), DarwinBluetooth::qt_address(), QTest::qt_asprintf(), qt_color_from_string(), qt_from_latin1_to_qvla(), QZipReaderPrivate::scanFiles(), screenForDeviceName(), QtWaylandClient::QWaylandClipboard::setMimeData(), QUrlPrivate::setScheme(), Widget::sizeFunction(), QFontFamilyDelegate::sizeHint(), QV4::Heap::String::startsWithUpper(), QNetworkReplyWasmImplPrivate::stateChange(), QV4::CompiledData::Unit::stringAtInternal(), QXmlStreamReaderPrivate::symView(), tokenizeLine(), toStdU16String(), toStdU32String(), toStdWString(), QHashedCStringRef::toUtf16(), ucalDaylightOffset(), unicode(), uuidFromString(), uuidFromString(), QtPrivate::XmlStringRef::view(), and wrapInFunction().
|
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 1087 of file qstring.h.
References d.
|
inline |
Definition at line 986 of file qstring.h.
References d.
Referenced by QV4::Heap::String::init(), insert_helper(), needsReallocate(), QtPrivate::XmlStringRef::operator QXmlString(), replace_helper(), replace_in_place(), replace_with_copy(), StringOrTranslation::setString(), and QV4::Heap::String::simplifyString().
|
inline |
|
inline |
Definition at line 1103 of file qstring.h.
References d, and QArrayData::KeepSize.
Referenced by appendToUser(), begin(), data(), end(), and QTextEngine::itemize().
|
inline |
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the string.
iterator-invalidation-func-desc
Definition at line 1205 of file qstring.h.
Referenced by QQmlDelayedCallQueue::addUniquelyAndExecuteLater(), isIp6(), Parser::lineNumber(), QQmlJSScope::resolveEnums(), section(), and set_text().
|
inline |
bool QString::endsWith | ( | const QString & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true
if the string ends with s; otherwise returns false
.
{search-comparison-case-sensitivity} {search}
Definition at line 5350 of file qstring.cpp.
References QStringView.
Referenced by QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), _q_escapeIdentifier(), absoluteFilePath(), QDir::absoluteFilePath(), QQmlImports::addFileImport(), addLexToken(), QFseventsFileSystemWatcherEngine::addPaths(), backendType(), QAbstractGeoTileCache::baseCacheDirectory(), QCommonStylePrivate::calculateElidedText(), QQC2::QCommonStylePrivate::calculateElidedText(), QWebpHandler::canRead(), QDir::cd(), copyQtFiles(), QQmlPreviewFileEngineHandler::create(), createChangeNotification(), QtObject::createComponent(), QFileSystemEngine::createDirectory(), QAbstractFileEngineIterator::currentFilePath(), detectMenuRole(), doFilter(), Widget::endsWithFunction(), QUrl::errorString(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QMimerSQLDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QNetworkDiskCache::expire(), SharedTextureImageResponse::fallbackPath(), QIOSFileEngineAssetsLibrary::fileFlags(), QFileSystemModelPrivate::filePath(), fileType(), QQmlJS::Dom::fileTypeForPath(), filterSpecs(), findDependencyInfo(), QStandardPaths::findExecutable(), QResourceRoot::findNode(), QQuickFolderBreadcrumbBarPrivate::folderBaseName(), QPlatformWindow::formatWindowTitle(), fromWinApiAddress(), ignoreProxyFor(), QQmlPluginImporter::importPlugins(), FrameworkInfo::isDebugLibrary(), QSqlDriver::isIdentifierEscaped(), QMYSQLDriver::isIdentifierEscaped(), QODBCDriver::isIdentifierEscaped(), QLibrary::isLibrary(), isParentDomain(), QUrl::isParentOf(), isScalableImageFormat(), jump(), QTranslator::load(), AndroidStyle::loadStyleData(), QQmlSA::lookupName(), QPdfDocument::metaData(), QQuickJSContext2D::method_get_fillStyle(), QQuickJSContext2D::method_get_strokeStyle(), QFileSystemModelPrivate::node(), QQmlJSTypeReader::operator()(), QQmlJS::Dom::Scanner::operator()(), parseClockValue(), QTextHtmlParser::parseCloseTag(), QHttpHeaderParser::parseHeaders(), QQuickStyledTextPrivate::parseImageAttributes(), parseOptions(), Parser::parseParamReplace(), prefixedName(), preprocessMetadata(), Q_TRACE_INSTRUMENT(), qCompileJSFile(), qQmlResolveImportPaths(), qRelocateResourceFile(), QTest::qSignalDumperCallback(), QAndroidSystemLocale::query(), quick_test_main_with_setup(), recursiveCopyAndDeploy(), QPlatformTheme::removeMnemonics(), QQmlJSFunctionInitializer::run(), runningUnderDebugger(), QQmlJS::Lexer::scanDirectives(), scanImports(), QMessagePattern::setPattern(), Utils::TextDocument::setPlainText(), QQmlImportInstance::setQmldirContent(), QCss::Declaration::sizeValue(), splitIntoFamilies(), QAbstractSpinBoxPrivate::stripped(), QSqlError::text(), translateDriveName(), updateLibsXml(), QLibraryPrivate::updatePluginState(), vcRedistDir(), GLSL::Semantic::visit(), QmlIR::IRBuilder::visit(), TestHTTPServer::wait(), and QTextMarkdownWriter::writeBlock().
bool QString::endsWith | ( | QChar | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 5381 of file qstring.cpp.
References at, Qt::CaseSensitive, and foldCase().
bool QString::endsWith | ( | QLatin1StringView | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 5370 of file qstring.cpp.
References QStringView.
|
inlinenoexcept |
Definition at line 356 of file qstring.h.
References QtPrivate::endsWith().
QString::iterator QString::erase | ( | QString::const_iterator | first, |
QString::const_iterator | last | ||
) |
Removes from the string the characters in the half-open range [ first , last ). Returns an iterator to the character immediately after the last erased character (i.e. the character referred to by last before the erase).
Definition at line 9172 of file qstring.cpp.
References begin(), cbegin(), last(), and remove().
Referenced by QQmlDelayedCallQueue::addUniquelyAndExecuteLater().
|
inline |
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 6198 of file qstring.cpp.
References ch, QArrayDataPointer< T >::data(), i, resize(), and QArrayDataPointer< T >::size.
Referenced by Option::Option(), QQuickTextInputPrivate::~QQuickTextInputPrivate(), QWidgetLineControl::~QWidgetLineControl(), Widget::fillFunction(), leftJustified(), QWidgetLineControl::processInputMethodEvent(), QSvgPaintEngine::qbrushToSvg(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), and rightJustified().
Returns a string that contains the first n characters of this string.
Definition at line 337 of file qstring.h.
References Q_ASSERT.
Referenced by QWaylandInputMethodEventBuilder::buildCommit(), QWaylandInputMethodEventBuilder::buildPreedit(), QCacheItem::canCompress(), countRepeat(), Widget::firstFunction(), QQmlXMLHttpRequest::header(), QQmlXMLHttpRequest::headers(), QSettingsPrivate::iniUnescapedStringList(), QFontDatabasePrivate::load(), loadTzTimeZones(), lookupVendorIdInSystemDatabase(), QHttpHeaderParser::parseHeaders(), parseHtmlMetaForEncoding(), QHttpNetworkConnectionPrivate::parseRedirectResponse(), QNetworkDiskCache::prepare(), QmlGoToTypeDefinitionSupport::process(), QConfFileSettingsPrivate::readIniFile(), QConfFileSettingsPrivate::readIniSection(), QHttpHeaderParser::removeHeaderField(), QPlatformTheme::removeMnemonics(), setModelProperties(), and QFontDialogPrivate::updateFamilies().
Returns a QString initialized with the first size characters of the Latin-1 string str.
If size is {-1},
{strlen(str)} is used instead.
Definition at line 582 of file qstring.h.
References qstrlen(), and str.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the Latin-1 string str.
Definition at line 581 of file qstring.h.
References ba, and fromLatin1().
Referenced by fromLatin1().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the Latin-1 string str.
Definition at line 5710 of file qstring.cpp.
References QString(), QTypedArrayData< char16_t >::allocate(), ba, d, QByteArray::data(), QArrayDataPointer< char16_t >::fromRawData(), Q_CHECK_PTR(), qt_from_latin1(), and QByteArray::size().
Referenced by QtGraphicsAnchorLayout::ParallelAnchorData::ParallelAnchorData(), QDirPrivate::QDirPrivate(), QProgressDialog::QProgressDialog(), QQuickWidgetOffscreenWindow::QQuickWidgetOffscreenWindow(), QSGDefaultPainterNode::QSGDefaultPainterNode(), QString(), QTextLayout::QTextLayout(), QXcbSessionManager::QXcbSessionManager(), QZipStreamStrategy::QZipStreamStrategy(), QtGraphicsAnchorLayout::SequentialAnchorData::SequentialAnchorData(), QGeoFileTileCache::~QGeoFileTileCache(), QZipStreamStrategy::~QZipStreamStrategy(), QDateTimeEditPrivate::_q_editorCursorPositionChanged(), QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), QMimeBinaryProvider::addAliases(), QGraphicsAnchorLayoutPrivate::addAnchor_helper(), addFunction(), QMimeBinaryProvider::addParents(), QFreeTypeFontDatabase::addTTFile(), QQmlJSLinter::applyFixes(), QV4::IdentifierTable::asPropertyKey(), automaticPipelineCacheFileName(), QLocale::bcp47Name(), borderStyleName(), bufferFromAttribute(), QNetworkAccessAuthenticationManager::cacheCredentials(), QV4::CallMethod(), QDir::cdUp(), QWindowsFontDatabaseBase::EmbeddedFont::changeFamilyName(), QV4::Managed::className(), QPlatformFileDialogHelper::cleanFilterList(), QBenchmarkValgrindUtils::cleanup(), codesignBundle(), Collector::collect(), QColorOutput::colorify(), colorValue(), QOpenGLShaderPrivate::compile(), computeFaceIndex(), QV4::WeakMapCtor::construct(), QV4::WeakSetCtor::construct(), QPlaceManagerEngineNokiaV2::constructIconUrl(), QTlsPrivate::TlsCryptographSecureTransport::continueHandshake(), QQmlJS::AST::PatternElement::convertLiteralToAssignmentPattern(), QQmlJS::AST::ArrayPattern::convertLiteralToAssignmentPattern(), QQmlJS::AST::PatternProperty::convertLiteralToAssignmentPattern(), QXcbWindow::create(), QIBusPlatformInputContextPrivate::createConnection(), createDirectory(), Graph< Vertex, EdgeData >::createEdge(), createInterfaces(), createPixmapDataSync(), QQuickDesignerSupportItems::createPrimitive(), createReadHandlerHelper(), createSequence(), QDBusArgumentPrivate::createSignature(), createSymbolicLink(), QOutputStrategy::createUniqueImageName(), createWriteHandlerHelper(), QLocale::currencySymbol(), QSysInfo::currentCpuArchitecture(), QPSQLResult::data(), QGraphicsSceneBspTree::debug(), QKeySequencePrivate::decodeString(), QV4::Object::defineAccessorProperty(), descriptorForFamily(), QPSQLDriverPrivate::detectBackslashEscape(), deviceModelIdentifier(), QNetworkReplyWasmImplPrivate::doSendRequest(), QLocaleData::doubleToString(), QWindowsVistaStyle::drawControl(), QQC2::QStyleHelper::drawDial(), QWindowsVistaStyle::drawPrimitive(), QSimplex::dumpMatrix(), encodeByteArray(), encodeFrame(), QKeySequencePrivate::encodeString(), QQmlJSImportVisitor::endVisit(), DebugViewHelpers::ensureDebugObjectName(), QJSEngine::evaluate(), QDB2Result::exec(), QRhiD3D11::executeCommandBuffer(), QQmlPropertyBindingJS::expressionChanged(), QWindowsFontDatabaseBase::extraTryFontsForFamily(), fallbackStyleUri(), fbname(), fileArchitecture(), fileInfoListToString(), QImageTextureGlyphCache::fillTexture(), findAppBundleFiles(), findAppFrameworkNames(), findAppFrameworkPaths(), findAppLibraries(), findEntitlementsFile(), QWindowsBackingStore::flush(), QGtk3Interface::font(), QSGDefaultRenderContext::fontKey(), QQuickTextEditMimeData::formats(), QVideoTextureHelper::fragmentShaderFileName(), QUrl::fromAce(), QNetworkHeadersPrivate::fromHttpDate(), fromLatin1List(), GLSL::Semantic::functionIdentifier(), generateFileName(), QV4::Compiler::Codegen::generateFromProgram(), QSvgPaintEnginePrivate::generateGradientName(), generateInterfaceXml(), generateInterfaceXml(), getCachedClass(), getExtractedText(), QSSGQmlUtilities::getIdForNode(), getIllegalNames(), QXcbScreen::getName(), QBenchmarkValgrindUtils::getNewestFileName(), QLocationUtils::getNmeaTime(), QPlaceManagerEngineNokiaV2::getPlaceContent(), QPlaceManagerEngineNokiaV2::getPlaceDetails(), QPSQLDriverPrivate::getPSQLVersion(), getQtLibsFromElf(), QTextStreamPrivate::getReal(), QQuickSplitViewPrivate::handlePress(), helpText(), host_name_to_settings_key(), QPlaceManagerEngineNokiaV2::icon(), GLSL::Engine::identifier(), QSSGQmlUtilities::indentString(), QWindowsOpengl32DLL::init(), QV4::ErrorPrototype::init(), QWaylandTextureSharingExtension::initialize(), QPlaceManagerEngineNokiaV2::initializeCategories(), QLoggingRegistry::initializeRules(), inputStreamStateCallback(), QQuickGridLayout::insertLayoutItems(), QNetworkInterfaceManager::interfaceNameFromIndex(), QSslSocketPrivate::isMatchingHostname(), isScript(), QQuickItemPrivate::itemNode(), QTextList::itemText(), QSysInfo::kernelType(), QSysInfo::kernelVersion(), QStringHashNode::key(), QKeySequencePrivate::keyName(), QQuickSplitViewPrivate::layout(), QOpenGLShaderProgram::link(), QQmlJSLinter::lintFile(), QWaylandCompositorPrivate::loadClientBufferIntegration(), QQmlTypeLoader::Blob::loadDependentImports(), QSSGShaderLibraryManager::loadPregeneratedShaderInfo(), QGeoFileTileCache::loadTiles(), QQmlPreviewHandler::loadUrl(), QTlsBackendOpenSSL::longNameForId(), main(), makeFpString(), matchArgsForService(), QQmlPreviewServiceImpl::messageReceived(), QQmlPreviewClient::messageReceived(), QDBusInterfacePrivate::metacall(), QV4::ArrayPrototype::method_fill(), QV4::ArrayPrototype::method_from(), QV4::IntrinsicTypedArrayCtor::method_from(), QQuickJSContext2D::method_get_fillStyle(), QV4::QQmlLocaleData::method_get_formattedDataSize(), QV4::PropertyListPrototype::method_get_length(), QQuickJSContext2D::method_get_strokeStyle(), QV4::IntrinsicTypedArrayPrototype::method_get_toStringTag(), QV4::PropertyListPrototype::method_indexOf(), QV4::PropertyListPrototype::method_lastIndexOf(), QV4::ArrayPrototype::method_map(), QV4::ArrayPrototype::method_of(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), QV4::PropertyListPrototype::method_push(), QV4::PropertyListPrototype::method_set_length(), QV4::ArrayPrototype::method_splice(), QV4::PropertyListPrototype::method_splice(), QV4::NumberPrototype::method_toFixed(), QV4::QQmlLocaleData::method_toString(), QV4::PropertyListPrototype::method_unshift(), QXcbMime::mimeAtomToString(), QXcbMime::mimeConvertToFormat(), QMediaFormat::mimeType(), mmErrorMessage(), msgOpenReadFailed(), QSSGShaderCache::newPipelineFromPregenerated(), GLSL::Engine::number(), QDB2Driver::open(), QOCIDriver::open(), QQmlJSTypeDescriptionReader::operator()(), operator<<(), operator=(), QUrl::operator>>(), operator>>(), QQmlJS::Dom::Rewriter::out(), QBenchmarkValgrindUtils::outFileBase(), outputStreamStateCallback(), QStaticTextPrivate::paintText(), CategoryParser::parse(), GLSL::Parser::parse(), QMimeTypeParserBase::parse(), parseBoolean(), RCCResourceLibrary::parseCompressionAlgorithm(), RCCResourceLibrary::parseCompressionLevel(), parseDateString(), QIcc::parseDesc(), parseETag(), QTlsPrivate::X509CertificateGeneric::parseExtension(), parseHeaderValue(), QAuthenticatorPrivate::parseHttpResponse(), parseIconEntryInfo(), parseIfMatch(), parseIfNoneMatch(), QHttpHeaderParser::parseStatus(), parseStopNode(), QQuickStyledTextPrivate::parseTag(), patchQtCore(), QFontconfigDatabase::populateFontDatabase(), QHttpNetworkConnectionPrivate::prepareRequest(), QSysInfo::prettyProductName(), QSSGBufferManager::primitivePath(), QSysInfo::productVersion(), propertyWriteReply(), DynamicRoleModelNodeMetaObject::propertyWritten(), Q_TRACE_INSTRUMENT(), QSvgPaintEngine::qbrushToSvg(), qDBusGenerateClassDefXml(), qDBusIntrospectObject(), qDecodeDataUrl(), qFormatTimeStamps(), qlocationutils_readRmc(), qMakeError(), qMakeFieldInfo(), qMakeStatement(), qMakeStmtError(), qQmlResolveImportPaths(), qRegisterNotificationCallbacks(), QDB2DriverPrivate::qSplitTableQualifier(), DarwinBluetooth::qt_error_string(), qt_keyForPageSizeId(), qt_localeFromLCID(), qt_mac_applicationmenu_string(), QTlsBackendOpenSSL::qt_OpenSSL_cipher_to_QSslCipher(), qt_qmlDebugDisableService(), qt_qmlDebugEnableService(), qt_strip_filters(), QTest::qtest_qParseArgs(), QGLXContext::queryDummyContext(), QDeclarativeSearchResultModel::queryFinished(), QAlsaAudioSource::read(), QPulseAudioSource::read(), readAllProperties(), QSystemLocaleData::readEnvironment(), RCCResourceLibrary::readFiles(), QPngHandlerPrivate::readPngHeader(), QPngHandlerPrivate::readPngTexts(), QQuickTextInputPrivate::realText(), QIBaseResult::record(), Graph< Vertex, EdgeData >::removeEdge(), QGraphicsAnchorLayoutPrivate::replaceVertex(), QHostInfoAgent::reverseLookup(), QQuickWindowPrivate::rhiCreationFailureMessage(), ValueLookupJob::run(), QmlTypeRegistrar::runExtract(), QV4::MemoryManager::runGC(), runMoc(), runRcc(), runUic(), QDomDocumentPrivate::saveDocument(), QDeviceDiscoveryStatic::scanConnectedDevices(), QPlaceManagerEngineNokiaV2::search(), QPlaceManagerEngineNokiaV2::searchSuggestions(), QSqlRelationalTableModel::selectStatement(), sequenceInterface(), serverInfoCallback(), ListModel::set(), QODBCDriverPrivate::setConnectionOptions(), QDBusPendingCallPrivate::setMetaTypes(), QComboBoxDelegate::setSeparator(), QTlsBackendOpenSSL::shortNameForId(), simpleTypeString(), QGraphicsAnchorLayoutPrivate::simplifyGraph(), sinkInfoCallback(), sm_performSaveYourself(), QODBCDriverPrivate::splitTableQualifier(), standardLibraryErrorString(), QuickTestResult::stringify(), styleUri(), QTlsPrivate::X509CertificateOpenSSL::subjectAlternativeNames(), QIBaseDriver::subscribeToNotification(), QWidgetLineControl::surroundingText(), QTextOdfWriter::tableCellStyleElement(), Graph< Vertex, EdgeData >::takeEdge(), QWidgetLineControl::text(), QQuickTextInput::text(), QGenericUnixTheme::themeNames(), QTlsBackendOpenSSL::tlsLibraryVersionString(), QAsn1Element::toDateTime(), QTextHtmlExporter::toHtml(), QQuickStyledTextPrivate::toRoman(), QCborError::toString(), QAsn1Element::toString(), QBenchmarkContext::toString(), GLSL::VectorType::toString(), GLSL::MatrixType::toString(), QTest::toString(), QGeoCoordinate::toString(), QUuid::toString(), translate_color(), translate_dashPattern(), types(), ucalDaylightOffset(), QLocale::uiLanguages(), QIBaseDriver::unsubscribeFromNotification(), QPdfLinkModelPrivate::update(), QQnxMediaMetaData::update(), updateFile(), updateFile(), QPrintPreviewDialogPrivate::updatePageNumLabel(), QQuickNinePatchImage::updatePaintNode(), QFileSelectorPrivate::updateSelectors(), QSSGQmlUtilities::valueToQml(), QAbstractSpinBoxPrivate::variantCompare(), vasprintf(), QV4::ExecutableCompilationUnit::verifyHeader(), QV4::WeakMapCtor::virtualCall(), QV4::WeakSetCtor::virtualCall(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), GLSL::Semantic::visit(), warnIfHorizontallyAnchored(), QXcbWindow::windowTitle(), wrapInFunction(), QTextOdfWriter::writeAll(), writeAttribute(), QTextOdfWriter::writeBlock(), QTextOdfWriter::writeBlockFormat(), QTextOdfWriter::writeCharacterFormat(), RCCFileInfo::writeDataBlob(), QTextOdfWriter::writeFormats(), QTextOdfWriter::writeFrame(), QTextOdfWriter::writeFrameFormat(), QTextOdfWriter::writeInlineCharacter(), QTextOdfWriter::writeListFormat(), QSSGQmlUtilities::writeQml(), and QTextOdfWriter::writeTableFormat().
Returns a QString initialized with the first size characters of the 8-bit string str.
If size is {-1},
{strlen(str)} is used instead.
{qstring-local-8-bit-equivalent} {fromUtf8}
Definition at line 604 of file qstring.h.
References fromLocal8Bit(), qstrlen(), and str.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the 8-bit string str.
{qstring-local-8-bit-equivalent} {fromUtf8}
Definition at line 603 of file qstring.h.
References ba, and fromLocal8Bit().
Referenced by fromLocal8Bit().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the 8-bit string str.
{qstring-local-8-bit-equivalent} {fromUtf8}
Definition at line 5788 of file qstring.cpp.
References QString(), ba, QArrayDataPointer< char16_t >::fromRawData(), QByteArray::isEmpty(), QByteArray::isNull(), QStringConverterBase::Stateless, QStringConverter::System, and toUtf16.
Referenced by DBusConnection::DBusConnection(), QT_BEGIN_NAMESPACE::DeviceIntegration::DeviceIntegration(), QEvdevKeyboardManager::QEvdevKeyboardManager(), QEvdevMouseManager::QEvdevMouseManager(), QEvdevTabletManager::QEvdevTabletManager(), QEvdevTouchManager::QEvdevTouchManager(), QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate(), QMessagePattern::QMessagePattern(), QWindowsContext::QWindowsContext(), QXcbSessionManager::QXcbSessionManager(), QCoreApplicationPrivate::appName(), QCoreApplication::arguments(), argumentsFromCommandLineAndFile(), QmlTypeRegistrar::argumentsFromCommandLineAndFile(), QCupsPrinterSupport::availablePrintDeviceIds(), bluetoothdVersion(), QWindowsMimeText::convertToMime(), QWindowsMimeURI::convertToMime(), QtWaylandClient::QWaylandWindow::createDecoration(), QGuiApplicationPrivate::createPlatformIntegration(), QFile::decodeName(), QFile::decodeName(), QXcbScreen::defaultName(), QApplicationPrivate::desktopStyleKey(), deviceModelIdentifier(), QFFmpeg::err2str(), SharedTextureImageResponse::fallbackPath(), QZipReader::fileData(), QZipPrivate::fillFileInfo(), QStandardPaths::findExecutable(), findInPath(), QPlatformFontDatabase::fontDir(), QEglFSDeviceIntegration::framebufferIndex(), QPlatformPrinterSupportPlugin::get(), QFileDialogPrivate::getEnvironmentVariable(), QSSGShaderLibraryManager::getIncludeContents(), getLibraryProjectsInOutputFolder(), QXcbScreen::getName(), getPrefix(), QIBusPlatformInputContextPrivate::getSocketPath(), getWinLocaleName(), QXcbConnection::glIntegration(), importImp(), interfaceListing(), QWaylandQuickHardwareLayerPrivate::layerIntegration(), QWaylandCompositorPrivate::loadClientBufferIntegration(), QWaylandCompositorPrivate::loadServerBufferIntegration(), QV4::ExecutableCompilationUnit::localCacheFilePath(), QHostInfoAgent::lookup(), QSysInfo::machineHostName(), main(), QHaikuClipboard::mimeData(), QProcessEnvironmentPrivate::nameToString(), QCupsPrintEnginePrivate::openPrintDevice(), Moc::parsePluginData(), QLibraryInfoPrivate::path(), populateFromPattern(), QApplicationPrivate::process_cmdline(), QCoreApplicationPrivate::processCommandLineArguments(), Q_TRACE_INSTRUMENT(), qdlerror(), qEnvironmentVariable(), qTzName(), queryQtPaths(), quick_test_main_with_setup(), readElfExecutable(), QLibInputTouch::registerDevice(), QPlatformInputContextFactory::requested(), QQuickStyleSpec::resolve(), Preprocessor::resolveInclude(), retrieveLabel(), runProcess(), runQmlImportScanner(), searchIncludePaths(), signAAB(), sm_performSaveYourself(), standardLibraryErrorString(), QStandardPaths::standardLocations(), QCupsPrinterSupport::staticDefaultPrintDeviceId(), QProcEnvValue::string(), systemThemeName(), QXcbIntegration::wmClass(), and QSSGQmlUtilities::writeNodeProperties().
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 is an example of how we can use a QRegularExpression on raw data in memory without requiring to copy the data into a QString:
Definition at line 9242 of file qstring.cpp.
References QString(), QArrayDataPointer< char16_t >::fromRawData(), and unicode().
Referenced by QtCbor::ByteData::asQStringRaw(), QSvgPaintEngine::drawTextItem(), Widget::fromRawDataFunction(), QLocaleData::DataRange::getData(), QQmlMetaType::qmlType(), setRawData(), and QV4::CompiledData::Unit::stringAtInternal().
|
inlinestatic |
{from-std-string} {UTF-8} {fromUtf8()}
Definition at line 1322 of file qstring.h.
References fromUtf8().
Referenced by QWasmVideoOutput::addCameraSourceElement(), QWasmLocalStorageSettingsPrivate::children(), QWasmLocalStorageSettingsPrivate::clear(), QWasmVideoOutput::doElementCallbacks(), QWindowsMultimediaUtils::errorString(), QWasmLocalStorageSettingsPrivate::get(), QT_BEGIN_NAMESPACE::getKeyFromCode(), QFileDialog::getOpenFileContent(), inputCallback(), AdapterManager::removeClient(), QWasmVideoOutput::setSource(), QSystemLocalePrivate::uiLanguages(), and QWasmVideoOutput::videoFrameCallback().
|
inlinestatic |
{from-std-string} {UTF-16} {fromUtf16()}
Definition at line 1336 of file qstring.h.
References fromUtf16.
|
inlinestatic |
{from-std-string} {UCS-4} {fromUcs4()}
Definition at line 1342 of file qstring.h.
References fromUcs4().
Referenced by qt_punycodeDecoder().
|
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).
Definition at line 1333 of file qstring.h.
References fromWCharArray().
Referenced by windowTitle().
char32_t
overload instead. 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 \0'-terminated.
Definition at line 5915 of file qstring.cpp.
References QString(), QStringConverterBase::Stateless, toUtf16, unicode(), and QStringConverter::Utf32.
Referenced by fromSQLTCHAR(), fromStdU32String(), and fromWCharArray().
If size is -1 (default), unicode must be \0'-terminated.
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 *, qsizetype) or QString(const QChar *) if possible.
QString makes a deep copy of the Unicode data.
char16_t
overload instead. Definition at line 5883 of file qstring.cpp.
References QString(), QtPrivate::qustrlen(), QStringConverterBase::Stateless, toUtf16, unicode(), and QStringConverter::Utf16.
Referenced by QPdfBookmarkModelPrivate::appendChildNode(), backendName(), backendName(), backendName(), backendName(), byteArrayFromBuffer(), convertValue(), QRhiD3D11::create(), QPdfSearchModelPrivate::doSearch(), fromSQLTCHAR(), QPdfDocumentPrivate::getText(), QPdfDocument::metaData(), QXcbMime::mimeConvertToFormat(), QRegularExpression::namedCaptureGroups(), QPdfDocument::pageLabel(), QIcc::parseDesc(), qt_normalizePathSegments(), QSSGBufferManager::runtimeMeshSourceName(), QQmlJS::Dom::ParsingTask::toCbor(), QSSGMesh::MeshInternal::Subset::toMeshSubset(), QPdfLinkModelPrivate::update(), and valueToKeySequence().
Returns a QString initialized with the first size bytes of the UTF-8 string str.
If size is {-1},
{strlen(str)} is used instead.
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.
This function can be used to process incoming data incrementally as long as all UTF-8 characters are terminated within the incoming data. Any unterminated characters at the end of the string will be replaced or suppressed. In order to do stateful decoding, please use \l QStringDecoder.
Definition at line 589 of file qstring.h.
References qstrlen().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the UTF-8 string str.
Definition at line 588 of file qstring.h.
References ba, and fromUtf8().
Referenced by fromUtf8().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QString initialized with the UTF-8 string str.
Definition at line 5857 of file qstring.cpp.
References QString(), ba, QUtf8::convertToUnicode(), QArrayDataPointer< char16_t >::fromRawData(), QByteArray::isEmpty(), and QByteArray::isNull().
Referenced by QQmlJS::Dom::PathEls::Current::Current(), KeyEvent::KeyEvent(), QQnxClipboard::MimeData::MimeData(), QCtfLibImpl::QCtfLibImpl(), QDBusError::QDBusError(), QGStreamerAudioDeviceInfo::QGStreamerAudioDeviceInfo(), QIconCacheGtkReader::QIconCacheGtkReader(), QIOSIntegration::QIOSIntegration(), QnxAudioDeviceInfo::QnxAudioDeviceInfo(), QPulseAudioDeviceInfo::QPulseAudioDeviceInfo(), QQnxScreen::QQnxScreen(), QQuickVisualTestUtils::QQuickApplicationHelper::QQuickApplicationHelper(), QQuickGridScaledImage::QQuickGridScaledImage(), QUtcTimeZonePrivate::QUtcTimeZonePrivate(), QWasmAudioDevice::QWasmAudioDevice(), QWindowContainer::QWindowContainer(), QQmlJS::Dom::PathEls::Root::Root(), _q_lower(), _q_upper(), QFontconfigDatabase::addApplicationFont(), QFFmpegMetaData::addEntry(), QJUnitTestLogger::addIncident(), QTapTestLogger::addIncident(), QDBusServer::address(), addTagToMap(), QQuickDesignerSupportProperties::allPropertyNames(), QtObject::atob(), QMediaFormat::audioCodecDescription(), QMediaFormat::audioCodecName(), AVFMediaPlayer::audioOutputChanged(), QWindowsMediaDeviceSession::audioOutputDeviceChanged(), availableDevices(), QSSGRhiContextStats::beginRenderPass(), blockMemberObject(), calculatePosixTransitions(), QV4::CallPrecise(), QTextMarkdownImporter::cbEnterSpan(), QTextMarkdownImporter::cbText(), QQuickDesignerSupportPropertyChanges::changeExpression(), QQuickDesignerSupportPropertyChanges::changeValue(), QQuickDesignerSupportStates::changeValueInRevertList(), checkForDrmPermission(), QNetworkReplyHttpImplPrivate::checkForRedirect(), checkRegistration(), WorkspaceHandlers::clientInitialized(), QRhiD3D11::compileHlslShaderSource(), QV4::ExecutionEngine::compileModule(), CompletionRequest::completions(), convertFromEnum(), QMacMimeAny::convertToMime(), QMacMimeUnicodeText::convertToMime(), QWindowsMimeHtml::convertToMime(), QV4::QQmlValueTypeWrapper::create(), QV4::QQmlValueTypeWrapper::create(), QQmlCppBinding::createBindingForBindable(), QQmlCppBinding::createBindingForNonBindable(), QV4::Script::createFromFileOrCache(), createQmldirParserForFile(), createQQmlType(), createQQmlType(), createQQmlType(), createQQmlType(), createQQmlType(), QKmsDevice::createScreenForConnector(), QQmlCppBinding::createTranslationBindingForBindable(), QQmlCppBinding::createTranslationBindingForNonBindable(), QGtk3FontDialogHelper::currentFont(), QDBusMarshaller::currentSignature(), QDBusDemarshaller::currentSignature(), QQmlTableModel::data(), QMYSQLResult::data(), QPSQLResult::data(), QuickTestResult::dataTag(), QPSQLResultPrivate::deallocatePreparedStmt(), defaultBackend(), QFontconfigDatabase::defaultFont(), QPpdPrintDevice::defaultPageSize(), QQmlBinding::dependencies(), QFFmpeg::deviceTypes(), QmlLsp::QmlLintSuggestions::diagnose(), TextSynchronization::didDidChangeTextDocument(), TextSynchronization::didOpenTextDocument(), QGtk3FileDialogHelper::directory(), QTranslatorPrivate::do_load(), AVFImageCapture::doCapture(), QNetworkReplyWasmImplPrivate::downloadFailed(), doWriteProperties(), doWriteProperties(), doWriteProperties(), QmlLsp::OpenDocumentSnapshot::dump(), QPcsc::errorMessage(), QSQLiteResult::exec(), QQmlJS::Dom::DomUniverse::execQueue(), QTestLog::failOnWarning(), QFontconfigDatabase::fallbacksForFamily(), QQuickFontValueType::features(), QImageCapture::fileFormatDescription(), QMediaFormat::fileFormatDescription(), QImageCapture::fileFormatName(), QMediaFormat::fileFormatName(), QZipPrivate::fillFileInfo(), QComposeInputContext::filterEvent(), QQmlContextData::findObjectId(), QSGDefaultRenderContext::fontKey(), QMYSQLDriver::formatValue(), QDBusMessagePrivate::fromDBusMessage(), QUrl::fromEncoded(), QUrl::fromPercentEncoding(), fromSQLTCHAR(), fromStdString(), AssimpUtils::generateMeshData(), QCacheUtils::getCachedFilename(), QQuickDragEvent::getDataAsString(), KeyboardModifier::getForEvent< EmscriptenKeyboardEvent >(), getIBaseError(), QSSGQmlUtilities::getIdForAnimation(), QSSGQmlUtilities::getIdForNode(), getImageFormatList(), getLockInfo_helper(), QSSGQmlUtilities::getMeshSourceName(), QXcbScreen::getOutputName(), QQuickDesignerSupportPropertyChanges::getProperty(), getRequestedDisplays(), QNearFieldTargetPrivateImpl::getTagTechnology(), QIBaseResult::gotoNext(), groupsToString(), gtkSetting(), handle_sqlite_callback(), QOpenGLDebugLoggerPrivate::handleMessage(), QQmlXMLHttpRequest::header(), QQmlXMLHttpRequest::headers(), QTimeZonePrivate::ianaIdToWindowsId(), QQmlTranslation::QsTrData::idForQmlDebug(), QQmlTranslation::QsTrIdData::idForQmlDebug(), QTestLog::ignoreMessage(), QTlsPrivate::X509CertificateSchannel::importPkcs12(), QQmlPluginImporter::importPlugins(), QWaylandInputMethodEventBuilder::indexFromWayland(), QTestLog::info(), QQuickAnimatedImagePrivate::infoForCurrentFrame(), QCameraPrivate::init(), QFontEngineFT::init(), QQmlPrivate::AOTCompiledContext::initGetEnumLookup(), VDMAbstractItemModelDataType::initializeConstructor(), QQDMIncubationTask::initializeRequiredProperties(), QQmlDelegateModelPartsMetaObject::initialValue(), QQmlDataTest::initTestCase(), QSettingsPrivate::iniUnescapedKey(), inOutObject(), inputStreamStateCallback(), QQmlTypePrivate::insertEnums(), QWidgetTextControl::insertFromMimeData(), QQuickTextControl::insertFromMimeData(), QPlatformMediaIntegration::instance(), Grammar::intern(), QSslCertificatePrivate::isBlacklisted(), QPageSize::key(), keyValueMapsLocation(), QQmlJSLinter::lintFile(), QQmlSettingsPrivate::load(), QDefaultOutputMapping::load(), QSSGShaderCache::loadBuiltinForRhi(), QKmsScreenConfig::loadConfig(), QPpdPrintDevice::loadPageSizes(), loadTzTimeZones(), QBasicPlatformVulkanInstance::loadVulkanLibrary(), QV4::ExecutableCompilationUnit::localCacheFilePath(), QOpenGLDebugLogger::loggedMessages(), QXkbCommon::lookupString(), QXkbCommon::lookupStringNoKeysymTransformations(), lookupVendorIdInSystemDatabase(), main(), main(), makeCacheKey(), QShaderDescriptionPrivate::makeDoc(), QV4DebugServiceImpl::messageReceived(), QQmlDebugMessageClient::messageReceived(), QQmlVMEMetaObject::metaCall(), QQmlJSCodeGenerator::metaTypeFromName(), QV4Include::method_include(), QV4::ArrayBufferPrototype::method_toString(), QV4::UrlSearchParamsPrototype::method_toString(), QV4::QQmlValueTypeWrapper::method_toString(), QXcbMime::mimeConvertToFormat(), QXcbMime::mimeDataForAtom(), mmErrorMessage(), QQmlLoggingCategory::name(), QQmlProperty::name(), QQnxCamera::name(), QQmlJS::Dom::PathEls::Root::name(), QQmlJS::Dom::PathEls::Current::name(), QQmlPropertyData::name(), QmlLsp::QQmlCodeModel::newDocForOpenFile(), QV4::QObjectWrapperOwnPropertyKeyIterator::next(), QV4::QQmlValueTypeWrapperOwnPropertyKeyIterator::next(), QV4::QObjectWrapper::objectToString(), onTimedTextChangedNative(), QLatin1StringView::operator!=(), QLatin1StringView::operator!=(), QQmlJSTypeReader::operator()(), operator+(), operator+(), QLatin1StringView::operator<(), QLatin1StringView::operator<(), operator<<(), QLatin1StringView::operator<=(), QLatin1StringView::operator<=(), QLatin1StringView::operator==(), QLatin1StringView::operator==(), QLatin1StringView::operator>(), QLatin1StringView::operator>(), QLatin1StringView::operator>=(), QLatin1StringView::operator>=(), QCborMap::operator[](), outputStreamStateCallback(), QSSGQmlUtilities::outputTextureAsset(), QEdidParser::parse(), parseCmakeBoolean(), QGeoTiledMappingManagerEngineNokia::parseNewVersionInfo(), QNetworkCookiePrivate::parseSetCookieHeaderLine(), QPdfDocument::password(), populateFromPattern(), QDBusConnectionPrivate::prepareHook(), QQmlMetaType::prettyTypeName(), QGstreamerAudioDecoder::processBusMessage(), QGstreamerMediaPlayer::processBusMessage(), QGstreamerMediaEncoder::processBusMessage(), QSvgHandler::processingInstruction(), QDBusAbstractInterfacePrivate::property(), QQmlPropertyMapMetaObject::propertyCreated(), propertyNameListForWritableProperties(), ModelNodeMetaObject::propertyWritten(), pullFiles(), Q_LOGGING_CATEGORY(), qCompileJSFile(), qCompileQmlFile(), qDBusGenerateClassDefXml(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromClassDef(), qEnvironmentVariable(), qMakeError(), qMakeError(), QQmlTypeLoader::qmldirContent(), qmlProtectModule(), QQmlPrivate::qmlregister(), QQmlEngine::qmlRegisterModuleImport(), QQmlEngine::qmlUnregisterModuleImport(), qSaveQmlJSUnitAsCpp(), qt_fontFromString(), qt_fontToString(), qToField(), qtValue(), queryQtPaths(), quick_test_main_with_setup(), QPulseAudioSource::read(), QQmlDataBlob::SourceCodeData::readAll(), readArrayBuffer(), QJpegHandlerPrivate::readJpegHeader(), QPngHandlerPrivate::readPngTexts(), QPSQLResult::record(), QQmlMetaType::registerCompositeSingletonType(), QQmlMetaType::registerCompositeType(), QLibInputTouch::registerDevice(), QQmlMetaType::registerModule(), QQmlMetaType::registerSequentialContainer(), QQmlMetaType::registerSingletonType(), QQmlMetaType::registerType(), QQuickDesignerSupportPropertyChanges::removeProperty(), QQmlBaseModule< RequestType >::requestHandler(), QQuickDesignerSupportStates::resetStateProperty(), QFontconfigDatabase::resolveFontFamilyAlias(), QV4::ResolveOverloaded(), QMimeDataPrivate::retrieveTypedData(), QSGRhiSupport::rhiBackendName(), rolesToString(), runRcc(), runUic(), QDeviceDiscoveryUDev::scanConnectedDevices(), QGtk3FileDialogHelper::selectedFiles(), QTimeZonePrivate::serialize(), QUtcTimeZonePrivate::serialize(), serializeBlockMemberVar(), QQmlTranslation::QsTrData::serializeForQmltc(), QQmlTranslation::QsTrIdData::serializeForQmltc(), serializeInOutVar(), serverInfoCallback(), QWindowsMediaDeviceSession::setActive(), QWindowsMediaDeviceSession::setAudioOutput(), QPSQLDriverPrivate::setByteaOutput(), QGstreamerCamera::setCamera(), QDBusConnectionPrivate::setConnection(), QQmlTableModel::setData(), QPSQLDriverPrivate::setDatestyle(), setMaterialProperties(), QXcbScreen::setMonitor(), QDBusAbstractInterfacePrivate::setProperty(), QV4::QObjectWrapper::setProperty(), QQuickTableViewPrivate::setRequiredProperty(), QQuick3DRenderStats::setRhiContext(), QTextBrowserPrivate::setSource(), setStreamURL(), settings_key_to_host_name(), QtWaylandClient::QWaylandWindow::setWindowTitle(), QXcbWindow::setWindowTitle(), QQmlPropertyCache::signalParameterStringForJS(), QQmlEnginePrivate::singletonInstance(), sinkInfoCallback(), QQmlBinding::slowWrite(), QAndroidAudioDecoder::start(), startQtAndroidPlugin(), QQmlJS::Dom::FormatTextStatus::stateToString(), QQmlSettingsPrivate::store(), QQmlProfilerEvent::string(), QMediaMetaData::stringValue(), DynamicRoleModelNode::sync(), ArgumentDef::toJson(), FunctionDef::toJson(), PropertyDef::toJson(), ClassDef::toJson(), EnumDef::toJson(), VDMListDelegateDataType::toQString(), QBasicUtf8StringView< UseChar8T >::toString(), QAsn1Element::toString(), QtCbor::ByteData::toUtf8String(), toVariant(), QV4::SequencePrototype::toVariant(), QCoreApplication::translate(), QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(), QQmlMetaType::typeId(), QNdefNfcTypeRecord::typeInfo(), QuickTestUtil::typeName(), QQmlBaseModule< RequestType >::updatedSnapshot(), QV4::Function::updateInternalClass(), QQuickDesignerSupportStates::updateStateBinding(), QQuickControlsTestUtils::QQuickStyleHelper::updateStyle(), QmlLsp::QQmlCodeModel::url2Path(), CompletionRequest::urlAndPos(), QQmlPropertyPrivate::urlSequence(), QCborMap::value(), VDMAbstractItemModelDataType::value(), QSSGQmlUtilities::valueToQml(), vasprintf(), QV4::ExecutableCompilationUnit::verifyHeader(), QMediaFormat::videoCodecDescription(), QMediaFormat::videoCodecName(), QGstreamerVideoDevices::videoDevices(), QTestLog::warn(), QX11CapturableWindows::windows(), QXcbWindow::windowTitle(), QQmlPropertyPrivate::write(), RCCFileInfo::writeDataBlob(), QSSGQmlUtilities::writeNodeProperties(), and QShaderDescriptionPrivate::writeToStream().
|
inlinestatic |
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 UTF-16.
If size is -1 (default), the string must be '\0'-terminated.
Definition at line 1164 of file qstring.h.
References fromUcs4(), and fromUtf16.
Referenced by QWindowsMediaDevices::QWindowsMediaDevices(), QWindowsPrintDevice::QWindowsPrintDevice(), QSystemLocalePrivate::amText(), QCoreApplication::arguments(), QWindowsPrintDevice::availablePrintDeviceIds(), childKeysOrGroups(), QWindowsMimeRegistry::clipboardFormatName(), QWindowsFontEngine::cloneWithSize(), convertCharArray(), QBuiltInMimes::convertToMime(), QWindowsMimeText::convertToMime(), QWindowsMimeURI::convertToMime(), QWindowsFontDatabase::createEngine(), QSystemLocalePrivate::currencySymbol(), QMimerSQLResult::data(), QWindowsFontDatabase::debugFormat(), QWindowsPrintDevice::defaultPrintDeviceId(), QWindowsTabletSupport::description(), GpuDescription::detect(), QWin32PrintEngine::drawTextItem(), findInPath(), findScreen(), findScreenForWindow(), QSystemLocalePrivate::firstDayOfWeek(), QWindowsDirect2DPaintEnginePrivate::fontFaceFromFontEngine(), fromStdWString(), getCompositionString(), getDevice(), getString(), QWindowsSystemProxy::init(), QWindowsFontEngine::initFontInfo(), interfaceListing(), isCapturableWindow(), QWindowsPrintDevice::loadInputSlots(), QWindowsPrintDevice::loadPageSizes(), QWindowsFontDatabaseBase::LOGFONT_to_QFont(), QHostInfoAgent::lookup(), mailCommand(), monitorData(), QSystemLocalePrivate::monthName(), msgBeginFailed(), CMMNotificationClient::OnDeviceAdded(), CMMNotificationClient::OnDeviceRemoved(), CMMNotificationClient::OnDeviceStateChanged(), openWebBrowser(), operator<<(), QSystemLocalePrivate::pmText(), populateFontFamilies(), populateFontFamilies(), FileOperationProgressSink::PostDeleteItem(), Q_TRACE_INSTRUMENT(), qAppFileName(), qMakeError(), qSystemDirectory(), qt_QStringFromHString(), QWinSettingsPrivate::readKey(), readLink(), readSymLink(), QMimerSQLResult::record(), QWin32PrintEngine::setGlobalDevMode(), setMonitorDataFromSetupApi(), storeFont(), storeFont(), stringFromOutLineTextMetric(), QWindowsVistaStylePrivate::themeName(), QQC2::QWindowsXPStylePrivate::themeName(), QSystemLocalePrivate::toCurrencyString(), QSystemLocalePrivate::toString(), QSystemLocalePrivate::toString(), QSystemLocalePrivate::uiLanguages(), QWinRegistryKey::value(), winIso3116CtryName(), winIso639LangName(), and QSystemLocalePrivate::zeroDigit().
|
inline |
Returns a reference to the first character in the string. Same as {operator[](0)}.
This function is provided for STL compatibility.
Definition at line 1195 of file qstring.h.
References operator[]().
|
inline |
Returns the first character in the string. Same as {at(0)}.
This function is provided for STL compatibility.
Definition at line 214 of file qstring.h.
References at.
Referenced by QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::isImportPrefix(), QPlatformTheme::removeMnemonics(), replace(), replace(), replace(), QFileInfoGatherer::run(), uuidFromString(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QmlTypeRegistrar::write(), and QColorOutput::writePrefixedMessage().
qsizetype QString::indexOf | ( | const QString & | str, |
qsizetype | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
{qstring-first-index-of} {string} {str}
{search-comparison-case-sensitivity} {search}
Example:
negative-index-start-search-from-end
Definition at line 4375 of file qstring.cpp.
References QtPrivate::findString(), QStringView, size(), str, and unicode().
qsizetype QString::indexOf | ( | QChar | c, |
qsizetype | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 4420 of file qstring.cpp.
References ch, QStringView, and unicode().
Referenced by IssueLocationWithContext::IssueLocationWithContext(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QMacSettingsPrivate::QMacSettingsPrivate(), QMimeMagicRule::QMimeMagicRule(), QQuickGridScaledImage::QQuickGridScaledImage(), QTextHtmlImporter::QTextHtmlImporter(), QTextEngine::calculateTabWidth(), QDir::cd(), checkAsciiDomainName(), QDBusPendingCallPrivate::checkReceivedSignature(), cleanPackageName(), QMimeType::comment(), contains(), contains(), contains(), QDBusMenuItem::convertMnemonic(), convertToAscii(), convertToUnicode(), QFileSystemEngine::currentPath(), dataToUrls(), QQuickScriptActionPrivate::debugAction(), QKeySequencePrivate::decodeString(), QQC2::QWindowsXPStyle::drawControl(), QItemDelegate::drawDisplay(), QFontMetrics::elidedText(), QFontMetricsF::elidedText(), QQmlCustomParser::evaluateEnum(), findChildObject(), findInBlock(), findObject(), Widget::firstIndexOfFunction(), fixedCDataSection(), fixedComment(), fixedPIData(), language::formatConnection(), QUrl::fromLocalFile(), QSslCertificate::fromPath(), QUrl::fromUserInput(), getBinaryRPaths(), QSSGShaderKeyPropertyBase::getBoolValue(), QDirPrivate::getFilterSepChar(), getLibraryProjectsInOutputFolder(), QFontMetrics::horizontalAdvance(), QFontMetrics::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), Widget::index(), Widget::indexOfFunction(), QMenu::initStyleOption(), QSslSocketPrivate::isMatchingHostname(), isScript(), QMenu::keyPressEvent(), QMenuBar::keyPressEvent(), launchMail(), loadTzTimeZones(), lookupVendorIdInSystemDatabase(), make_default_icon_name_from_mimetype_name(), QV4::StringPrototype::method_replace(), QV4::StringPrototype::method_split(), Qt::mightBeRichText(), QKeySequence::mnemonic(), nextField(), QDB2Driver::open(), parseAttributeValues(), QTestPrivate::parseBlackList(), QTextHtmlParser::parseExclamationTag(), QMapboxCommon::parseGeoLocation(), QHttpHeaderParser::parseHeaders(), parseHtmlMetaForEncoding(), parseHttpOptionHeader(), Parser::parseInstrument(), Parser::parseMetadata(), Parser::parseParamReplace(), Parser::parsePoint(), Parser::parsePrefix(), QHostAddress::parseSubnet(), parseVersion(), parseVersion(), Q_TRACE_INSTRUMENT(), qGetTableInfo(), QQmlMetaType::qmlType(), qQmlJSGenerateLoader(), qSplitTableAndOwner(), qSplitTableName(), qt_font_from_string(), qt_split_namespace(), qtModule(), queryQtPaths(), quotedValue(), readGradleProperties(), QConfFileSettingsPrivate::readIniFile(), remove(), replace(), QUrlPrivate::setAuthority(), QODBCDriverPrivate::setConnectionOptions(), QQuickFileDialogDelegate::setFile(), QMessagePattern::setPattern(), Utils::TextDocument::setPlainText(), QV4::UrlObject::setProtocol(), QUndoCommand::setText(), TileProvider::setupProvider(), QQuickTextPrivate::setupTextLayout(), QUrlPrivate::setUserInfo(), suffixFromFilter(), tokenizeLine(), QDir::toNativeSeparators(), QMenuPrivate::updateActionRects(), QAuthenticatorPrivate::updateCredentials(), QQuickTextPrivate::updateLayout(), QQuickFileDialogImplPrivate::updateSelectedFile(), QQuickFolderDialogImplPrivate::updateSelectedFolder(), QMacMimeUnicodeText::utiForMime(), and src_gui_text_qsyntaxhighlighter::MyHighlighter::wrapper().
qsizetype QString::indexOf | ( | QLatin1StringView | str, |
qsizetype | from = 0 , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
} {qstring-first-index-of} {Latin-1 string viewed by} {str}
{search-comparison-case-sensitivity} {search}
Example:
negative-index-start-search-from-end
Definition at line 4410 of file qstring.cpp.
References QtPrivate::findString(), QStringView, str, and unicode().
|
inlinenoexcept |
Definition at line 277 of file qstring.h.
References QtPrivate::findString().
|
inline |
|
inline |
Definition at line 3083 of file qstring.cpp.
References copy(), i, insert(), insert_helper(), QArrayDataPointer< T >::needsDetach(), QtPrivate::q_points_into_range(), QStringView, and unicode().
Definition at line 3110 of file qstring.cpp.
References ch, i, insert(), and QArrayDataPointer< T >::size.
Referenced by Widget::appendFunction(), cleanPackageName(), convertMnemonics(), QmlLsp::QmlLintSuggestions::diagnose(), QQmlJS::Dom::AttachedInfo::ensure(), QAndroidInputContext::getExtractedText(), QPlaceManagerEngineNokiaV2::icon(), insert(), insert(), Widget::insertFunction(), QToolBarAreaLayoutInfo::insertGap(), QToolBarAreaLayoutInfo::insertItem(), launchMail(), QMimeBinaryProvider::loadMimeTypePrivate(), QPdfDocument::metaData(), QMimeTypeParserBase::parse(), qt_findAtNxFile(), qt_getImageText(), qt_getImageTextFromDescription(), QQmlJSScope::resolveEnums(), runMoc(), QSSGMesh::Mesh::save(), QWaylandTextInputPrivate::sendInputMethodEvent(), QGeoCoordinate::toString(), QTextEngine::validate(), versionUriList(), and write_pbm_image().
QString & QString::insert | ( | qsizetype | i, |
QLatin1StringView | s | ||
) |
Definition at line 3002 of file qstring.cpp.
References i, insert_helper(), and str.
|
inline |
QString & QString::insert | ( | qsizetype | i, |
QUtf8StringView | s | ||
) |
Definition at line 3025 of file qstring.cpp.
References append(), cbegin(), cend(), QUtf8::convertToUnicode(), QArrayDataPointer< T >::data(), QArrayDataPointer< T >::detachAndGrow(), QArrayData::GrowsAtEnd, i, insert_helper(), QArrayDataPointer< T >::needsDetach(), needsReallocate(), other(), Q_CHECK_PTR(), Q_UNLIKELY, QStringView, resize(), size(), QArrayDataPointer< T >::size, and swap().
|
inline |
Definition at line 1105 of file qstring.h.
References d.
Referenced by assign(), operator=(), operator=(), QStringAlgorithms< StringType >::simplified_helper(), and QStringAlgorithms< StringType >::trimmed_helper().
|
inline |
Returns true
if the string has no characters; otherwise returns false
.
Example:
Definition at line 1083 of file qstring.h.
References d.
Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), BackendSupport::BackendSupport(), QQmlJS::Dom::CommentInfo::CommentInfo(), QtFontStyle::Key::Key(), QConfFileSettingsPrivate::QConfFileSettingsPrivate(), QDBusMenuItem::QDBusMenuItem(), QEvdevKeyboardHandler::QEvdevKeyboardHandler(), QEvdevKeyboardManager::QEvdevKeyboardManager(), QEvdevMouseManager::QEvdevMouseManager(), QEvdevTabletManager::QEvdevTabletManager(), QEvdevTouchManager::QEvdevTouchManager(), QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QFileDialogArgs::QFileDialogArgs(), QGeoFileTileCacheOsm::QGeoFileTileCacheOsm(), QGeoUriProvider::QGeoUriProvider(), QGraphicsTextItem::QGraphicsTextItem(), QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate(), QKmsDevice::QKmsDevice(), QLeDBusAdvertiser::QLeDBusAdvertiser(), QMacSettingsPrivate::QMacSettingsPrivate(), QMessagePattern::QMessagePattern(), QNetworkReplyFileImpl::QNetworkReplyFileImpl(), QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache(), QPlaceManagerEngineNokiaV2::QPlaceManagerEngineNokiaV2(), QQuickGridScaledImage::QQuickGridScaledImage(), QSSGShaderCache::QSSGShaderCache(), QTemporaryDir::QTemporaryDir(), QWin32PrintEngine::QWin32PrintEngine(), QWindowContainer::QWindowContainer(), QWinSettingsPrivate::QWinSettingsPrivate(), QDBusMenuConnection::~QDBusMenuConnection(), QQmlInfo::~QQmlInfo(), QSSGShaderCache::~QSSGShaderCache(), QWindowsFontEngine::~QWindowsFontEngine(), QWindowsFontEngineDirectWrite::~QWindowsFontEngineDirectWrite(), QTextBrowserPrivate::_q_activateAnchor(), QTextBrowserPrivate::_q_documentModified(), _q_escapeIdentifier(), QFileDialogPrivate::_q_goToDirectory(), QTextBrowserPrivate::_q_highlightLink(), QLabelPrivate::_q_linkHovered(), QQmlApplicationEnginePrivate::_q_loadTranslations(), QFileDialogPrivate::_q_nativeEnterDirectory(), QPrintPreviewDialogPrivate::_q_print(), QComboBoxPrivate::_q_returnPressed(), QComboBoxPrivate::_q_rowsInserted(), QFileDialogPrivate::_q_selectionChanged(), QLineEditPrivate::_q_selectionChanged(), QPlainTextEditPrivate::_q_updatePlaceholderVisibility(), QFontDialogPrivate::_q_updateSample(), QFileDialogPrivate::_q_useNameFilter(), QMessageBox::aboutQt(), QHstsStore::absoluteFilePath(), CPP::WriteInitialization::acceptActionRef(), CustomWidgetsInfo::acceptCustomWidget(), CPP::WriteInitialization::acceptLayoutItem(), CPP::WriteInitialization::acceptTabStops(), CPP::WriteDeclaration::acceptUI(), CPP::WriteInitialization::acceptUI(), CPP::WriteInitialization::acceptWidget(), DatabaseInfo::acceptWidget(), QWindowsMediaDeviceReader::activate(), QWidgetTextControlPrivate::activateLinkUnderCursor(), QQuickTextControlPrivate::activateLinkUnderCursor(), adapterWithDBusPeripheralInterface(), QWindowsDirectWriteFontDatabase::addApplicationFont(), QMessageBox::addButton(), QQmlJSImportVisitor::addDefaultProperties(), QFileDialogPrivate::addDefaultSuffixToFiles(), QFileDialogPrivate::addDefaultSuffixToUrls(), QIcon::addFile(), QQmlImports::addFileImport(), addFontToDatabase(), addFontToDatabase(), QQmlImportDatabase::addImportPath(), QQmlJSCodeGenerator::addInclude(), Parser::addIncludesRecursive(), addKey(), QQmlImports::addLibraryImport(), QQmlJS::Dom::LineWriter::addNewlinesAutospacerCallback(), QFileSystemModelPrivate::addNode(), QFseventsFileSystemWatcherEngine::addPaths(), QCommandLineParser::addPositionalArgument(), addressLine(), QWasmVideoOutput::addSourceElement(), QPainterPath::addText(), QQuickTextNodeEngine::addTextBlock(), QQuickPathText::addToPath(), QUrlModel::addUrls(), QQmlJS::Dom::LoadInfo::advanceLoad(), QWidgetLineControl::allSelected(), QQuickTextInputPrivate::allSelected(), QQuickTextPrivate::anchorAt(), annotateListElements(), QUrlPrivate::appendHost(), QT_BEGIN_NAMESPACE::appendOrganizationAndApp(), appendOrganizationAndApp(), appendOrganizationAndApp(), appendOrganizationAndApp(), QPSQLDriverPrivate::appendTables(), QCoreApplication::applicationFilePath(), QTextHtmlParser::applyAttributes(), QQmlJSLinter::applyFixes(), QCoreApplicationPrivate::appName(), argumentsFromCommandLineAndFile(), QmlTypeRegistrar::argumentsFromCommandLineAndFile(), QSqlQueryModelSql::as(), QNetworkAccessManagerPrivate::authenticationRequired(), automaticPipelineCacheDir(), automaticPipelineCacheFileName(), QAbstractGeoTileCache::baseCacheDirectory(), QQuickContext2DImageTexture::beginPainting(), bestStyle(), QFontDatabase::bold(), QPainter::boundingRect(), QPainter::boundingRect(), QSvgGradientStyle::brush(), QCss::StyleSheet::buildIndexes(), buildMatchRule(), QProcEnvValue::bytes(), QAbstractFileIconEngine::cacheKey(), QWindowsFileIconEngine::cacheKey(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), QAuthenticatorPrivate::calculateResponse(), GeoRoutingManagerEngineEsri::calculateRoute(), QV4::Runtime::CallProperty::call(), QWindowsMimeHtml::canConvertFromMime(), QDBusAbstractInterfacePrivate::canMakeCalls(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), DocumentFile::canRead(), QQnxImageCapture::capture(), QTextMarkdownImporter::cbEnterSpan(), QDir::cd(), QQmlJSUtils::changeHandlerProperty(), changeInstallName(), QDomBuilder::characters(), QQmlJSImportVisitor::checkDeprecation(), checked_var_value(), QAbstractItemViewPrivate::checkMouseMove(), QQmlJSImportVisitor::checkRequiredProperties(), QPlaceManagerEngineMapbox::childCategories(), QPlaceManagerEngineMapbox::childCategoryIds(), QConfFileSettingsPrivate::children(), Viewer::chooseFile(), cleanAndroidFiles(), cleanPackageName(), QBenchmarkValgrindUtils::cleanup(), QWindowsFontEngine::cloneWithSize(), QWindowsFontEngineDirectWrite::cloneWithSize(), QCupsPrintEnginePrivate::closePrintDevice(), codesignFile(), Collector::collect(), collectJson(), comify(), QSqlQueryModelSql::comma(), QMimeType::comment(), QIBusPlatformInputContext::commit(), QtWaylandClient::QWaylandTextInputv2::commit(), QQmlJS::Dom::LineWriter::commitLine(), compilerRunTimeLibs(), QQuickFolderListModel::componentComplete(), QDeclarativeGeoServiceProvider::componentComplete(), QSqlQueryModelSql::concat(), QBluetoothSocketPrivateWinRT::connectToService(), QBluetoothSocketPrivateBluezDBus::connectToServiceHelper(), QPlaceManagerEngineNokiaV2::constructIconUrl(), contextFactory(), QWindowsMimeURI::convertFromMime(), QMacMimeFileUri::convertFromMime(), QMacMimeUrl::convertFromMime(), QQmlJSCodeGenerator::convertStored(), convertToAscii(), convertToExtendedType(), copyAndroidSources(), copyPackage(), QDeclarativeGeoMapCopyrightNotice::copyrightsChanged(), cpp(), QQmlPreviewFileEngineHandler::create(), WindowCreationData::create(), QNetworkAccessFileBackendFactory::create(), QRhiVulkan::create(), QtObject::createComponent(), QtWaylandClient::QWaylandWindow::createDecoration(), createFontFile(), createFontNode(), createImageNode(), QGeoServiceProviderFactoryMapbox::createMappingManagerEngine(), QWindowsFileDialogHelper::createNativeDialog(), QCupsPrinterSupport::createNativePrintEngine(), createPixmapDataSync(), QGeoServiceProviderFactoryMapbox::createPlaceManagerEngine(), createProject(), QtObject::createQmlObject(), createRcc(), QUndoGroup::createRedoAction(), QNetworkAccessManager::createRequest(), QSGRhiSupport::createRhi(), QGeoServiceProviderFactoryMapbox::createRoutingManagerEngine(), QKmsDevice::createScreenForConnector(), QLineEdit::createStandardContextMenu(), createSvgNode(), QUndoGroup::createUndoAction(), createUseNode(), QAbstractFileEngineIterator::currentFilePath(), QtWaylandClient::QWaylandDataSource::data_source_target(), QCalendarBackend::dateTimeToString(), QCss::StyleSelector::declarationsForNode(), decodePolyline(), QKeySequencePrivate::decodeString(), QQmlJSScope::defaultPropertyName(), defaultTemplateName(), QTemporaryFilePrivate::defaultTemplateName(), QV4::Compiler::Codegen::defineFunction(), QSqlTableModel::deleteRowFromTable(), QAndroidInputContext::deleteSurroundingText(), deploy(), deployQtFrameworks(), QQmlJS::Dom::FieldFilter::describeFieldsFilter(), QCapturableWindow::description(), QColorSpace::description(), QtAndroidAccessibility::descriptionForInterface(), QCommandLinkButtonPrivate::descriptionHeight(), QQmlJSRegisterContent::descriptiveName(), QUnicodeTables::detachAndConvertCase(), QQuickTextPrivate::determineHorizontalAlignment(), determineScreenSize(), QFileDialog::directory(), QLowEnergyControllerPrivateBluezDBus::discoverServices(), QTranslatorPrivate::do_load(), AVFImageCapture::doCapture(), Decoder::doDecode(), QPdfSearchModelPrivate::doSearch(), QNetworkReplyWasmImplPrivate::doSendRequest(), QCtfLibImpl::doTracepoint(), QTextDocumentLayoutPrivate::drawBlock(), QQC2_NAMESPACE::QMacStyle::drawControl(), QQC2::QCommonStyle::drawControl(), QMacStyle::drawControl(), QCommonStyle::drawControl(), QQC2::QWindowsXPStyle::drawControl(), QItemDelegate::drawDisplay(), QStyle::drawItemText(), QQC2::QStyle::drawItemText(), QPainter::drawStaticText(), QPainter::drawText(), dump(), QQmlJS::Dom::ErrorMessage::dump(), QQuickStylePrivate::effectiveStyleName(), QQuickComboBoxPrivate::effectiveTextRole(), QQmlJSImportVisitor::endVisit(), QIconLoader::ensureInitialized(), QQmlJS::Dom::LineWriter::ensureNewline(), QQmlJS::Dom::LineWriter::ensureSpace(), QQmlJS::Dom::LineWriter::ensureSpace(), QDBusMessage::errorMessage(), QUrl::errorString(), QLibrary::errorString(), QImageReader::errorString(), QCommandLineParser::errorText(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QMimerSQLDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSqlQueryModelSql::et(), QQmlCustomParser::evaluateEnum(), QMenu::event(), QFontDef::exactMatch(), excludeBaseUrl(), QSqlTableModelPrivate::exec(), QQmlJS::Dom::DomUniverse::execQueue(), QWindowsXpNativeFileDialog::existingDirCallback(), existingImageFileForPath(), DocumentFile::exists(), exitDirection(), MetaTypesJsonProcessor::extractRegisteredTypes(), QPlatformFontDatabase::fallbacksForFamily(), QCoreTextFontDatabase::fallbacksForFamily(), QFontconfigDatabase::fallbacksForFamily(), QIconLoader::fallbackThemeName(), QFontDatabase::families(), QNetworkAccessAuthenticationManager::fetchCachedCredentials(), QNetworkAccessAuthenticationManager::fetchCachedProxyCredentials(), QLibrary::fileName(), FolderIterator::fileType(), QHttpNetworkConnectionPrivate::fillPipeline(), QHttpNetworkConnectionPrivate::fillPipeline(), filterSpecs(), QQmlDataBlob::finalUrlString(), QTextDocument::find(), QStandardPaths::findExecutable(), QFontDatabasePrivate::findFont(), QQuickVisualTestUtils::findItem(), QQuickVisualTestUtils::findItems(), findMinGWRuntimePaths(), QResourceRoot::findNode(), QLibraryStore::findOrCreate(), findQtPlugins(), findSharedLibraries(), findStyleInModel(), findTextEntry(), findUsagesOfNonJSIdentifiers(), QDomNode::firstChildElement(), fixedXmlName(), QFontDatabase::font(), QGtk3Interface::font(), QWindowsFontDatabaseBase::fontDefToLOGFONT(), QPlatformFontDatabase::fontDir(), QWindowsFontEngineDirectWrite::fontNameSubstitute(), QWindowsWindow::forcedScreenForGLWindow(), foreach(), QQuickControlsTestUtils::forEachControl(), QWindowsShellItem::format(), QPrintDevice::format(), QWindowsMimeHtml::formatsForMime(), QPlatformWindow::formatWindowTitle(), freeDesktopTrashLocation(), QUrl::fromLocalFile(), QSslCertificate::fromPath(), QQmlJS::Dom::QmldirFile::fromPathAndCode(), QFont::fromString(), QUrl::fromUserInput(), QQmlJSCodeGenerator::generate_Exp(), QQmlJSCodeGenerator::generate_MoveReg(), QQmlJSCodeGenerator::generate_Ret(), QQmlJSCodeGenerator::generate_SetLookup(), QQuickStatePrivate::generateActionList(), QQmlJSCodeGenerator::generateEnumLookup(), QMediaStorageLocation::generateFileName(), QQmlJSCodeGenerator::generateLookup(), QMimeType::genericIconName(), QColorDialog::getColor(), QTlsBackendOpenSSL::getErrorsFromOpenSsl(), QFontDialogPrivate::getFont(), getIBaseError(), getLinks_helper(), QBenchmarkValgrindUtils::getNewestFileName(), QFileDialog::getOpenFileUrl(), QFileDialog::getOpenFileUrls(), QQmlTypeLoader::getQmldir(), QQuick3DPhysicsHeightField::getSamples(), QFileDialog::getSaveFileUrl(), QQmlTypeLoader::getScript(), getSelectedText(), QGeoTileFetcherNokia::getTileImage(), QQmlTypeLoader::getType(), getWinLocaleName(), QXcbConnection::glIntegration(), QRawFont::glyphIndexesForString(), QQuickStochasticEngine::goalSeek(), QGtk3Theme::gtkFontName(), QtWayland::HardwareIntegration::hardware_integration_bind_resource(), QDomImplementation::hasFeature(), QSSGRenderModel::hasLightmap(), QQuickDropAreaPrivate::hasMatchingKey(), QWidgetLineControl::hasSelectedText(), QQuickTextInputPrivate::hasSelectedText(), QQuickIconLabelPrivate::hasText(), header(), Driver::headerFileName(), QFileDialogPrivate::helperPrepareShow(), QGraphicsScene::helpEvent(), QAbstractItemDelegate::helpEvent(), QCommandLineParserPrivate::helpText(), QTextDocumentLayout::hitTest(), QFileSystemEngine::homePath(), QNetworkInterface::humanReadableName(), QPlaceManagerEngineNokiaV2::icon(), iconEngineFromSuffix(), QMimeType::iconName(), iconTempPath(), QColorSpacePrivate::identifyColorSpace(), QTextHtmlImporter::import(), AssimpImporter::import(), QQmlPluginImporter::importDynamicPlugin(), QSSGAssetImportManager::importFile(), importImp(), QQmlPluginImporter::importPlugins(), QQuickAnimatedImagePrivate::infoForCurrentFrame(), QWindowsSystemProxy::init(), QFontDialogPrivate::init(), QKeySequenceEditPrivate::init(), QLowEnergyControllerPrivateBluezDBus::init(), QGeoFileTileCache::init(), QGeoFileTileCacheOsm::init(), QTextEditPrivate::init(), QMessageBoxPrivate::init(), QGeoSatelliteInfoSourceGypsy::init(), QPrintPreviewDialogPrivate::init(), init_platform(), QCoreApplicationPrivate::initConsole(), QIntegrityFbScreen::initialize(), QApplicationPrivate::initialize(), QBsdFbScreen::initialize(), QLinuxFbScreen::initialize(), QWaylandTextureSharingExtension::initialize(), QSocks5SocketEnginePrivate::initialize(), QLoggingRegistry::initializeRules(), QDBusAbstractInterfacePrivate::initOwnerTracking(), QQmlDataTest::initTestCase(), QmlIR::Parameter::initType(), QQuickTextInput::insert(), QWidgetTextControlPrivate::insertParagraphSeparator(), QFormLayout::insertRow(), QFormLayout::insertRow(), QSqlTableModel::insertRowIntoTable(), QTextCursor::insertText(), installApk(), QPlatformMediaIntegration::instance(), QQmlSettingsPrivate::instance(), instructionContinue(), instructionDepart(), instructionDirection(), instructionEndOfRoad(), instructionFerry(), instructionFork(), instructionMerge(), instructionNewName(), instructionNotification(), instructionOffRamp(), instructionPushingBike(), instructionRotary(), instructionRoundaboutTurn(), instructionTrain(), instructionTurn(), instructionUseLane(), QFileSystemEntry::isAbsolute(), QInputControl::isAcceptableInput(), QQmlJSMetaProperty::isAlias(), QFontDatabase::isBitmapScalable(), isBypassed(), QFileSystemEntry::isEmpty(), QGlyphRun::isEmpty(), QQmlScriptString::isEmpty(), QQuickIcon::isEmpty(), QPlaceAttributePrivate::isEmpty(), QPlaceSupplierPrivate::isEmpty(), QGeoAddress::isEmpty(), QSSGRenderPath::isEmpty(), Widget::isEmptyFunction(), isHostExcluded(), QQmlJSImportVisitor::isImportPrefix(), QDeclarativePluginParameter::isInitialized(), isIp6(), QFileDialogOptions::isLabelExplicitlySet(), QLibrary::isLibrary(), QQmlImports::isLocal(), QQmlImports::isLocal(), QQmlFile::isLocalFile(), QPixmapIconEngineEntry::isNull(), QUrl::isParentOf(), QQmlJSMetaProperty::isPrivate(), QLockFilePrivate::isProcessRunning(), QQmlJSScope::isResolved(), QTextEngine::isRightToLeft(), QQmlJSScope::isSameType(), QDateTimeEditPrivate::isSeparatorKey(), QQmlToolingSettings::isSet(), QFontDatabase::isSmoothlyScalable(), QGeoAddress::isTextGenerated(), QGstreamerCamera::isV4L2Camera(), QMimeType::isValid(), QPageSizePrivate::isValid(), QNetworkInterface::isValid(), BreakPoint::isValid(), QQmlJSMetaEnum::isValid(), QQmlJSMetaMethod::isValid(), QQmlJSMetaProperty::isValid(), QQmlJSMetaPropertyBinding::isValid(), QQmlJSResourceFileMapper::Entry::isValid(), QQmlProfilerEventLocation::isValid(), QQmlXmlListModelRole::isValid(), QTgaFile::isValid(), GeoRouteJsonParserEsri::isValid(), QGeoAreaMonitorInfo::isValid(), QDBusUtil::isValidBusName(), QDBusUtil::isValidInterfaceName(), QFontDatabase::italic(), QStyle::itemTextRect(), QQC2::QStyle::itemTextRect(), itemToDialogUrl(), QQmlJS::Dom::ModuleIndex::iterateDirectSubpaths(), Stringify::JA(), Stringify::JO(), QAbstractItemView::keyboardSearch(), QTreeView::keyboardSearch(), QKeySequenceEdit::keyPressEvent(), QPlainTextEdit::keyPressEvent(), QTextEdit::keyPressEvent(), QTextBrowser::keyPressEvent(), keysymToQtKey_internal(), QDomNode::lastChildElement(), QODBCResult::lastInsertId(), launchMail(), QWaylandQuickHardwareLayerPrivate::layerIntegration(), QWidgetLineControl::layoutDirection(), QWizardPrivate::layoutInfoForCurrentPage(), QQmlJS::Lexer::lex(), QLibraryPrivate::load(), QQuickAnimatedImage::load(), QQuickBorderImage::load(), QTranslator::load(), QPixmap::load(), QSSGLoadedTexture::load(), SourceResolver::load(), QWaylandCompositorPrivate::loadClientBufferIntegration(), QKmsScreenConfig::loadConfig(), QMimeDatabasePrivate::loadGenericIcon(), QMimeDatabasePrivate::loadIcon(), QEvdevKeyboardManager::loadKeymap(), QSSGBufferManager::loadMeshData(), QMimeBinaryProvider::loadMimeTypePrivate(), QMimeDatabasePrivate::loadMimeTypePrivate(), QQmlJS::Dom::DomEnvironment::loadModuleDependency(), QWaylandCompositorPrivate::loadServerBufferIntegration(), AndroidStyle::loadStyleData(), loadTzTimeZones(), QHostInfo::localDomainName(), QQmlLocale::locale(), QDateTimePrivate::localNameAtMillis(), QQmlImportDatabase::locateLocalQmldir(), QQmlImportDatabase::lockModule(), QHostInfoAgent::lookup(), QCompletionEngine::lookupCache(), QQmlSA::lookupName(), lookupVendorIdInSystemDatabase(), QSysInfo::machineUniqueId(), mailCommand(), main(), main(), makeCacheKey(), QDBusMessagePrivate::makeLocal(), Stringify::makeMember(), mangledIdentifier(), QResourceRoot::mappingRootSubdir(), QAbstractItemModel::match(), matchFamilyName(), QCompletionEngine::matchHint(), QTemporaryFilePrivate::materializeUnnamedFile(), maybeEscapeFirstChar(), QUrlPrivate::mergePaths(), Option::messagePrefix(), QV4::ExecutionEngine::metaTypeFromJS(), QQuickJSContext2DPrototype::method_createPattern(), QV4::QQmlXMLHttpRequestCtor::method_get_response(), QV4Include::method_include(), QV4::StringPrototype::method_lastIndexOf(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), QV4::StringPrototype::method_split(), QV4::ErrorPrototype::method_toString(), Qt::mightBeRichText(), QLastResortMimes::mimeForFormat(), QDir::mkdir(), QDir::mkdir(), QDir::mkpath(), moc(), QEglFSKmsScreen::model(), QQmlJS::Dom::Paths::moduleScopePath(), QHeaderView::mouseMoveEvent(), QQuickText::mousePressEvent(), QDeclarativeGeoMapCopyrightNotice::mousePressEvent(), QWidgetTextControlPrivate::mouseReleaseEvent(), QWhatsThat::mouseReleaseEvent(), QQuickText::mouseReleaseEvent(), QDeclarativeGeoMapCopyrightNotice::mouseReleaseEvent(), QQuickTextControlPrivate::mouseReleaseEvent(), QQmlProperty::name(), QTextHtmlParser::newNode(), QDomNode::nextSiblingElement(), QFileSystemModelPrivate::node(), QNetworkCookie::normalize(), notfound(), Widget::nullVsEmpty(), objectPathIsForThisDevice(), QV4::QObjectWrapper::objectToString(), QQmlEngine::offlineStoragePath(), QQmlSA::DebugPropertyPass::onBinding(), QDeclarativeGeoMapCopyrightNotice::onCopyrightsStyleSheetChanged(), QGeoTiledMapOsm::onProviderDataUpdated(), QNetworkAccessFileBackend::open(), QDB2Driver::open(), QIBaseDriver::open(), QOCIDriver::open(), QODBCDriver::open(), QPSQLDriver::open(), QQmlDebugServerImpl::open(), QQmlLocalStorage::openDatabaseSync(), QPdfPrintEnginePrivate::openPrintDevice(), QCupsPrintEnginePrivate::openPrintDevice(), QIOSServices::openUrl(), QAndroidPlatformServices::openUrl(), QPrintDialogPrivate::openWindowsPrintDialogModally(), QDomDocument::ParseResult::operator bool(), QQmlJSTypeDescriptionReader::operator()(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator==(), QSqlQueryModelSql::orderBy(), osrmInstructionText(), QtWaylandClient::QWaylandBradientDecoration::paint(), QTextEditPrivate::paint(), QVideoFrame::paint(), QFontFamilyDelegate::paint(), QSqlQueryModelSql::paren(), QQuickFolderListModel::parentFolder(), QQmlJSScope::parentPropertyName(), QIconTheme::parents(), QEdidParser::parse(), QQmlDirParser::parse(), QCommandLineParserPrivate::parse(), Parser::parse(), QMimeTypeParserBase::parse(), parseAnimateColorNode(), parseAnimateTransformNode(), parseArguments(), parseBaseGradient(), QTestPrivate::parseBlackList(), QMapboxCommon::parseGeoLocation(), QAuthenticatorPrivate::parseHttpResponse(), parseIpFuture(), QT_BEGIN_NAMESPACE::parseLocation(), QGeoTiledMappingManagerEngineNokia::parseNewVersionInfo(), parseOptions(), parseOptions(), QCommandLineParserPrivate::parseOptionValue(), parseOthers(), parseOtoolLibraryLine(), QT_BEGIN_NAMESPACE::parsePlaceResult(), parseProvider(), QSocks5SocketEnginePrivate::parseRequestMethodReply(), parseServerList(), QNetworkCookiePrivate::parseSetCookieHeaderLine(), QLocalSocketPrivate::parseSockaddr(), QHostAddress::parseSubnet(), QCss::Parser::parseTerm(), parseTestArgs(), QWidgetLineControl::paste(), QStringMatcher::pattern(), QBluetoothSocketPrivateBluezDBus::peerAddress(), QBluetoothSocketPrivateBluezDBus::peerName(), persistentQsbcDir(), persistentQsbcFileName(), QFontDatabase::pointSizes(), QtModuleInfoStore::populate(), QWindowsDirectWriteFontDatabase::populateFamily(), QWindowsDirectWriteFontDatabase::populateFontDatabase(), populateFontFamilies(), populateFontFamilies(), QGtk3Storage::populateMap(), prefixedName(), QV4::Function::prettyName(), QDomNode::previousSiblingElement(), QOCIDriver::primaryIndex(), QODBCDriver::primaryIndex(), QPSQLDriver::primaryIndex(), QApplicationPrivate::process_cmdline(), QQmlJSImportVisitor::processDefaultProperties(), QQuickTextPrivate::processHoverEvent(), QV4::processInlinComponentType(), QWidgetLineControl::processKeyEvent(), propertyNotFoundError(), propertyWriteReply(), pythonRoot(), Q_TRACE_POINT(), qAppFileName(), qDBusInterfaceFromMetaObject(), qDBusIntrospectObject(), qDBusPropertyGet(), qDBusPropertyGetAll(), qDBusPropertySet(), qDecodeDataUrl(), qExtractFontFamiliesFromString(), QTest::qFindTestData(), qGetTableInfo(), qMakeFieldInfo(), QSSGQmlUtilities::qmlComponentName(), QQmlTypeLoader::qmldirContent(), QQmlJS::Dom::ModuleIndex::qmldirsToLoad(), QQmlPrivate::qmlregister(), QQmlTypeData::qmlType(), QV4::ExecutableCompilationUnit::qmlTypeForComponent(), qQmlJSGenerateLoader(), qRelocateResourceFile(), qSaveQmlJSUnitAsCpp(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), qt_ACE_do(), qt_font_from_string(), qt_fontFromString(), qt_idForPpdKey(), qt_mac_applicationName(), qt_registerAliasToFontFamily(), qt_resolveFontFamilyAlias(), qtModule(), QQmlTypeData::TypeReference::qualifiedName(), queryQtPaths(), quick_test_main_with_setup(), rawStandaloneMonthName(), QImageReader::read(), QCacheUtils::readCachedMesh(), QWavefrontMesh::readData(), readInputFile(), QJpegHandlerPrivate::readJpegHeader(), QPngHandlerPrivate::readPngHeader(), QPngHandlerPrivate::readPngTexts(), QSocks5SocketEnginePrivate::reauthenticate(), QComboBoxPrivate::recomputeSizeHint(), QWindowsInputContext::reconvertString(), QDB2Driver::record(), QOCIDriver::record(), QODBCDriver::record(), QPSQLDriver::record(), QtBluezDiscoveryManager::registerDiscoveryInterest(), QQmlMetaType::registerPluginTypes(), QQuickStylePlugin::registerTypes(), QtQuickControls2Plugin::registerTypes(), QQmlJS::Dom::LineWriter::reindentAndSplit(), QQmlJS::Dom::IndentingLineWriter::reindentAndSplit(), QDir::relativeFilePath(), QLibraryStore::releaseLibrary(), QToolBarAreaLayout::remove(), QWinSettingsPrivate::remove(), QSettings::remove(), QToolBarAreaLayout::remove(), QPlatformTheme::removeMnemonics(), QToolBarAreaLayoutInfo::removeToolBar(), QDir::rename(), QtWaylandClient::QWaylandXdgSurface::requestActivate(), QtWaylandClient::QWaylandXdgActivationV1::requestXdgActivationToken(), QTemporaryFilePrivate::resetFileEngine(), QQuickImageBase::resolve2xLocalFile(), resolveBugListFile(), QOffscreenIntegration::resolveConfigFileConfiguration(), QUrl::resolved(), QV4::ExecutionEngine::resolvedUrl(), QFontconfigDatabase::resolveFontFamilyAlias(), QSvgGradientStyle::resolveStops_helper(), QQmlImportInstance::resolveType(), QTextBrowserPrivate::resolveUrl(), QDialogButtonBoxPrivate::retranslateStrings(), QMacPasteboard::retrieveData(), QDir::rmdir(), QDir::rmpath(), FileInfoThread::run(), QQmlDebugServerThread::run(), QDBusXmlToCpp::run(), runAdb(), runMoc(), runProcess(), runRcc(), runUic(), QSSGQmlUtilities::sanitizeQmlId(), QWindowsFontDatabaseBase::sanitizeRequest(), QGeoPositionInfoSourceFactoryNmea::satelliteInfoSource(), QDomElementPrivate::save(), QDomDocumentPrivate::saveDocument(), Viewer::saveImage(), QToolBarAreaLayout::saveState(), scanImports(), RemoteDeviceManager::scheduleJob(), QQmlJSTypeResolver::scopedType(), QEvdevTouchScreenData::screenGeometry(), QQmlTypeData::scriptImported(), QV4::UrlObject::search(), QQmlToolingSettings::search(), searchExecutable(), section(), QQuickViewSection::sectionString(), QFileDialog::selectFile(), QFileSelectorPrivate::selectionHelper(), QSqlTableModel::selectRow(), QSqlTableModel::selectStatement(), QSqlRelationalTableModel::selectStatement(), QHttpProtocolHandler::sendRequest(), QSocks5SocketEnginePrivate::sendRequestMethod(), set_text(), QCoreApplication::setApplicationName(), QCoreApplication::setApplicationVersion(), QWindowsMediaDeviceReader::setAudioOutput(), setAVMetadataItemForKey(), QQmlImports::setBaseUrl(), QNetworkDiskCache::setCacheDirectory(), QQuickContext2DTexture::setCanvasWindow(), QAndroidInputContext::setComposingRegion(), QAndroidInputContext::setComposingText(), QQuickTextControlPrivate::setContent(), QWidgetTextControlPrivate::setContent(), QQuickStateGroupPrivate::setCurrentStateInternal(), QLineEditPrivate::setCursorVisible(), QFileSystemModel::setData(), QCommandLineOption::setDefaultValue(), QGuiApplication::setDesktopFileName(), QFileDialog::setDirectory(), QWindowsNativeFileDialogBase::setDirectory(), QSocks5SocketEnginePrivate::setErrorState(), QFactoryLoader::setExtraSearchPath(), QQuickStyleSpec::setFallbackStyle(), QWidgetTextControl::setFocusToAnchor(), setFontFamilyFromValues(), QQuickSpriteGoalAffector::setGoalState(), QmlIR::IRBuilder::setId(), QMessageBox::setInformativeText(), QCUPSSupport::setJobHold(), QLibraryPrivate::setLoadHints(), QMediaPlayerPrivate::setMedia(), QQuick3DRenderStatsMeshesModel::setMeshData(), QMacPasteboard::setMimeData(), QDeclarativePluginParameter::setName(), QDeclarativePositionSource::setName(), QQmlTypePrivate::setName(), QWindowsNativeFileDialogBase::setNameFilters(), QWindowsNativeSaveFileDialog::setNameFilters(), QMdiSubWindowPrivate::setNewWindowTitle(), QQuick3DRenderStatsPassesModel::setPassData(), QMessagePattern::setPattern(), QTextEngine::setPreeditArea(), QHttpSocketEngine::setProxy(), QQmlImportInstance::setQmldirContent(), QAbstractSpinBoxPrivate::setRange(), QNetworkReplyWasmImplPrivate::setReplyAttributes(), QFileSystemModel::setRootPath(), QUrl::setScheme(), QQuickFontLoader::setSource(), QTextBrowserPrivate::setSource(), QApplication::setStyleSheet(), QWidget::setStyleSheet(), QDeclarativeGeoMapCopyrightNotice::setStyleSheet(), QImageWriter::setText(), QQuick3DRenderStatsTexturesModel::setTextureData(), QV4::CompiledData::CompilationUnit::setUnitData(), QV4::Compiler::Context::setupFunctionIndices(), TileProvider::setupProvider(), QQmlDMAbstractItemModelData::setValue(), QQmlDMListAccessorData::setValue(), QDeclarativePluginParameter::setValue(), QWindowPrivate::setVisible(), QAndroidCamera::setWhiteBalanceMode(), QWidget::setWindowTitle(), QCocoaWindow::setWindowTitle(), QQuickFontDialogImplAttached::setWritingSystemComboBox(), QLineEditPrivate::shouldShowPlaceholderText(), QtAndroidDialogHelpers::QAndroidPlatformMessageDialogHelper::show(), QCocoaMessageDialog::show(), QBalloonTip::showBalloon(), QDBusTrayIcon::showMessage(), QWindowsSystemTrayIcon::showMessage(), QMessageBoxPrivate::showOldMessageBox(), showParserMessage(), QToolTip::showText(), signAAB(), signPackage(), QStringAlgorithms< StringType >::simplified_helper(), QQC2::QCommonStyle::sizeFromContents(), QQC2::QWindowsStyle::sizeFromContents(), QFontDatabase::smoothSizes(), QAbstractSpinBoxPrivate::specialValue(), QCss::Selector::specificity(), splitIntoFamilies(), QSqlDriver::sqlStatement(), QStandardPaths::standardLocations(), QQC2::QCommonStyle::standardPixmap(), QWasmVideoOutput::start(), QLowEnergyControllerPrivateBluezDBus::startAdvertising(), QQmlJSCodeGenerator::startInstruction(), QHttpThreadDelegate::startRequest(), QThreadPoolPrivate::startThread(), QQmlFile::status(), QWasmAudioOutput::stop(), QProcEnvValue::string(), QtFontFoundry::style(), QCss::StyleSelector::styleRulesForNode(), QFontDatabase::styles(), QFontDatabase::styleString(), QFontDatabase::styleString(), QQmlJS::Dom::QmlComponent::subComponentsNames(), QQC2::QCommonStyle::subElementRect(), QCommonStyle::subElementRect(), QLibraryPrivate::suffixes_sys(), QCocoaMenuItem::sync(), QQuickHeaderViewBasePrivate::syncModel(), QDB2Driver::tables(), QIBaseDriver::tables(), QSQLiteDriver::tables(), tabTextFor(), QToolBarAreaLayout::takeAt(), QQuickWheelHandlerPrivate::targetMetaProperty(), QFileSystemEngine::tempPath(), QQmlDataTest::testFile(), QSqlError::text(), QGeoAddress::text(), QImage::text(), QClipboard::text(), QQuickTextInputPrivate::textDirection(), SharedTextureImageResponse::textureFactory(), QIconLoader::themeName(), QMdiSubWindowPrivate::titleBarOptions(), QCommandLinkButtonPrivate::titleRect(), QJSPrimitiveValue::toBoolean(), QLocale::toCurrencyString(), QLocale::toCurrencyString(), QDBusMessagePrivate::toDBusMessage(), QTextHtmlExporter::toHtml(), QUrlPrivate::toLocalFile(), QQmlPropertyCache::toMetaObjectBuilder(), MFMetaData::toNative(), QNetworkCookie::toRawForm(), QHostAddress::toString(), GpuDescription::toString(), QQmlError::toString(), QSvgIconEnginePrivate::tryLoad(), Driver::unique(), QtQuickControls2Plugin::unregisterTypes(), QDeclarativeGeocodeModel::update(), QVideoTextureHelper::SubtitleLayout::update(), QMenuPrivate::updateActionRects(), QQuickStateGroupPrivate::updateAutoState(), QGraphicsSimpleTextItemPrivate::updateBoundingRect(), QQuickListViewPrivate::updateCurrentSection(), QAndroidInputContext::updateCursorPosition(), QGraphicsSvgItemPrivate::updateDefaultSize(), QAbstractSpinBoxPrivate::updateEdit(), QQuickComboBoxPrivate::updateEditText(), QQuickFontDialogImplAttached::updateFamilies(), QDBusTrayIcon::updateIcon(), QQuickTextPrivate::updateLayout(), QQuickTextEdit::updatePaintNode(), QLibraryPrivate::updatePluginState(), QGeoRouteParserOsrmV5ExtensionMapbox::updateQuery(), QSqlTableModel::updateRowInTable(), QQuickListViewPrivate::updateSectionCriteria(), QGeoRouteParserOsrmV5ExtensionMapbox::updateSegment(), QQuickFileDialogImplPrivate::updateSelectedFile(), QQuickFolderDialogImplPrivate::updateSelectedFolder(), QQuickTextPrivate::updateSize(), QFontDialogPrivate::updateSizes(), QQuickImageSelector::updateSource(), QQuick3DModel::updateSpatialNode(), QQuickListViewPrivate::updateStickySections(), QFontDialogPrivate::updateStyles(), QVideoWindowPrivate::updateSubtitle(), QIconLoader::updateSystemTheme(), QMdiSubWindowPrivate::updateWindowTitle(), QWindowsShellItem::url(), QQmlFile::url(), QmlLsp::QQmlCodeModel::url2Path(), QQmlDataBlob::urlString(), QQmlFile::urlToLocalFileOrQrc(), QFileDialogPrivate::userSelectedFiles(), QSpinBoxValidator::validate(), QDateTimeEditPrivate::validateAndInterpret(), QSpinBoxPrivate::validateAndInterpret(), QDoubleSpinBoxPrivate::validateAndInterpret(), VDMAbstractItemModelDataType::value(), VDMListDelegateDataType::value(), QWinRegistryKey::value(), QSSGQmlUtilities::valueToQml(), vcRedistDir(), QTlsPrivate::X509CertificateOpenSSL::verify(), QQmlListModelParser::verifyBindings(), QHeaderView::viewportEvent(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QV4::Compiler::ScanFunctions::visit(), QV4::Compiler::ScanFunctions::visit(), QV4::Compiler::ScanFunctions::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQuickStackViewPrivate::warn(), QFontDatabase::weight(), QSqlQueryModelSql::where(), winIso639LangName(), QQmlJS::Dom::ErrorMessage::withItem(), QImageWriter::write(), QSvgIconEngine::write(), QQmlJS::Dom::FileWriter::write(), QQmlJS::Dom::LineWriter::write(), QmlTypeRegistrar::write(), DomUI::write(), DomIncludes::write(), DomInclude::write(), DomResources::write(), DomResource::write(), DomActionGroup::write(), DomAction::write(), DomActionRef::write(), DomButtonGroup::write(), DomButtonGroups::write(), DomCustomWidgets::write(), DomHeader::write(), DomCustomWidget::write(), DomLayoutDefault::write(), DomLayoutFunction::write(), DomTabStops::write(), DomLayout::write(), DomLayoutItem::write(), DomRow::write(), DomColumn::write(), DomItem::write(), DomWidget::write(), DomSpacer::write(), DomColor::write(), DomGradientStop::write(), DomGradient::write(), DomBrush::write(), DomColorRole::write(), DomColorGroup::write(), DomPalette::write(), DomFont::write(), DomPoint::write(), DomRect::write(), DomLocale::write(), DomSizePolicy::write(), DomSize::write(), DomDate::write(), DomTime::write(), DomDateTime::write(), DomStringList::write(), DomResourcePixmap::write(), DomResourceIcon::write(), DomString::write(), DomPointF::write(), DomRectF::write(), DomSizeF::write(), DomChar::write(), DomUrl::write(), DomProperty::write(), DomConnections::write(), DomConnection::write(), DomConnectionHints::write(), DomConnectionHint::write(), DomDesignerData::write(), DomSlots::write(), DomPropertySpecifications::write(), DomPropertyToolTip::write(), DomStringPropertySpecification::write(), QTextMarkdownWriter::writeBlock(), QCacheUtils::writeCachedMesh(), QDtlsPrivateOpenSSL::writeDatagramEncrypted(), QColorOutput::writePrefixedMessage(), QSSGQmlUtilities::writeQml(), QSystemLocalePrivate::zeroDigit(), and QLocaleData::zeroUcs().
bool QString::isLower | ( | ) | const |
Returns true
if the string is lowercase, that is, it's identical to its toLower() folding.
Note that this does not mean that the string does not contain uppercase letters (some uppercase letters do not have a lowercase folding; they are left unchanged by toLower()). For more information, refer to the Unicode standard, section 3.13.
Definition at line 5429 of file qstring.cpp.
References it, QUnicodeTables::LowerCase, and QUnicodeTables::qGetProp().
|
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 898 of file qstring.h.
References d.
Referenced by QAnyStringView::QAnyStringView(), QAnyStringView::QAnyStringView(), QCocoaIntegration::QCocoaIntegration(), QDomAttrPrivate::QDomAttrPrivate(), QDomElementPrivate::QDomElementPrivate(), QString(), QTextLayout::QTextLayout(), append(), appendToUser(), bluetoothdVersion(), QWizard::buttonText(), QNetworkAccessAuthenticationManager::cacheProxyCredentials(), PolishLoopDetector::check(), QDBusPendingCallPrivate::checkReceivedSignature(), clear(), QDomImplementation::createDocumentType(), QDomNodeListPrivate::createList(), QQmlDelegateChooser::delegate(), deployQtFrameworks(), QTranslatorPrivate::do_translate(), QQmlScriptBlob::done(), QQC2_NAMESPACE::QMacStyle::drawControl(), QQC2::QCommonStyle::drawControl(), QCommonStyle::drawControl(), QGeoTiledMapNokia::evaluateCopyrights(), QDrag::exec(), QQmlJS::Dom::DomUniverse::execQueue(), QAndroidMetaData::extractMetadata(), find_translation(), getLocaleValue(), QAndroidPlatformIntegration::initialize(), QWasmIntegration::initialize(), QWindowsIntegration::initialize(), QXcbIntegration::initialize(), QtQuickControls2NativeStylePlugin::initializeEngine(), QWidgetTextControl::insertFromMimeData(), QQuickTextControl::insertFromMimeData(), QComboBox::insertItem(), QNetworkAuthenticationCredential::isNull(), QSSGRenderPath::isNull(), Widget::isNullFunction(), QQmlJS::Dom::ExternalOwningItem::iterateDirectSubpaths(), QTranslator::load(), macZeroDigit(), QV4::StringPrototype::method_lastIndexOf(), QV4::QQmlXMLHttpRequestCtor::method_open(), QXcbMime::mimeConvertToFormat(), QNativeSocketEnginePrivate::nativeSendDatagram(), Widget::nullVsEmpty(), QQmlSA::DebugPropertyPass::onBinding(), QMYSQLDriver::open(), QDirSortItemComparator::operator()(), operator<<(), QMdiSubWindowPrivate::originalWindowTitle(), QTextHtmlParser::parseEntity(), QQuickStyledTextPrivate::parseEntity(), QCoreTextFontDatabase::populateFamilyAliases(), QDBusConnectionPrivate::prepareHook(), QInputDevice::primaryKeyboard(), QPointingDevice::primaryPointingDevice(), qt_aqua_get_known_size(), qt_convert_to_utf8(), readRegularEmptyFile_snippet(), QPMCache::releaseKey(), QDomDocumentTypePrivate::save(), QDomAttrPrivate::save(), QDomElementPrivate::save(), QDomNotationPrivate::save(), QDomEntityPrivate::save(), QFileSelector::select(), QFileDialog::selectedMimeTypeFilter(), QDomElementPrivate::setAttributeNodeNS(), QUrl::setAuthority(), QProgressDialogPrivate::setCancelButtonText(), QUrl::setFragment(), QUrl::setHost(), QUrl::setPassword(), QUrl::setUserInfo(), QUrl::setUserName(), QWidget::setWindowTitle(), stderr_message_handler(), QWidgetLineControl::surroundingText(), QLocale::toCurrencyString(), QLocale::toCurrencyString(), QLocale::toCurrencyString(), QQmlJS::Dom::updateEntry(), QQuickImageSelector::updateSource(), and QV4::Compiler::Codegen::visit().
bool QString::isRightToLeft | ( | ) | const |
Returns true
if the string is read right to left.
Definition at line 9068 of file qstring.cpp.
References QtPrivate::isRightToLeft(), and QStringView.
Referenced by QTextEngine::isRightToLeft(), QQuickTextEdit::isRightToLeft(), QQuickTextInput::isRightToLeft(), QWidgetLineControl::layoutDirection(), and QLabelPrivate::textDirection().
|
inline |
bool QString::isSimpleText | ( | ) | const |
Definition at line 9046 of file qstring.cpp.
References QArrayDataPointer< T >::data(), and QArrayDataPointer< T >::size.
bool QString::isUpper | ( | ) | const |
Returns true
if the string is uppercase, that is, it's identical to its toUpper() folding.
Note that this does not mean that the string does not contain lowercase letters (some lowercase letters do not have a uppercase folding; they are left unchanged by toUpper()). For more information, refer to the Unicode standard, section 3.13.
Definition at line 5403 of file qstring.cpp.
References it, QUnicodeTables::qGetProp(), and QUnicodeTables::UpperCase.
Referenced by QSSGQmlUtilities::sanitizeQmlId().
|
inlinenoexcept |
Returns true
if the string contains valid UTF-16 encoded data, or false
otherwise.
Note that this function does not perform any special validation of the data; it merely checks if it can be successfully decoded from UTF-16. The data is assumed to be in host byte order; the presence of a BOM is meaningless.
Definition at line 903 of file qstring.h.
References QStringView::isValidUtf16().
Returns the string that contains the last n characters of this string.
Definition at line 339 of file qstring.h.
References Q_ASSERT.
Referenced by QQmlDelayedCallQueue::addUniquelyAndExecuteLater(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), erase(), and Widget::lastFunction().
qsizetype QString::lastIndexOf | ( | const QString & | str, |
qsizetype | from, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
{qstring-last-index-of} {string} {str}
negative-index-start-search-from-end
Returns -1 if str is not found.
{search-comparison-case-sensitivity} {search}
Example:
{-1} is normally thought of as searching from the end of the string: the match at the end is after the last character, so it is excluded. To include such a final empty match, either give a positive value for from or omit the from parameter entirely.Definition at line 4447 of file qstring.cpp.
References QtPrivate::lastIndexOf(), QStringView, and str.
|
inline |
Definition at line 285 of file qstring.h.
References lastIndexOf().
qsizetype QString::lastIndexOf | ( | QChar | c, |
qsizetype | from, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 4522 of file qstring.cpp.
References ch, and QStringView.
|
inlinenoexcept |
Definition at line 279 of file qstring.h.
References lastIndexOf().
Referenced by IssueLocationWithContext::IssueLocationWithContext(), QFileDialogPrivate::_q_updateOkButton(), QFileDialogPrivate::addDefaultSuffixToUrls(), QQmlImports::addFileImport(), QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), QFileDialogPrivate::basename(), QGnomeThemePrivate::configureFonts(), QQmlTranslation::contextFromQmlFilename(), createDirectoryWithParents(), createImageNode(), QKeySequencePrivate::decodeString(), QXcbScreen::defaultName(), QQmlTypeData::done(), QZipReader::extractAll(), QFileInfoGatherer::fetchExtendedInformation(), QUrl::fileName(), AndroidAbstractFileEngine::fileName(), QResourceFileEngine::fileName(), QQmlPreviewFileEngine::fileName(), findInBlock(), QQuickFolderBreadcrumbBarPrivate::folderBaseName(), QSslCertificate::fromPath(), QXcbScreen::getName(), QmlImportScanResult::Module::installPath(), QSslSocketPrivate::isMatchingHostname(), keyName(), keyPath(), Widget::lastIndexOfFunction(), lineBreak(), QSSGBufferManager::loadMeshData(), QQmlImportDatabase::locateLocalQmldir(), QNetworkCookie::normalize(), AndroidContentFileEngine::open(), parseCategory(), QLocalSocketPrivate::parseSockaddr(), pdbFileName(), processUrlForClassName(), qGetTableInfo(), QQml_isFileCaseCorrect(), qt_findAtNxFile(), qt_font_from_string(), qt_punycodeDecoder(), qtModule(), QPSQLDriver::record(), QFileSystemEngine::removeDirectory(), QQuickImageBase::resolve2xLocalFile(), runMoc(), QUrlPrivate::setAuthority(), QQuickTextInput::setInputMask(), QWindowsNativeFileDialogBase::setNameFilters(), QFileInfoGatherer::updateFile(), QQmlTypeLoader::Blob::updateQmldir(), versionUriList(), and QV4::UrlCtor::virtualCallAsConstructor().
qsizetype QString::lastIndexOf | ( | QLatin1StringView | s, |
qsizetype | from, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 4495 of file qstring.cpp.
References QtPrivate::lastIndexOf(), and str.
|
inline |
Definition at line 282 of file qstring.h.
References lastIndexOf().
|
inlinenoexcept |
Definition at line 291 of file qstring.h.
References QtPrivate::lastIndexOf().
|
inlinenoexcept |
Definition at line 289 of file qstring.h.
References lastIndexOf().
Returns a substring that contains the n leftmost characters of the string.
If you know that n cannot be out of bounds, use first() instead in new code, because it is faster.
The entire string is returned if n is greater than or equal to size(), or less than zero.
Definition at line 5161 of file qstring.cpp.
References QString(), and QArrayDataPointer< T >::data().
Referenced by QIconTheme::QIconTheme(), QQuickGridScaledImage::QQuickGridScaledImage(), QV4::SparseArray::~SparseArray(), _q_resolveEntryAndCreateLegacyEngine_recursive(), QDir::absoluteFilePath(), QZipWriterPrivate::addEntry(), QQmlImports::addFileImport(), QToolBarAreaLayout::apply(), QQmlJSLinter::applyFixes(), byteArrayFromBuffer(), QMimeType::comment(), computeElidedText(), QGnomeThemePrivate::configureFonts(), QQmlNotifierEndpoint::connect(), createDirectoryWithParents(), QMimerSQLResult::data(), QtPrivate::QCalendarModel::dayName(), QQuickScriptActionPrivate::debugAction(), QQmlTypeData::done(), QQC2_NAMESPACE::QMacStyle::drawControl(), QQC2::QWindowsStyle::drawControl(), QMacStyle::drawControl(), QQuickVisualTestUtils::dumpTree(), QQmlCustomParser::evaluateEnum(), QZipReader::extractAll(), extractName(), extractName(), AndroidAbstractFileEngine::fileName(), QResourceFileEngine::fileName(), QQmlPreviewFileEngine::fileName(), QQmlJSScope::findType(), language::formatConnection(), QSslCertificate::fromPath(), QUrl::fromUserInput(), QAndroidInputContext::getCursorCapsMode(), QV4::RegExp::getSubstitution(), QAndroidInputContext::getTextBeforeCursor(), QWaylandInputMethodEventBuilder::indexFromWayland(), QSqlRecord::indexOf(), QPlaceManagerEngineNokiaV2::initializeCategories(), QWaylandTextInputV4Private::inputMethodQuery(), QQuickTextInput::insert(), Utils::TextCursor::insertText(), QmlImportScanResult::Module::installPath(), QSslSocketPrivate::isMatchingHostname(), QToolBarAreaLayoutInfo::itemRect(), keyPath(), QSSGBufferManager::loadMeshData(), QQmlImportDatabase::locateLocalQmldir(), QFileDialogPrivate::maxNameLength(), QV4::RegExpPrototype::method_get_leftContext(), QV4::StringPrototype::method_split(), QV4::JsonObject::method_stringify(), QNetworkCookie::normalize(), QDB2Driver::open(), QQuickFolderListModel::parentFolder(), QV4::Script::parse(), parseFontName(), parseHtmlMetaForEncoding(), Parser::parseParamReplace(), parseVersion(), QFileSystemEntry::path(), preprocessMetadata(), Q_TRACE_INSTRUMENT(), qGetTableInfo(), qSplitTableAndOwner(), qSplitTableName(), qt_getImageTextFromDescription(), qt_split_namespace(), readDependenciesFromElf(), readGradleProperties(), QFileSystemEngine::removeDirectory(), DocumentFile::rename(), PropertyChangesValidatorPass::run(), runMoc(), QODBCDriverPrivate::setConnectionOptions(), QUrlPrivate::setScheme(), QUndoCommand::setText(), QtWaylandClient::QWaylandWindow::setWindowTitle(), QWidgetLineControl::textBeforeSelection(), QQuickTextInputPrivate::textBeforeSelection(), QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(), QAuthenticatorPrivate::updateCredentials(), QQmlTypeLoader::Blob::updateQmldir(), QMacMimeUnicodeText::utiForMime(), QDateTimeEditPrivate::validateAndInterpret(), QQmlDelegateModelPrivate::variantValue(), and TestHTTPServer::wait().
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 6764 of file qstring.cpp.
References QArrayDataPointer< T >::data(), fill(), and truncate().
Referenced by Widget::leftJustifiedFunction(), qFillBufferWithString(), Widget::resizeFunction(), vasprintf(), and wrapText().
|
inline |
Returns the number of characters in this string.
Equivalent to size().
Definition at line 187 of file qstring.h.
References d.
Referenced by QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QOCIDateTime::QOCIDateTime(), QWasmLocalStorageSettingsPrivate::QWasmLocalStorageSettingsPrivate(), QWinSettingsPrivate::QWinSettingsPrivate(), QtAndroidMenu::addAllMenuItemsToMenu(), addNextCluster(), QQuick3DParticleRepeller::affectParticle(), QFileSystemEntry::baseName(), bezierAtT(), QWaylandInputMethodEventBuilder::buildPreedit(), QQnxInputContext::checkSpelling(), QWasmLocalStorageSettingsPrivate::children(), combinePath(), QFileSystemEntry::completeBaseName(), QWindowsMimeText::convertFromMime(), QWindowsMimeURI::convertFromMime(), QBuiltInMimes::convertFromMime(), QWindowsMimeURI::convertToMime(), QWindowsFontDatabase::createEngine(), createFontFile(), QTextLayout::createLine(), QTextLine::cursorToX(), QAndroidInputContext::deleteSurroundingText(), deployQtFrameworks(), QTlsPrivate::TlsKeyGeneric::derFromPem(), QMacStyle::drawControl(), QPainter::drawText(), QQmlJS::Dom::AttachedInfo::ensure(), escapedKey(), QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(), QDB2Result::exec(), QODBCResult::exec(), QOCICols::execBatch(), QFileSystemEntry::fileName(), QFileSystemModelPrivate::filePath(), QQmlJS::Dom::AttachedInfo::find(), QQmlJSScope::findType(), QWindowsDirect2DPaintEnginePrivate::fontFaceFromFontEngine(), getContextCapabilities(), QAndroidInputContext::getCursorCapsMode(), QAndroidInputContext::getExtractedText(), getExtractedText(), KeyboardModifier::getForEvent< EmscriptenKeyboardEvent >(), getSelectedText(), getTextAfterCursor(), QAndroidInputContext::getTextBeforeCursor(), getTextBeforeCursor(), QTextLine::glyphRuns(), isBlockHeaderValid(), QAndroidInputContext::isComposing(), QQmlFile::isLocalFile(), isSpecialKey(), QQmlFile::isSynchronous(), QQmlJS::Dom::FileLocations::iterateDirectSubpaths(), QTextEngine::justify(), QTextEngine::leadingSpaceWidth(), QTextEngine::lineNumberForTextPosition(), QGeoFileTileCache::loadTiles(), QMacMimeAny::mimeForUti(), nextBezier(), QtAndroidMenu::onCreateContextMenu(), QtAndroidMenu::onPrepareOptionsMenu(), QDB2Driver::open(), QOCIDriver::open(), Parser::parse(), Parser::parseMetadata(), parseOtoolLibraryLine(), QFileSystemEntry::path(), QPainterPath::percentAtLength(), preprocessMetadata(), QDB2Driver::primaryIndex(), QMimerSQLDriver::primaryIndex(), QQmlDocumentFormatting::process(), qFillBufferWithString(), QQml_isFileCaseCorrect(), qSplitTableAndOwner(), qt_mac_removeMnemonics(), QQC2_NAMESPACE::qt_mac_removeMnemonics(), qt_radial_gradient_adapt_focal_point(), QAndroidSystemLocale::query(), QRasterPaintEnginePrivate::rasterizeLine_dashed(), QPinchGestureRecognizer::recognize(), QWindowsInputContext::reconvertString(), QDB2Driver::record(), QMimerSQLDriver::record(), PropertyChangesValidatorPass::run(), QSSGQmlUtilities::sanitizeQmlId(), QWaylandTextInputV4Private::sendInputMethodEvent(), QAndroidInputContext::setComposingRegion(), QAndroidInputContext::setComposingText(), QTextLine::setLineWidth(), QTextLine::setNumColumns(), QTextLine::setNumColumns(), QAndroidInputContext::setSelection(), QTextEngine::shapeLine(), QWindowsDirect2DPaintEnginePrivate::stroke(), QRasterPaintEngine::stroke(), QDB2Driver::tables(), QMimerSQLDriver::tables(), QUrlPrivate::toLocalFile(), toSpannableString(), AppendText::undo(), QAndroidInputContext::updateCursorPosition(), QWinRegistryKey::value(), and src_gui_text_qsyntaxhighlighter::MyHighlighter::wrapper().
int QString::localeAwareCompare | ( | const QString & | s | ) | const |
Definition at line 6649 of file qstring.cpp.
References constData(), and other().
Referenced by QStringView::localeAwareCompare(), QV4::StringPrototype::method_localeCompare(), and QQmlLocale::method_localeCompare().
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.
Definition at line 651 of file qstring.h.
References s2.
|
inline |
Definition at line 1365 of file qstring.h.
References constData(), and size().
|
inlinestatic |
Returns a string that contains n characters of this string, starting at the specified position index.
If you know that position and n cannot be out of bounds, use sliced() instead in new code, because it is faster.
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.
Definition at line 5204 of file qstring.cpp.
References QString(), constData(), QArrayDataPointer< char16_t >::fromRawData(), and position().
Referenced by QQmlJS::Dom::IndentInfo::IndentInfo(), IssueLocationWithContext::IssueLocationWithContext(), QMacSettingsPrivate::QMacSettingsPrivate(), QQuickGridScaledImage::QQuickGridScaledImage(), QTextHtmlImporter::QTextHtmlImporter(), QWinSettingsPrivate::QWinSettingsPrivate(), QGeoFileTileCache::~QGeoFileTileCache(), QFileDialogPrivate::_q_updateOkButton(), absoluteFilePath(), QFileDialogPrivate::addDefaultSuffixToUrls(), QFileSystemWatcher::addPaths(), QQmlJSLinter::applyFixes(), QV4::PropertyKey::asFunctionName(), QFileSystemEntry::baseName(), QmlIR::Object::bindingAsString(), QCommonStylePrivate::calculateElidedText(), QQC2::QCommonStylePrivate::calculateElidedText(), QV4::Compiler::ScanFunctions::checkDirectivePrologue(), QMacSettingsPrivate::children(), cleanPackageName(), QQmlJS::Dom::AstComments::collectComments(), comify(), QQmlJS::Dom::LineWriter::commitLine(), QFileSystemEntry::completeBaseName(), QFileSystemEntry::completeSuffix(), QGnomeThemePrivate::configureFonts(), QQmlTranslation::contextFromQmlFilename(), QNetworkCookieJar::cookiesForUrl(), copyQtFiles(), QV4::FunctionObject::createBuiltinFunction(), QIBusPlatformInputContextPrivate::createConnection(), createImageNode(), decodeFsEncString(), QKeySequencePrivate::decodeString(), deployQmlImports(), deployTranslations(), QV4::Symbol::descriptiveString(), doFilter(), QQmlTypeData::done(), QQC2_NAMESPACE::QMacStyle::drawControl(), QQC2::QWindowsStyle::drawControl(), QMacStyle::drawControl(), QItemDelegate::drawDisplay(), QQmlJS::Dom::Token::dump(), src_gui_text_qtextlayout::Wrapper::elided(), QFontMetrics::elidedText(), QFontMetricsF::elidedText(), QQuickTextPrivate::elidedText(), QTextEngine::elidedText(), QResourcePrivate::ensureChildren(), QQmlCustomParser::evaluateEnum(), extractExtension(), extractExtension(), fileArchitecture(), QFileSystemEntry::fileName(), QUrl::fileName(), AndroidAbstractFileEngine::fileName(), QQmlPreviewFileEngine::fileName(), QFileSystemModelPrivate::filePath(), filterSpecs(), findChildObject(), Parser::findEnumValues(), findFilesRecursively(), QResourceRoot::findNode(), findObject(), QQmlJSScope::findType(), QQuickFolderBreadcrumbBarPrivate::folderBaseName(), QUrl::fromLocalFile(), QQmlJSCodeGenerator::generate_SetLookup(), getBinaryDependencies(), getBinaryRPaths(), QSSGShaderKeyPropertyBase::getBoolValue(), QV4::getElementIntFallback(), getLibInfix(), getLibraryProjectsInOutputFolder(), getQtLibsFromElf(), QSSGRenderShaderMetadata::getShaderMetaData(), QSSGInputUtil::getStreamForFile(), QV4::RegExp::getSubstitution(), QAndroidInputContext::getTextAfterCursor(), QQmlJS::Dom::LineWriter::handleTrailingSpace(), hasValidSignal(), QtPrivate::QCalendarDateSectionValidator::highlightString(), imageId(), QWaylandInputMethodEventBuilder::indexFromWayland(), QSqlRecord::indexOf(), QWaylandInputMethodEventBuilder::indexToWayland(), QPlaceManagerEngineNokiaV2::initializeCategories(), QQmlPropertyPrivate::initProperty(), QWidgetTextControl::inputMethodQuery(), QWaylandTextInputV4Private::inputMethodQuery(), Utils::TextCursor::insertText(), QToolBarAreaLayoutInfo::insertToolBarBreak(), QSslSocketPrivate::isMatchingHostname(), QQuickTextInput::isRightToLeft(), keyName(), SourceResolver::load(), QHostInfo::localDomainName(), QtWaylandClient::mapSurroundingTextToCompositor(), QPdfDocument::metaData(), QV4::RegExpPrototype::method_get_rightContext(), QV4::StringPrototype::method_split(), QQmlJS::Engine::midRef(), Qt::mightBeRichText(), QMacMimeAny::mimeForUti(), moduleNameToOptionName(), QTextDocumentPrivate::move(), nearestWordWrapIndex(), nextField(), QDB2Driver::open(), AndroidContentFileEngine::open(), QQmlDirParser::parse(), QTestPrivate::parseBlackList(), parseCategory(), QSvgHandler::parseCSStoXMLAttrs(), parseFont(), parseFontName(), QMapboxCommon::parseGeoLocation(), parseHtmlMetaForEncoding(), Parser::parseInstrument(), Parser::parseMetadata(), parseOtoolLibraryLine(), Parser::parseParamReplace(), Parser::parsePoint(), Parser::parsePrefix(), QLocalSocketPrivate::parseSockaddr(), QHostAddress::parseSubnet(), parseVersion(), QQmlJSScope::prettyName(), Q_TRACE_INSTRUMENT(), qGetTableInfo(), qQmlJSGenerateLoader(), qRegisterNotificationCallbacks(), qSplitTableName(), qt_font_from_string(), qt_punycodeDecoder(), qt_resource_fixResourceRoot(), qt_split_namespace(), QAndroidSystemLocale::query(), readDependenciesFromElf(), readGradleProperties(), QPSQLDriver::record(), DocumentFile::rename(), QOffscreenIntegration::resolveConfigFileConfiguration(), runMoc(), QDomEntityPrivate::save(), QWidgetLineControl::selectedText(), Utils::TextCursor::selectedText(), QQuickTextInputPrivate::selectedText(), QAndroidInputContext::setComposingRegion(), QODBCDriverPrivate::setConnectionOptions(), AndroidMediaMetadataRetriever::setDataSource(), QQmlJS::Dom::LineWriter::setLineIndent(), QMessagePattern::setPattern(), QV4::UrlObject::setSearch(), QUndoCommand::setText(), TileProvider::setupProvider(), QQuickTextPrivate::setupTextLayout(), QNdefNfcUriRecord::setUri(), QQmlPropertyResolver::signal(), QQmlSA::GenericPass::sourceCode(), splitIntoFamilies(), QCompleter::splitPath(), QQmlScriptString::stringLiteral(), QSqlDriver::stripDelimiters(), QAbstractSpinBoxPrivate::stripped(), stripQuotes(), QDomCharacterDataPrivate::substringData(), QFileSystemEntry::suffix(), QMimeType::suffixes(), Utils::TextBlock::text(), QLineEditPrivate::textAfterCursor(), QWidgetLineControl::textAfterSelection(), QQuickTextInputPrivate::textAfterSelection(), QLineEditPrivate::textBeforeCursor(), QNetworkCookie::toRawForm(), QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(), QAuthenticatorPrivate::updateCredentials(), QFileInfoGatherer::updateFile(), QQuickTextPrivate::updateLayout(), updateLibsXml(), QQuickFileDialogImplPrivate::updateSelectedFile(), QQuickFolderDialogImplPrivate::updateSelectedFolder(), QtWaylandClient::QWaylandTextInputv1::updateState(), QtWaylandClient::QWaylandTextInputv2::updateState(), QtWaylandClient::QWaylandTextInputv4::updateState(), QNetworkCookieJar::validateCookie(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QV4::Compiler::ScanFunctions::visit(), QQmlJSImportVisitor::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::Rewriter::visit(), wrapText(), writeAttribute(), QTextMarkdownWriter::writeBlock(), and QTextOdfWriter::writeBlock().
QString QString::normalized | ( | QString::NormalizationForm | mode, |
QChar::UnicodeVersion | version = QChar::Unicode_Unassigned |
||
) | const |
Returns the string in the given Unicode normalization mode, according to the given version of the Unicode standard.
Definition at line 8212 of file qstring.cpp.
References copy(), and qt_string_normalize().
Referenced by _hb_qt_unicode_compose(), _hb_qt_unicode_decompose(), QFseventsFileSystemWatcherEngine::addPaths(), QMacMimeFileUri::convertFromMime(), QMacMimeUrl::convertFromMime(), QMacMimeFileUri::convertToMime(), QMacMimeUrl::convertToMime(), QCocoaFileDialogHelper::directory(), QV4::StringPrototype::method_normalize(), qEnvironmentVariable(), and sortParticles().
Returns a string representing the floating-point number n.
Returns a string that represents n, formatted according to the specified format and precision.
For formats with an exponent, the exponent will show its sign and have at least two digits, left-padding the exponent with zero if needed.
Definition at line 7880 of file qstring.cpp.
References QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocaleData::DFSignificantDigits, form, QtMiscUtils::isAsciiUpper(), qdtoBasicLatin(), qWarning, and QtMiscUtils::toAsciiLower().
|
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 7822 of file qstring.cpp.
Referenced by QCtfLibImpl::QCtfLibImpl(), QGeoFileTileCacheNokia::QGeoFileTileCacheNokia(), QGeoTiledMapPrivate::QGeoTiledMapPrivate(), QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext(), ShmServerBuffer::ShmServerBuffer(), QDB2Result::~QDB2Result(), QGeoFileTileCache::~QGeoFileTileCache(), QODBCResult::~QODBCResult(), QFileDialogPrivate::_q_createDirectory(), QFontDatabasePrivate::addAppFont(), addAtForBoundingArea(), QUrlPrivate::appendAuthority(), Widget::argFunction(), QV4::PropertyKey::asFunctionName(), MainWindow::averageItems(), QV4::CompiledData::CompilationUnit::bindingValueAsString(), boundingBoxToLtrb(), boundingBoxToLtrb(), QSSGQmlUtilities::builtinQmlType(), GeoRoutingManagerEngineEsri::calculateRoute(), QV4::CallMethod(), QV4::CallPrecise(), QTextMarkdownImporter::cbText(), checkArgumentsObjectUseInSignalHandlers(), QOpenVGContext::checkErrors(), WorkspaceHandlers::clientInitialized(), QCupsPrintEnginePrivate::closePrintDevice(), Collector::collect(), colorValue(), QQuickStateGroup::componentComplete(), QBluetoothSocketPrivateWinRT::connectToServiceHelper(), QV4::ExecutionEngine::consoleCountHelper(), QQmlJSCodeGenerator::convertContained(), QKmsDevice::createScreenForConnector(), QMimerSQLResult::data(), QQmlBindPrivate::decodeBinding(), QXcbScreen::defaultName(), QCapturableWindow::description(), diagnosticErrorMessage(), dirIconPixmapCacheKey(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QmlLsp::OpenDocumentSnapshot::dump(), QQmlJS::Dom::Token::dump(), QV4::Moth::dumpArguments(), QQuickLayout::dumpLayoutTreeRecursive(), encodeText(), QQuickItemGrabResultPrivate::ensureImageInCache(), QUrl::errorString(), QQmlComponent::errorString(), QJSEngine::evaluate(), QIBaseResult::exec(), QQmlJS::Dom::DomUniverse::execQueue(), Recognizer::expand(), QQmlJS::Dom::ModuleIndex::exportsWithNameAndMinorVersion(), QQmlBoundSignalExpression::expressionIdentifier(), QPSQLResultPrivate::fieldSerial(), QQmlJS::AST::FormalParameterList::finish(), QWindowsFontDatabase::fontEngine(), QQmlJS::AST::FormalParameterList::formals(), formatNumber(), QTest::Internal::formatTryTimeoutDebugMessage(), QDB2Driver::formatValue(), QIBaseDriver::formatValue(), QMYSQLDriver::formatValue(), QOCIDriver::formatValue(), QODBCDriver::formatValue(), QSqlDriver::formatValue(), freeDesktopTrashLocation(), QQmlJS::Dom::Path::fromString(), QQmlJSCodeGenerator::generate_CallPropertyLookup(), QQmlJSCodeGenerator::generate_CallQmlContextPropertyLookup(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), QQmlJSCodeGenerator::generate_LoadConst(), QQmlJSCodeGenerator::generate_LoadGlobalLookup(), QQmlJSCodeGenerator::generate_LoadInt(), QQmlJSCodeGenerator::generate_LoadQmlContextPropertyLookup(), QQmlJSCodeGenerator::generate_MoveConst(), QQmlJSCodeGenerator::generate_SetLookup(), QQmlJSCodeGenerator::generate_StoreNameSloppy(), QQmlJSCodeGenerator::generateEnumLookup(), QQmlJSCodeGenerator::generateSetInstructionPointer(), QGeoCodingManagerEngineMapbox::geocode(), GeoCodingManagerEngineEsri::geocode(), QGeoCodingManagerEngineMapbox::geocode(), QGeoCodingManagerEngineOsm::geocode(), QGeoCodingManagerEngineNokia::geocode(), QSSGQmlUtilities::getAnimationSourceName(), QPixmapStylePrivate::getCachedPixmap(), getExtractedText(), QQmlJSCodeGenerator::getLookupPreparation(), QXcbScreen::getName(), QPlaceManagerEngineNokiaV2::getPlaceContent(), QGeoTileFetcherMapbox::getTileImage(), QQmlJS::Dom::DomUniverse::guaranteeUniverse(), QTreeModel::headerData(), Driver::headerFileName(), ICOReader::iconAt(), importCompletions(), importImp(), QTreeModel::insertColumns(), QTextCursor::insertImage(), isAutoValue(), QIBaseDriverPrivate::isError(), QIBaseResultPrivate::isError(), QTextList::itemText(), QQmlJS::Dom::ModuleIndex::iterateDirectSubpaths(), QQmlJS::Dom::DomEnvironment::iterateDirectSubpaths(), Stringify::JA(), jsStack(), QPdfPageNavigator::jump(), QPdfPageNavigator::jump(), QXmlTestLogger::leaveTestFunction(), QGeoFileTileCache::loadTiles(), QHostInfoAgent::lookup(), main(), main(), QQmlJS::Dom::Version::majorString(), QQmlJS::Dom::Version::majorSymbolicString(), makeFpString(), makeString(), mangledIdentifier(), maxExpression(), QV4::ConsoleObject::method_count(), QQuickJSContext2D::method_get_fillStyle(), QV4::ErrorObject::method_get_stack(), QQuickJSContext2D::method_get_strokeStyle(), QV4::UrlPrototype::method_setPort(), minExpression(), QCalendarWidget::minimumSizeHint(), QQmlJS::Dom::Version::minorString(), QQmlJS::Dom::Paths::moduleIndexPath(), QWindowsScreen::name(), QQmlJS::Dom::PathEls::Index::name(), QColor::name(), QDateTimeParser::SectionNode::name(), QNativeSocketEnginePrivate::nativeReceiveDatagram(), Recognizer::nextToken(), Widget::numberFunction(), QV4::RuntimeHelpers::numberToString(), object_name_for_button(), QV4::QObjectWrapper::objectToString(), QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), QDB2Driver::open(), QPSQLDriver::open(), QQmlJSTypeDescriptionReader::operator()(), QGeoJson::operator<<(), QGeoJson::operator<<(), QPdfDocument::pageLabel(), QQuickUniversalFocusRectangle::paint(), QStaticTextPrivate::paintText(), QEdidParser::parse(), QQuickStyledTextPrivate::parseTag(), QQmlJS::Dom::ModuleScope::pathFromOwner(), pixelToPoint(), QAbstractFileIconEngine::pixmap(), QSvgIconEnginePrivate::pmcKey(), QQuickMonthModelPrivate::populate(), QXcbUnixServices::portalWindowIdentifier(), QNetworkDiskCachePrivate::prepareLayout(), QV4::Function::prettyName(), QDB2Driver::primaryIndex(), QODBCDriver::primaryIndex(), printPage(), processNode(), QQmlMetaTypeData::propertyCache(), qDB2Warn(), qDB2Warn(), qdbus_loadLibDBus(), qDBusNewConnection(), QSvgPaintEngine::qfontToSvg(), qMakeError(), qMakeError(), qMakeError(), qMakeError(), qMakeFieldInfo(), qMakePreparedStmtId(), qMakeStmtError(), QQmlJS::Dom::ModuleIndex::qmldirsToLoad(), QSvgPaintEngine::qpenToSvg(), qt_socket_getPortAndAddress(), queryQtPaths(), qWarnODBCHandle(), QColorDialogStaticData::readSettings(), QDB2Driver::record(), QODBCDriver::record(), QSqlRelationalTableModelSql::relTablePrefix(), QGeoRouteParserOsrmV5Private::requestUrl(), QGeoRouteParserOsrmV4Private::requestUrl(), QV4::IdentifierTable::resolveId(), GeoCodingManagerEngineEsri::reverseGeocode(), QGeoCodingManagerEngineMapbox::reverseGeocode(), QGeoCodingManagerEngineOsm::reverseGeocode(), QDoubleSpinBoxPrivate::round(), ValueLookupJob::run(), QQmlSA::DebugElementPass::run(), QQmlJSCodeGenerator::run(), QV4::MemoryManager::runGC(), runningUnderDebugger(), runQmlImportScanner(), QSSGBufferManager::runtimeMeshSourceName(), QPlaceManagerEngineNokiaV2::search(), PlaceManagerEngineEsri::search(), QPlaceManagerEngineOsm::search(), QtWaylandClient::QWaylandInputDevice::seatName(), QQuickFontDialogImplAttached::selectFontInListViews(), QSqlRelationalTableModel::selectStatement(), QWindowsIntegration::setApplicationBadge(), QNetworkDiskCache::setCacheDirectory(), QTreeModel::setColumnCount(), QLibrary::setFileNameAndVersion(), QSGDistanceFieldGlyphNode::setGlyphs(), QV4::UrlObject::setHost(), QV4::Object::setIndexed(), QCUPSSupport::setJobPriority(), QQmlJSCodeGenerator::setLookupPreparation(), QUrl::setPort(), QV4::UrlObject::setPort(), QV4::UrlObject::setUrl(), sinkInfoCallback(), QIBaseResult::size(), sm_performSaveYourself(), QQmlJSUtils::sourceDirectoryPath(), sourceInfoCallback(), sql_intro_snippets(), QQC2::QCommonStyle::standardIcon(), QCommonStyle::standardIcon(), QDateTimeParser::stateName(), QXmlTestLogger::stopLogging(), QQmlJS::Dom::Version::stringValue(), MainWindow::sumItems(), QDB2Driver::tables(), QODBCDriver::tables(), QtPrivate::QCalendarDayValidator::text(), QtPrivate::QCalendarMonthValidator::text(), QtPrivate::QCalendarYearValidator::text(), QSpinBox::textFromValue(), QtAndroidAccessibility::textFromValue(), TileProvider::tileAddress(), QGeoFileTileCacheMapbox::tileSpecToFilename(), QGeoFileTileCacheNokia::tileSpecToFilename(), QGeoFileTileCacheOsm::tileSpecToFilename(), QGeoFileTileCache::tileSpecToFilenameDefault(), QSchannelBackend::tlsLibraryBuildVersionString(), QSchannelBackend::tlsLibraryVersionString(), QQmlDebugTranslation::TranslationIssue::toDebugString(), QTextHtmlExporter::toHtml(), toMetadata(), toNumericString(), QV4::PropertyKey::toQString(), QSettingsGroup::toString(), QVersionNumber::toString(), QPageRanges::toString(), QFont::toString(), QBenchmarkContext::toString(), QJSPrimitiveValue::toString(), QQmlError::toString(), QTest::toString(), QGeoCoordinate::toString(), ToString(), toVariant(), QV4::SequencePrototype::toVariant(), translate_color(), Driver::unique(), QNetworkDiskCachePrivate::uniqueFileName(), QPdfPageNavigator::update(), QQuickMultiEffectPrivate::updateEffectShaders(), QV4::Function::updateInternalClass(), QPrintPreviewDialogPrivate::updateNavActions(), QPrintPreviewDialogPrivate::updatePageNumLabel(), QLibraryPrivate::updatePluginState(), QFontDialogPrivate::updateSizes(), CompletionRequest::urlAndPos(), QSSGQmlUtilities::variantToQml(), variantToString(), QV4::UrlSearchParamsCtor::virtualCallAsConstructor(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::AstDumper::visit(), QQmlJS::Dom::Rewriter::visit(), QQmlJS::Dom::AstDumper::visit(), qfontdatabase_snippets::wrapper(), QQmlJS::Dom::FileWriter::write(), DomUI::write(), DomCustomWidget::write(), DomLayoutDefault::write(), DomLayoutItem::write(), DomItem::write(), DomColor::write(), DomGradientStop::write(), DomGradient::write(), DomFont::write(), DomPoint::write(), DomRect::write(), DomSizePolicy::write(), DomSize::write(), DomDate::write(), DomTime::write(), DomDateTime::write(), DomPointF::write(), DomRectF::write(), DomSizeF::write(), DomChar::write(), DomProperty::write(), DomConnectionHint::write(), writeAttribute(), QTextMarkdownWriter::writeBlock(), QTextOdfWriter::writeBlock(), QTextOdfWriter::writeBlockFormat(), QTextOdfWriter::writeCharacterFormat(), writeCtfMacro(), QTextOdfWriter::writeFrame(), QTextOdfWriter::writeListFormat(), QColorDialogStaticData::writeSettings(), and QTextOdfWriter::writeTableFormat().
|
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.
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 7804 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 7838 of file qstring.cpp.
References base, qulltoBasicLatin(), and qWarning.
|
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 7857 of file qstring.cpp.
References base, qulltoBasicLatin(), and qWarning.
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 7830 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 7814 of file qstring.cpp.
|
inline |
Definition at line 1225 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1267 of file qstring.h.
References constData(), and size().
|
inline |
|
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 (\l{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 463 of file qstring.h.
References append().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1227 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1269 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1231 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1273 of file qstring.h.
References constData(), and size().
|
inline |
|
inline |
Assigns other to this string and returns a reference to this string.
Definition at line 2805 of file qstring.cpp.
Definition at line 2869 of file qstring.cpp.
References QString(), capacity(), ch, QArrayDataPointer< T >::data(), QArrayDataPointer< T >::freeSpaceAtBegin(), isDetached(), operator=(), and QArrayDataPointer< T >::size.
Referenced by append(), and operator=().
QString & QString::operator= | ( | QLatin1StringView | latin1 | ) |
Definition at line 2825 of file qstring.cpp.
References capacity(), QArrayDataPointer< T >::data(), QArrayDataPointer< T >::freeSpaceAtBegin(), fromLatin1(), isDetached(), other(), qt_from_latin1(), and QArrayDataPointer< T >::size.
|
inline |
Definition at line 1223 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1265 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1229 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1271 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1233 of file qstring.h.
References constData(), and size().
|
inline |
Definition at line 1275 of file qstring.h.
References constData(), and size().
|
inline |
|
inline |
Prepends the string str to the beginning of this string and returns a reference to this string.
This operation is typically very fast (\l{constant time}), because QString preallocates extra space at the beginning of the string data, so it can grow without reallocating the entire string each time.
Example:
Definition at line 413 of file qstring.h.
References insert().
Definition at line 411 of file qstring.h.
References insert().
Referenced by QMacSettingsPrivate::QMacSettingsPrivate(), QTextHtmlImporter::QTextHtmlImporter(), TestCaseCollector::TestCaseCollector(), QQmlInfo::~QQmlInfo(), addFontToDatabase(), annotateListElements(), QQuick3DLightmapBaker::bake(), checkSourceIsFile(), QGeoMapMapboxGL::copyrightsChanged(), QAbstractFileEngineIterator::currentFilePath(), QLocaleData::doubleToString(), QTextEngine::elidedText(), QResourcePrivate::ensureInitialized(), findDependentQtLibraries(), QQuickControlsTestUtils::forEachControl(), QUrl::fromLocalFile(), QSSGInputUtil::getStreamForFile(), Driver::headerFileName(), launchMail(), makeFpString(), Widget::modify(), moduleNameToOptionName(), QNetworkCookie::normalize(), parseCSStoXMLAttrs(), QMapboxCommon::parseGeoLocation(), parseStopNode(), Widget::prependFunction(), QV4::Function::prettyName(), QTextStreamPrivate::putNumber(), qQuote(), qRelocateResourceFile(), readGpuFeatures(), recursiveCopyAndDeploy(), QSqlRelationalTableModelSql::relTablePrefix(), QSettings::remove(), RCCFileInfo::resourceName(), runMoc(), QSSGQmlUtilities::sanitizeQmlId(), QQmlJSUtils::sourceDirectoryPath(), QIBaseDriver::tables(), QSettingsPrivate::variantToString(), QV4::UrlCtor::virtualCallAsConstructor(), QQmlJSImportVisitor::visit(), and QTextOdfWriter::writeInlineCharacter().
|
inline |
|
inline |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Appends the given ch character onto the end of this string.
Definition at line 868 of file qstring.h.
References append().
Referenced by QV4::StringPrototype::method_split(), qExtractFontFamiliesFromString(), and translationNameFilters().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Prepends the given ch character to the beginning of this string.
Definition at line 870 of file qstring.h.
References prepend().
|
inline |
Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first character in the string, in reverse order.
iterator-invalidation-func-desc
Definition at line 853 of file qstring.h.
Referenced by QAndroidInputContext::longPress().
|
inline |
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.
{search-comparison-case-sensitivity} {search}
This is the same as replace
(str, "", cs).
shrinking-erase
Definition at line 3516 of file qstring.cpp.
References QArrayDataPointer< T >::data(), QtPrivate::q_points_into_range(), qToStringViewIgnoringNull(), removeStringImpl(), size(), and str.
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.
{search-comparison-case-sensitivity} {search}
Example:
This is the same as replace
(ch, "", cs).
shrinking-erase
Definition at line 3596 of file qstring.cpp.
References begin(), QArrayDataPointer< T >::begin(), Qt::CaseSensitive, ch, copy(), QArrayDataPointer< T >::data(), QArrayDataPointer< T >::end(), QtPrivate::QGenericArrayOps< T >::erase(), indexOf(), QArrayDataPointer< T >::isShared(), it, match(), QArrayDataPointer< T >::size, and Qt::Uninitialized.
QString & QString::remove | ( | QLatin1StringView | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Removes every occurrence of the given Latin-1 string viewed by str from this string, and returns a reference to this string.
{search-comparison-case-sensitivity} {search}
This is the same as replace
(str, "", cs).
shrinking-erase
Definition at line 3541 of file qstring.cpp.
References removeStringImpl(), and str.
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.
If n is <= 0 nothing is changed.
! [shrinking-erase] Element removal will preserve the string's capacity and not reduce the amount of allocated memory. To shed extra capacity and free as much memory as possible, call squeeze() after the last change to the string's size. ! [shrinking-erase]
Definition at line 3435 of file qstring.cpp.
References begin(), QArrayDataPointer< T >::begin(), copy(), QArrayDataPointer< T >::data(), QArrayDataPointer< T >::end(), QtPrivate::QGenericArrayOps< T >::erase(), QArrayDataPointer< T >::isShared(), pos, QArrayDataPointer< T >::size, swap(), and Qt::Uninitialized.
Referenced by QWinSettingsPrivate::QWinSettingsPrivate(), QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), argumentsFromCommandLineAndFile(), QmlTypeRegistrar::argumentsFromCommandLineAndFile(), backendType(), checkSourceIsFile(), QGeoFileTileCache::clearAll(), createUseNode(), QFileSystemEngine::currentPath(), QCalendarBackend::dateTimeToString(), QKeySequencePrivate::decodeString(), detectMenuRole(), erase(), fixedCDataSection(), fixedComment(), fixedPIData(), fontKeys(), QAndroidInputContext::getTextAfterCursor(), QtAndroidDialogHelpers::htmlText(), QSQLiteResultPrivate::initColumns(), AndroidContentFileEngine::mkdir(), QCss::Parser::parseSimpleSelector(), QCss::Parser::parseTerm(), QGeoJson::printQvariant(), QSysInfo::productVersion(), qt_font_from_string(), qt_strippedText(), Driver::qtify(), qtModule(), queryQtPaths(), QDir::relativeFilePath(), Widget::removeFunction(), removeOptionalQuotes(), DocumentFile::rename(), replace(), AndroidContentFileEngine::rmdir(), QSSGQmlUtilities::sanitizeQmlId(), QFileSelector::select(), QWaylandTextInputPrivate::sendInputMethodEvent(), QFileDialogOptions::setDefaultSuffix(), QmlIR::IRBuilder::signalNameFromSignalPropertyName(), QQmlJSUtils::sourceDirectoryPath(), QSSGQmlUtilities::stripParentDirectory(), QSvgNode::styleProperty(), styleUri(), QDoubleSpinBox::textFromValue(), QSpinBox::textFromValue(), QSystemLocalePrivate::toCurrencyString(), QUrlPrivate::toLocalFile(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
Removes the character at index pos. If pos is out of bounds (i.e. pos >= size()), this function does nothing.
Definition at line 484 of file qstring.h.
Referenced by QToolBarAreaLayout::remove(), QToolBarAreaLayout::remove(), and QToolBarAreaLayoutInfo::removeToolBar().
|
inline |
|
inline |
Removes all elements for which the predicate pred returns true from the string. Returns a reference to the string.
Definition at line 490 of file qstring.h.
Referenced by QUrlQuery::removeAllQueryItems().
|
inline |
Removes the last character in this string. If the string is empty, this function does nothing.
Definition at line 487 of file qstring.h.
References remove().
Referenced by qffmpegLogCallback().
|
inline |
Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing just after the last character in the string, in reverse order.
iterator-invalidation-func-desc
Definition at line 854 of file qstring.h.
References begin().
Referenced by QAndroidInputContext::longPress().
|
inline |
Definition at line 856 of file qstring.h.
References begin().
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 8112 of file qstring.cpp.
References QString(), QArrayDataPointer< T >::data(), and QArrayDataPointer< T >::size.
QString & QString::replace | ( | const QChar * | before, |
qsizetype | blen, | ||
const QChar * | after, | ||
qsizetype | alen, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3831 of file qstring.cpp.
References Qt::CaseSensitive, matcher, replace(), replace_helper(), and QArrayDataPointer< T >::size.
QString & QString::replace | ( | const QString & | before, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3816 of file qstring.cpp.
References constData(), replace(), and size().
QString & QString::replace | ( | const QString & | before, |
QLatin1StringView | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 4011 of file qstring.cpp.
References constData(), QLatin1StringView::front(), front(), qt_from_latin1_to_qvla(), replace(), size(), QLatin1StringView::size(), and QArrayDataPointer< T >::size.
QString & QString::replace | ( | QChar | before, |
QChar | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3915 of file qstring.cpp.
References QArrayDataPointer< T >::begin(), Qt::CaseSensitive, ch, QArrayDataPointer< T >::end(), foldCase(), indexOf(), QArrayDataPointer< T >::needsDetach(), other(), QArrayDataPointer< T >::size, swap(), QChar::unicode(), and Qt::Uninitialized.
QString & QString::replace | ( | QChar | c, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3873 of file qstring.cpp.
References begin(), QArrayDataPointer< T >::begin(), Qt::CaseSensitive, ch, QArrayDataPointer< T >::data(), QArrayDataPointer< T >::end(), front(), i, QStringView, QtPrivate::qustrchr(), remove(), replace(), replace_helper(), size(), QArrayDataPointer< T >::size, QChar::toCaseFolded(), and view.
QString & QString::replace | ( | QChar | c, |
QLatin1StringView | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 4032 of file qstring.cpp.
References QLatin1StringView::front(), qt_from_latin1_to_qvla(), replace(), and QLatin1StringView::size().
QString & QString::replace | ( | QLatin1StringView | before, |
const QString & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3990 of file qstring.cpp.
References constData(), QLatin1StringView::front(), front(), qt_from_latin1_to_qvla(), replace(), size(), QLatin1StringView::size(), and QArrayDataPointer< T >::size.
QString & QString::replace | ( | QLatin1StringView | before, |
QLatin1StringView | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Definition at line 3966 of file qstring.cpp.
References QLatin1StringView::front(), qt_from_latin1_to_qvla(), replace(), and QLatin1StringView::size().
Definition at line 3775 of file qstring.cpp.
References pos, and replace_helper().
Replaces n characters beginning at index position with the string after and returns a reference to this string.
Example:
Definition at line 3763 of file qstring.cpp.
References constData(), pos, replace(), and size().
Definition at line 3794 of file qstring.cpp.
References pos, and replace().
Referenced by FolderIterator::FolderIterator(), QCtfLibImpl::QCtfLibImpl(), QWasmLocalStorageSettingsPrivate::QWasmLocalStorageSettingsPrivate(), QQmlImportDatabase::addImportPath(), backendType(), QWaylandInputMethodEventBuilder::buildCommit(), comify(), convertMnemonics(), convertPrivateClassToUsableForm(), QWindowsMimeText::convertToMime(), createSvgNode(), encodeText(), QQmlJS::Dom::LineWriter::ensureSpace(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QMimerSQLDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QOCIDriver::escapeIdentifier(), QSqlResult::exec(), existingImageFileForPath(), Recognizer::expand(), filterSpecs(), find_translation(), findInBlock(), QDir::fromNativeSeparators(), QGeoCodingManagerEngineNokia::geocode(), QNearFieldTargetPrivateImpl::getTagTechnology(), Driver::headerFileName(), helpText(), QtAndroidDialogHelpers::htmlText(), QQmlDelegateModelItemMetaType::initializeMetaObject(), QQmlDelegateModelItemMetaType::initializePrototype(), launchMail(), macDateToString(), StringEnum::mapName(), QPdfDocument::metaData(), QMacMimeAny::mimeForUti(), Widget::modify(), QQmlEngine::offlineStoragePath(), CppGenerator::operator()(), QVideoFrame::paint(), QGraphicsSimpleTextItem::paint(), parseAttributeValues(), parseUri(), pdbFileName(), QHttpNetworkConnectionPrivate::prepareRequest(), qDBusInterfaceFromMetaObject(), qQmlJSSymbolNamespaceForPath(), qQuote(), qtResourceNameForFile(), readSymLink(), replace(), replace(), replace(), replace(), replace(), replace(), replace(), replace(), replace(), Widget::replaceFunction(), QItemDelegatePrivate::replaceNewLine(), QSSGQmlUtilities::sanitizeQmlId(), QSSGQmlUtilities::sanitizeQmlSourcePath(), scanImports(), QToolButton::setDefaultAction(), QQuickFileDialogDelegate::setFile(), QQuickTextPrivate::setupTextLayout(), tabTextFor(), QAbstractItemDelegatePrivate::textForRole(), GeoMapSource::toFormat(), QQC2::QCommonStylePrivate::toolButtonElideText(), QVideoTextureHelper::SubtitleLayout::update(), QGraphicsSimpleTextItemPrivate::updateBoundingRect(), QMdiSubWindowPrivate::updateInternalWindowTitle(), QQuickTextPrivate::updateLayout(), QFontDialogPrivate::updateStyles(), TestHTTPServer::wait(), QmlTypeRegistrar::write(), and QTextMarkdownWriter::writeBlock().
Ensures the string has space for at least size characters.
If you know in advance how large the string will be, you can call this function to save repeated reallocation in the course of building it. This can improve performance when building a string incrementally. A long sequence of operations that add to a string may trigger several reallocations, the last of which may leave you with significantly more space than you really need, which is less efficient than doing a single allocation of the right size at the start.
If in doubt about how much space shall be needed, it is usually better to use an upper bound as size, or a high estimate of the most likely size, if a strict upper bound would be much bigger than this. If size is an underestimate, the string will grow as needed once the reserved size is exceeded, which may lead to a larger allocation than your best overestimate would have and will slow the operation that triggers it.
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 1173 of file qstring.h.
References capacity(), QArrayData::CapacityReserved, d, QArrayData::KeepSize, qMax(), and size().
Referenced by QWasmLocalStorageSettingsPrivate::QWasmLocalStorageSettingsPrivate(), QXmlStreamReaderPrivate::clearTextBuffer(), QNetworkInformationPrivate::create(), decodeFsEncString(), QLocaleData::doubleToString(), mangledIdentifier(), QV4::StringPrototype::method_replace(), minimalPattern(), parseIp6(), QDBusConnectionPrivate::prepareHook(), qDBusInterfaceFromMetaObject(), quote(), QConfFileSettingsPrivate::readIniSection(), QQmlJS::Lexer::setCode(), QWidgetLineControl::setEchoMode(), QTextBlock::text(), QTextHtmlExporter::toHtml(), toHtmlEscaped(), QVersionNumber::toString(), QIPAddressUtils::toString(), typeNameToXml(), and QTextMarkdownWriter::writeBlock().
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 beyond position size are excluded from the string.
Example:
If you want to append a certain number of identical characters to the string, use the \l {QString::}{resize(qsizetype, QChar)} overload.
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 2654 of file qstring.cpp.
References QArrayDataPointer< T >::allocatedCapacity(), QArrayDataPointer< T >::data(), QArrayData::Grow, QArrayDataPointer< T >::needsDetach(), needsReallocate(), and QArrayDataPointer< T >::size.
Referenced by QXmlStreamPrivateTagStack::addToStringStorage(), addZeroPrefixedInt(), append_utf8(), assign(), Widget::characterReference(), chop(), QXmlStreamReaderPrivate::clearTextBuffer(), QCalendarBackend::dateTimeToString(), decode(), QRegularExpression::errorString(), fill(), insert(), insert_helper(), QSysInfo::machineHostName(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), operator>>(), parseAttributeValues(), replace_in_place(), resize(), Widget::resizeFunction(), QQmlJS::Lexer::scanRegExp(), setUnicode(), QStringAlgorithms< StringType >::simplified_helper(), toStdWString(), QHashedCStringRef::toUtf16(), QStringAlgorithms< StringType >::trimmed_helper_inplace(), truncate(), and QSystemLocalePrivate::update().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Unlike \l {QString::}{resize(qsizetype)}, this overload initializes the new characters to fillChar:
Definition at line 2676 of file qstring.cpp.
References QArrayDataPointer< T >::data(), resize(), and QChar::unicode().
Returns a substring that contains the n rightmost characters of the string.
If you know that n cannot be out of bounds, use last() instead in new code, because it is faster.
The entire string is returned if n is greater than or equal to size(), or less than zero.
Definition at line 5180 of file qstring.cpp.
References QString(), and constData().
Referenced by QToolBarAreaLayout::apply(), computeElidedText(), QQC2_NAMESPACE::QMacStyle::drawControl(), QMacStyle::drawControl(), enumsToValues(), QUrl::fromLocalFile(), QAndroidInputContext::getTextBeforeCursor(), QWaylandTextInputV4Private::inputMethodQuery(), QColor::name(), parseIntOption(), Parser::parseParamReplace(), preprocessMetadata(), qSplitTableAndOwner(), queryQtPaths(), QImageReader::read(), and QAndroidInputContext::setComposingRegion().
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 6803 of file qstring.cpp.
References QArrayDataPointer< T >::data(), fill(), and truncate().
Referenced by formatNumber(), QDB2Driver::formatValue(), QIBaseDriver::formatValue(), QODBCDriver::formatValue(), Widget::rightJustifiedFunction(), and vasprintf().
QString QString::section | ( | const QString & | in_sep, |
qsizetype | start, | ||
qsizetype | end = -1 , |
||
SectionFlags | flags = SectionDefault |
||
) | const |
Definition at line 4987 of file qstring.cpp.
References QString(), QList< T >::at(), Qt::CaseInsensitive, Qt::CaseSensitive, end(), i, isEmpty(), Qt::KeepEmptyParts, ret, section(), SectionCaseInsensitiveSeps, SectionIncludeLeadingSep, SectionIncludeTrailingSep, SectionSkipEmpty, sep, QList< T >::size(), and QStringView::split().
|
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 \l{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 1139 of file qstring.h.
References QString(), and section().
Referenced by QGeoTiledMappingManagerEngineNokia::getBaseScheme(), Q_TRACE_INSTRUMENT(), qtVersion(), section(), section(), Widget::sectionFunction(), QSqlRelationalTableModel::selectStatement(), and QQuickListViewPrivate::updateCurrentSection().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string.
Definition at line 7764 of file qstring.cpp.
References number.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the string to the printed value of n, formatted according to the given format and precision, and returns a reference to the string.
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 1124 of file qstring.h.
References setNum().
|
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.
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 1116 of file qstring.h.
References base, and setNum().
|
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 1120 of file qstring.h.
References base, 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 7732 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 7740 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 1112 of file qstring.h.
References base, and setNum().
Referenced by QLabel::setNum(), setNum(), QLabel::setNum(), setNum(), setNum(), setNum(), setNum(), setNum(), setNum(), and Widget::setNumFunction().
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 1118 of file qstring.h.
References base, 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 1122 of file qstring.h.
References base, 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 1114 of file qstring.h.
References base, and setNum().
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 9261 of file qstring.cpp.
References clear(), fromRawData(), and unicode().
Resizes the string to size characters and copies unicode into the string.
If unicode is \nullptr, nothing is copied, but the string is still resized to size.
Definition at line 5938 of file qstring.cpp.
References QArrayDataPointer< T >::data(), resize(), and unicode().
Referenced by setUtf16().
Resizes the string to size characters and copies unicode into the string.
If unicode is \nullptr, 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 1191 of file qstring.h.
References setUnicode().
Referenced by vasprintf().
|
inline |
|
inline |
Definition at line 384 of file qstring.h.
Referenced by comify(), QDB2Driver::open(), QHostAddressPrivate::parse(), QTestPrivate::parseBlackList(), parseHtmlMetaForEncoding(), Parser::parseInstrument(), Parser::parseMetadata(), parseOtoolLibraryLine(), Parser::parseParamReplace(), Parser::parsePoint(), Parser::parsePrefix(), preprocessMetadata(), qt_strip_filters(), QPngHandlerPrivate::readPngTexts(), QIBaseResult::record(), QODBCDriverPrivate::setConnectionOptions(), QImageWriter::setText(), and Widget::simplifiedFunction().
|
inline |
Returns the number of characters in this string.
The last character in the string is at position size() - 1.
Example:
Definition at line 182 of file qstring.h.
References d.
Referenced by QQmlJS::Dom::CommentInfo::CommentInfo(), QQmlJS::Dom::IndentInfo::IndentInfo(), KeyEvent::KeyEvent(), QTextEngine::LayoutData::LayoutData(), QAnyStringView::QAnyStringView(), QAnyStringView::QAnyStringView(), QHashedStringRef::QHashedStringRef(), QHashedStringRef::QHashedStringRef(), QTemporaryFileName::QTemporaryFileName(), QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext(), QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged(), QDateTimeEditPrivate::_q_editorCursorPositionChanged(), _q_PKCS12_keygen(), _q_resolveEntryAndCreateLegacyEngine_recursive(), QLineEditPrivate::_q_textChanged(), QFileDialogPrivate::_q_updateOkButton(), QFileDialogPrivate::_q_useNameFilter(), QQmlTypeLoader::absoluteFilePath(), QFileDialog::accept(), QQuickComboBoxPrivate::acceptInput(), QIconLoaderEngine::actualSize(), QQmlTypeNameCache::add(), QQmlTypeNameCache::add(), QWindowsFontDatabase::addApplicationFont(), QFileDialogPrivate::addDefaultSuffixToUrls(), QZipWriterPrivate::addEntry(), QMimeBinaryProvider::addFileNameMatches(), QQmlImportDatabase::addImportPath(), addLexToken(), QFseventsFileSystemWatcherEngine::addPaths(), QQmlImportDatabase::addPluginPath(), addressLine(), QQuickTextNodeEngine::addTextBlock(), QQuickTextNode::addTextLayout(), QXmlStreamPrivateTagStack::addToStringStorage(), addZeroPrefixedInt(), advanceStringIndex(), allocateStringFn(), QWidgetLineControl::allSelected(), QQuickTextInputPrivate::allSelected(), append(), QCborStreamWriter::append(), append_utf8(), appendReplacementString(), QToolBarAreaLayout::apply(), QQmlJSLinter::applyFixes(), arg(), arg(), arg(), QPdf::ascii85Encode(), QV4::PropertyKey::asFunctionName(), at(), Widget::atFunction(), QTextEngine::attributes(), back(), QPainter::boundingRect(), QFontMetricsF::boundingRect(), QFontMetrics::boundingRect(), QFontMetrics::boundingRect(), QFontMetricsF::boundingRect(), buildAndroidProject(), QWaylandInputMethodEventBuilder::buildCommit(), QtWaylandClient::calculateOffset(), QV4::CompiledData::String::calculateSize(), QTextEngine::calculateTabWidth(), canonicalOrderHelper(), QWindowsFontDatabaseBase::EmbeddedFont::changeFamilyName(), Utils::TextDocument::characterCount(), checkArgumentsObjectUseInSignalHandlers(), checkAsciiDomainName(), QMacSettingsPrivate::children(), QConfFileSettingsPrivate::children(), cleanPackageName(), QWidgetLineControl::clear(), QQuickTextInputPrivate::clear(), QXmlStreamReaderPrivate::clearSym(), QDateTimeEditPrivate::closestSection(), QLocalePrivate::codeToLanguage(), QLocalePrivate::codeToScript(), QLocalePrivate::codeToTerritory(), QQmlJS::Dom::AstComments::collectComments(), colorValue(), QQmlJS::Dom::LineWriter::column(), comify(), QQmlJS::Dom::LineWriter::commitLine(), computeElidedText(), QQmlNotifierEndpoint::connect(), QQmlTranslation::contextFromQmlFilename(), QUnicodeTables::convertCase(), Qt::convertFromPlainText(), convertMnemonics(), convertToAscii(), convertToExtendedType(), convertToUnicode(), QUtf16::convertToUnicode(), count(), countRepeat(), QNetworkAccessFileBackendFactory::create(), QFileSystemEngine::createDirectory(), createDirectoryWithParents(), QV4::Heap::StringOrSymbol::createHashValue(), QTextLayout::createLine(), createLinkTitle(), QToolBarAreaLayout::currentGapIndex(), QQmlJS::Dom::LineWriter::currentSourceLocation(), QMimerSQLResult::data(), dataToUrls(), QCalendarBackend::dateTimeToString(), QQuickScriptActionPrivate::debugAction(), decode(), decodeFsEncString(), QKeySequencePrivate::decodeString(), decomposeHelper(), QToolBarAreaLayout::deleteAllLayoutItems(), QTlsPrivate::TlsKeyOpenSSL::derFromPem(), QTlsPrivate::TlsKeyGeneric::derFromPem(), QmlLsp::QmlLintSuggestions::diagnose(), QQmlJSUtils::didYouMean(), directoryMatchesSize(), directorySizeDistance(), doFilter(), doParseMountInfo(), QPdfSearchModelPrivate::doSearch(), QLocaleData::doubleToString(), QVideoTextureHelper::SubtitleLayout::draw(), QMacStyle::drawControl(), QTextLayout::drawCursor(), QPainter::drawText(), QPainter::drawText(), QPainter::drawText(), QPainter::drawText(), QmlLsp::OpenDocumentSnapshot::dump(), QQuickTextPrivate::elidedText(), QTextEngine::elidedText(), HPack::Encoder::encodeRequest(), HPack::Encoder::encodeResponse(), encodeText(), QWidgetLineControl::end(), QQuickTextInputPrivate::end(), QWidgetLineControl::end(), QQmlJS::Dom::LineWriter::endSourceLocation(), QQmlJS::Dom::LineWriter::ensureSpace(), QQmlJS::Dom::LineWriter::ensureSpace(), QQuickDialogTestUtils::enterText(), errorMessage(), QRegularExpression::errorString(), QRegularExpression::escape(), QQmlCustomParser::evaluateEnum(), QMenu::event(), QtPrivate::QCalendarTextNavigator::eventFilter(), excludeBaseUrl(), QSQLiteResult::exec(), existingImageFileForPath(), QBenchmarkValgrindUtils::extractResult(), QSvgText::fastBounds(), QDateTimeParser::fieldInfo(), fileFromPath(), QFileSystemModelPrivate::filePath(), filterSpecs(), QV4::Moth::BytecodeGenerator::finalize(), find_translation(), findChildObject(), findDependentQtLibraries(), QStandardPaths::findExecutable(), findFilesRecursively(), findInBlock(), QTextEngine::findItem(), QResourceRoot::findNode(), findObject(), findTextEntry(), QToolBarAreaLayout::findToolBar(), QQmlJS::Dom::LineWriter::flush(), QQuickFolderBreadcrumbBarPrivate::folderBaseName(), QWindowsFontDatabaseBase::fontDefToLOGFONT(), QSqlDriver::formatValue(), QUrl::fromLocalFile(), fromWinApiAddress(), QSqlRelationalTableModelPrivate::fullyQualifiedFieldName(), QToolBarAreaLayoutInfo::gapIndex(), generateFileName(), genVulkanFunctionsPC(), QSSGShaderKeyPropertyBase::getBoolValue(), QV4::getElementIntFallback(), getMessage(), QPdfDocument::getSelectionAtIndex(), getStringDataImpl(), QToolBarAreaLayout::getStyleOptionInfo(), QV4::RegExp::getSubstitution(), QRawFont::glyphIndexesForString(), QTextLayout::glyphRuns(), QXcbKeyboard::handleKeyEvent(), QQmlJS::Dom::LineWriter::handleTrailingSpace(), QTextHtmlParserNode::hasOnlyWhitespace(), Driver::headerFileName(), QCommandLineParserPrivate::helpText(), QtPrivate::QCalendarDateSectionValidator::highlightString(), QTextDocumentLayout::hitTest(), QFontMetrics::horizontalAdvance(), QFontMetrics::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), ignoreProxyFor(), QSslSocket::implementedClasses(), importCompletions(), QWaylandInputMethodEventBuilder::indexFromWayland(), indexOf(), QToolBarAreaLayout::indexOf(), iniChopTrailingSpaces(), QSettingsPrivate::iniEscapedString(), QQmlPropertyPrivate::initProperty(), QSettingsPrivate::iniUnescapedKey(), QSettingsPrivate::iniUnescapedStringList(), QQmlJS::Dom::inQString(), QQmlJS::Dom::inQString(), QTextDocumentPrivate::insert(), QQuickTextInput::insert(), insert(), QTextDocumentPrivate::insertBlock(), QToolBarAreaLayoutInfo::insertItem(), QTextCursor::insertText(), QToolBarAreaLayoutInfo::insertToolBarBreak(), is_valid_domain_name(), QInputControl::isAcceptableInput(), QSqlDriver::isIdentifierEscaped(), QMYSQLDriver::isIdentifierEscaped(), QODBCDriver::isIdentifierEscaped(), QQmlFile::isLocalFile(), QSslSocketPrivate::isMatchingHostname(), QUrl::isParentOf(), isParentOf(), isQtModule(), QQmlJS::Dom::Binding::isSignalHandler(), isSignalPropertyName(), QQmlFile::isSynchronous(), QDBusUtil::isValidBusName(), QTextLayout::isValidCursorPosition(), QDBusUtil::isValidInterfaceName(), QToolBarAreaLayout::item(), QToolBarAreaLayout::itemAt(), QTextEngine::itemize(), QQmlXMLHttpRequest::jsonResponseBody(), QTextEngine::justify(), QuickTestEvent::keyClickChar(), QuickTestEvent::keyPressChar(), QTextEdit::keyPressEvent(), QAbstractSpinBox::keyPressEvent(), QuickTestEvent::keyReleaseChar(), QTextEngine::lineNumberForTextPosition(), QQmlJSLinter::lintModule(), QTranslator::load(), localeAwareCompare(), lookupVendorIdInSystemDatabase(), QSysInfo::machineHostName(), mangledIdentifier(), QMimeGlobPattern::matchFileName(), QMimeAllGlobPatterns::matchingGlobs(), menuItemInfoSetText(), QV4::StringPrototype::method_charAt(), QV4::StringPrototype::method_charCodeAt(), QV4::StringIteratorPrototype::method_next(), QV4::StringPrototype::method_padEnd(), QV4::StringPrototype::method_padStart(), QV4::JsonObject::method_parse(), QV4::StringPrototype::method_replace(), QV4::StringPrototype::method_split(), Qt::mightBeRichText(), QXcbMime::mimeDataForAtom(), QMacMimeAny::mimeForUti(), minimalPattern(), QKeySequence::mnemonic(), QQuickTextInput::moveCursorSelection(), QToolBarAreaLayoutInfo::moveToolBar(), QmlLsp::QQmlCodeModel::newDocForOpenFile(), QV4::ExecutionEngine::newIdentifier(), QTextHtmlParser::newNode(), StringObjectOwnPropertyKeyIterator::next(), QTextLayout::nextCursorPosition(), nextField(), QTextEngine::nextLogicalPosition(), nextNonWhitespace(), normalizationQuickCheckHelper(), operator!=(), operator!=(), operator<(), operator<(), operator<<(), operator<<(), QQmlError::operator<<(), operator<=(), operator<=(), operator==(), operator==(), operator>(), operator>(), operator>=(), operator>=(), operator>>(), operator[](), operator[](), QQuickStyledTextPrivate::parse(), QTextHtmlParser::parse(), parseAnimateColorNode(), parseAttributeValues(), QTestPrivate::parseBlackList(), parseColorValue(), parseFlags(), parseFont(), parseFontName(), DocumentFile::parseFromAnyUri(), SyncScanner::parseHeader(), QHttpHeaderParser::parseHeaders(), parseHtmlMetaForEncoding(), parseHttpOptionHeader(), QQuickStyledTextPrivate::parseImageAttributes(), parseInt(), parseIntOption(), parseIp6(), parseIpFuture(), QQuickSvgParser::parsePathDataFast(), parseTransformationMatrix(), parseVersion(), QTextHtmlParser::parseWord(), QLoggingRule::pass(), pdbFileName(), QWindowsFontDatabaseFT::populateFamily(), QWindowsFontDatabase::populateFamily(), QSqlResultPrivate::positionalToNamedBinding(), QDBusConnectionPrivate::prepareHook(), QQmlJSScope::prettyName(), QTextLayout::previousCursorPosition(), QTextEngine::previousLogicalPosition(), QWidgetLineControl::processInputMethodEvent(), QJSManagedValue::property(), pythonRoot(), qDBusInterfaceFromMetaObject(), qGetTableInfo(), QQmlTypeLoader::qmldirContent(), QQmlMetaType::qmlType(), qQmlJSSymbolNamespaceForPath(), QTest::qt_asprintf(), qt_cbor_decoder_advance(), qt_cbor_decoder_can_read(), qt_cbor_decoder_read(), qt_cbor_decoder_transfer_string(), qt_color_from_string(), qt_findAtNxFile(), qt_from_latin1_to_qvla(), qt_getEnglishName(), qt_mac_removeMnemonics(), QQC2_NAMESPACE::qt_mac_removeMnemonics(), qt_normalizePathSegments(), qt_punycodeDecoder(), qt_u_strToCase(), qtiffMapProc(), Driver::qtify(), qtModule(), queryQtPaths(), quote(), QtPrivate::qustrchr(), readDependenciesFromElf(), readInputFile(), QWindowsInputContext::reconvertString(), QXmlStreamReaderPrivate::referenceEntity(), QV4::Compiler::StringTableGenerator::registerString(), QQmlJS::Dom::IndentingLineWriter::reindentAndSplit(), QDir::relativeFilePath(), remove(), QToolBarAreaLayout::remove(), QFileSystemEngine::removeDirectory(), QPlatformTheme::removeMnemonics(), QToolBarAreaLayoutInfo::removeToolBar(), QToolBarAreaLayoutInfo::removeToolBarBreak(), replace(), replace(), replace(), replace(), replace(), reserve(), QQuickImageBase::resolve2xLocalFile(), QOffscreenIntegration::resolveConfigFileConfiguration(), QQuickFolderListModelPrivate::resolvePath(), QTipLabel::restartExpireTimer(), runMoc(), runUic(), sanitizeNameForDBus(), QSSGMesh::Mesh::save(), QToolBarAreaLayout::saveState(), QWhatsThisPrivate::say(), QZipReaderPrivate::scanFiles(), scanImports(), QDateTimeEditPrivate::sectionAt(), QDateTimeParser::sectionPos(), QDateTimeParser::sectionSize(), QWidgetLineControl::selectAll(), QQuickTextInputPrivate::selectAll(), QSqlTableModel::selectRow(), QWaylandTextInputPrivate::sendInputMethodEvent(), QLineEditPrivate::sendMouseEventToInputContext(), QQuickTextInputPrivate::sendMouseEventToInputContext(), QV4::Compiler::StringTableGenerator::serialize(), serializeString(), set_text(), QSslSocket::setActiveBackend(), QUrl::setAuthority(), QQmlJS::Lexer::setCode(), QWidgetLineControl::setCursorPosition(), QQuickTextInputPrivate::setCursorPosition(), QFileDialogOptions::setDefaultSuffix(), QmlIR::IRBuilder::setId(), QQmlJS::Dom::LineWriter::setLineIndent(), QTextLine::setLineWidth(), setMonitorDataFromSetupApi(), QQuickTextInput::setPasswordCharacter(), QMessagePattern::setPattern(), Utils::TextDocument::setPlainText(), QUrl::setScheme(), QWidgetLineControl::setSelection(), QQuickTextInputPrivate::setSelection(), StringOrTranslation::setString(), QQuickTextEdit::setText(), TileProvider::setupProvider(), QQuickTextPrivate::setupTextLayout(), QtWaylandClient::QWaylandWindow::setWindowTitle(), QObjectPrivate::signalIndex(), QmlIR::IRBuilder::signalNameFromSignalPropertyName(), QStringAlgorithms< StringType >::simplified_helper(), Widget::sizeFunction(), QDateTimeParser::skipToNextSection(), splitIntoFamilies(), startsWithLocalTimeZone(), QV4::Heap::String::startsWithUpper(), QNetworkReplyWasmImplPrivate::stateChange(), QV4::CompiledData::Unit::stringAtInternal(), stringList_contains(), QSettingsPrivate::stringListToVariantList(), QQmlScriptString::stringLiteral(), QV4::stringToArrayIndex(), QAbstractSpinBoxPrivate::stripped(), QQmlJS::Dom::QmlComponent::subComponentsNames(), QSslSocket::supportedFeatures(), QSslSocket::supportedProtocols(), QToolBarAreaLayout::takeAt(), QQmlLSUtils::textOffsetFrom(), QFontMetrics::tightBoundingRect(), QFontMetricsF::tightBoundingRect(), QFontMetrics::tightBoundingRect(), QFontMetricsF::tightBoundingRect(), QSslSocketPrivate::tlsBackendInUse(), toDouble(), QVideoTextureHelper::SubtitleLayout::toImage(), tokenizeLine(), QToolBarAreaLayout::toolBarBreak(), toStdU16String(), toStdU32String(), toStdWString(), QIPAddressUtils::toString(), QKeySequence::toString(), toVariant(), QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(), QQuickComboBoxPrivate::tryComplete(), QSystemLocalePrivate::uiLanguages(), QToolBarAreaLayout::unplug(), unquote(), QAbstractSpinBoxPrivate::updateEdit(), QDateTimeEditPrivate::updateEdit(), QQuickComboBoxPrivate::updateEditText(), QFileInfoGatherer::updateFile(), QQuickTextInputPrivate::updateHorizontalScroll(), QPrintPreviewDialogPrivate::updatePageNumLabel(), QQuickFileDialogImplPrivate::updateSelectedFile(), QQuickFolderDialogImplPrivate::updateSelectedFolder(), QtWaylandClient::QWaylandTextInputv1::updateState(), QtWaylandClient::QWaylandTextInputv2::updateState(), QQuickTextInputPrivate::updateVerticalScroll(), QQmlImports::urlFromLocalFileOrQrcOrUrl(), uuidFromString(), uuidFromString(), uuidFromString(), QSpinBoxValidator::validate(), QDateTimeEditPrivate::validateAndInterpret(), QLocaleData::validateChars(), valueToKeySequence(), QSSGQmlUtilities::valueToQml(), QQmlConnectionsParser::verifyBindings(), versionUriList(), TestHTTPServer::wait(), QRegularExpression::wildcardToRegularExpression(), wrapInFunction(), wrapText(), write_pbm_image(), QTextMarkdownWriter::writeBlock(), QTextOdfWriter::writeBlock(), RCCFileInfo::writeDataName(), QTextMarkdownWriter::writeFrame(), QSSGMesh::MeshInternal::writeMeshData(), writeStr(), writeString(), xpmHash(), and QLocaleData::zeroUcs().
Returns a string that contains the portion of this string starting at position pos and extending to its end.
Definition at line 341 of file qstring.h.
Referenced by convertToUnicode(), countRepeat(), QCalendarBackend::dateTimeToString(), decodeFsEncString(), QPdfEnginePrivate::drawTextItem(), findAtNxFileOrResource(), fromWinApiAddress(), QSettingsPrivate::iniUnescapedStringList(), loadTzTimeZones(), lookupVendorIdInSystemDatabase(), QHttpHeaderParser::parseHeaders(), QJSManagedValue::property(), QConfFileSettingsPrivate::readIniFile(), QConfFileSettingsPrivate::readIniSection(), QPlatformTheme::removeMnemonics(), QGtk3Dialog::show(), Widget::slicedFunction(), and QClipboard::text().
QStringList QString::split | ( | const QRegularExpression & | sep, |
Qt::SplitBehavior | behavior = Qt::KeepEmptyParts |
||
) | const |
QStringList QString::split | ( | const QString & | sep, |
Qt::SplitBehavior | behavior = Qt::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 Qt::SkipEmptyParts, empty entries don't appear in the result. By default, empty entries are kept.
Example:
If sep is empty, split() returns an empty string, followed by each of the string's characters, followed by another empty string:
To understand this behavior, recall that the empty string matches everywhere, so the above is qualitatively the same as:
Definition at line 7956 of file qstring.cpp.
References sep.
Referenced by QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QMacSettingsPrivate::QMacSettingsPrivate(), CPP::WriteDeclaration::acceptUI(), QFFmpegMetaData::addEntry(), QQmlJS::Dom::FieldFilter::addFilter(), QQuickDesignerSupportProperties::allPropertyNames(), QSSGRuntimeUtils::applyPropertyValue(), buildAndroidProject(), QmlLsp::QQmlCodeModel::buildPathsForFileUrl(), QSSGShaderCache::compileForRhi(), QEvdevKeyboardHandler::create(), createSvgNode(), determineScreenSize(), QLinuxMediaDevice::deviceName(), QQmlJS::Dom::DomUniverse::execQueue(), QGeoFileTileCacheMapbox::filenameToTileSpec(), QGeoFileTileCacheNokia::filenameToTileSpec(), QGeoFileTileCacheOsm::filenameToTileSpec(), QGeoFileTileCache::filenameToTileSpecDefault(), FolderIterator::fileType(), Parser::findEnumValues(), QStandardPaths::findExecutable(), QQuickStateGroupPrivate::findTransition(), fixupFramework(), QPageRanges::fromString(), init_platform(), QQmlJS::Dom::Binding::isSignalHandler(), QDBusUtil::isValidBusName(), QDBusUtil::isValidInterfaceName(), QKeySequence::listFromString(), loadCubeMap(), QEvdevKeyboardManager::loadKeymap(), QQmlJS::Dom::DomEnvironment::loadModuleDependency(), mergeGradleProperties(), QV4::QQmlXMLHttpRequestCtor::method_overrideMimeType(), QXcbMime::mimeConvertToFormat(), AndroidContentFileEngine::mkdir(), QFileSystemModelPrivate::node(), QDB2Driver::open(), QSQLiteDriver::open(), QQmlError::operator<<(), parseAnimateColorNode(), parseArguments(), parseEnvPath(), QCUPSSupport::parseJobSheets(), QGeoTiledMappingManagerEngineNokia::parseNewVersionInfo(), QT_BEGIN_NAMESPACE::parsePlaceResult(), parseProvider(), QEvdevUtil::parseSpecification(), pythonRoot(), qDBusInterfaceFromMetaObject(), QQmlJS::Dom::ModuleIndex::qmldirsToLoad(), qt_getImageTextFromDescription(), qt_mac_applicationName(), QAndroidSystemLocale::query(), readInputFile(), QtWaylandClient::QWaylandDisplay::registry_global(), QODBCDriverPrivate::setConnectionOptions(), QV4::UrlObject::setHost(), QQuick3DRenderStatsMeshesModel::setMeshData(), QQuick3DRenderStatsPassesModel::setPassData(), QQuick3DRenderStatsTexturesModel::setTextureData(), Widget::splitCaseSensitiveFunction(), Widget::splitFunction(), splitIntoFamilies(), QCompleter::splitPath(), stringToList(), QFileDialogPrivate::typedFiles(), QQuickFileDialogImplPrivate::updateSelectedFile(), QQuickFolderDialogImplPrivate::updateSelectedFolder(), and QFileSelectorPrivate::updateSelectors().
QStringList QString::split | ( | QChar | sep, |
Qt::SplitBehavior | behavior = Qt::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 7965 of file qstring.cpp.
References QStringView, and sep.
|
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 1181 of file qstring.h.
References capacity(), QArrayData::CapacityReserved, d, and QArrayData::KeepSize.
Referenced by QSettingsPrivate::iniUnescapedStringList(), and toHtmlEscaped().
bool QString::startsWith | ( | const QString & | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true
if the string starts with s; otherwise returns false
.
{search-comparison-case-sensitivity} {search}
Definition at line 5299 of file qstring.cpp.
References QStringView.
Referenced by QBsdKeyboardHandler::QBsdKeyboardHandler(), QBsdMouseHandler::QBsdMouseHandler(), QFactoryLoader::QFactoryLoader(), QIOSScreen::QIOSScreen(), QQuickGridScaledImage::QQuickGridScaledImage(), QWinSettingsPrivate::QWinSettingsPrivate(), QFileDialogPrivate::_q_autoCompleteFileName(), _q_escapeIdentifier(), QFileDialogPrivate::_q_updateOkButton(), absoluteFilePath(), QQmlImports::addFileImport(), addFontToDatabase(), addFontToDatabase(), QTapTestLogger::addIncident(), Parser::addIncludesRecursive(), QFileSystemWatcher::addPaths(), QFseventsFileSystemWatcherEngine::addPaths(), QWebpHandler::canRead(), QJp2Handler::canRead(), QDir::cd(), checkArgumentsObjectUseInSignalHandlers(), QODBCDriverPrivate::checkHasMultiResults(), checkSourceIsFile(), QMacSettingsPrivate::children(), QNetworkCookieJar::cookiesForUrl(), copyAndroidExtraLibs(), copyQtFiles(), QQmlPreviewFileEngineHandler::create(), QIBusPlatformInputContextPrivate::createConnection(), createDirectoryWithParents(), createImageNode(), QCalendarBackend::dateTimeToString(), deployPlugins(), deployQmlImports(), deployQtFrameworks(), detectMenuRole(), dirsList(), QTranslatorPrivate::do_load(), doFilter(), QPdfEnginePrivate::drawTextItem(), QResourcePrivate::ensureInitialized(), QDB2Driver::escapeIdentifier(), QIBaseDriver::escapeIdentifier(), QMimerSQLDriver::escapeIdentifier(), QMYSQLDriver::escapeIdentifier(), QODBCDriver::escapeIdentifier(), QPSQLDriver::escapeIdentifier(), QBenchmarkValgrindUtils::extractResult(), fileArchitecture(), QIOSFileEngineAssetsLibrary::fileFlags(), QSortedModelEngine::filter(), QCompletionEngine::filterHistory(), findAtNxFileOrResource(), QHttpNetworkReplyPrivate::findChallenge(), QNetworkAuthenticationCache::findClosestMatch(), QQuickControlsTestUtils::forEachControl(), QDirectFbBlitterPlatformPixmap::fromFile(), QUrl::fromLocalFile(), fromWinApiAddress(), QQmlJSCodeGenerator::generate_SetLookup(), getBinaryDependencies(), getLibraryProjectsInOutputFolder(), getQtLibsFromElf(), QSSGInputUtil::getStreamForFile(), QSettingsPrivate::iniEscapedString(), QT_BEGIN_NAMESPACE::isAerialType(), CustomWidgetsInfo::isAmbiguousSignal(), TileProvider::isHTTPS(), QSqlDriver::isIdentifierEscaped(), QMYSQLDriver::isIdentifierEscaped(), QODBCDriver::isIdentifierEscaped(), QQmlFile::isLocalFile(), QSslSocketPrivate::isMatchingHostname(), QUrl::isParentOf(), isParentOf(), QCoreTextFontDatabase::isPrivateFontFamily(), isQtModule(), QQmlJS::Dom::Binding::isSignalHandler(), isSignalPropertyName(), QDBusUtil::isValidBusName(), itemToDialogUrl(), launchMail(), QLocalServerPrivate::listen(), QSSGBufferManager::loadMeshData(), QHostInfo::localDomainName(), QQmlImportDatabase::locateLocalQmldir(), lookupVendorIdInSystemDatabase(), main(), mangledIdentifier(), QPdfDocument::metaData(), QV4::QQmlXMLHttpRequestCtor::method_setRequestHeader(), QLastResortMimes::mimeForFormat(), QMacMimeAny::mimeForUti(), QMimeDatabase::mimeTypeForUrl(), QFileSystemModelPrivate::node(), QNetworkCookie::normalize(), objectPathIsForThisDevice(), StartsWith::operator()(), QV4::Script::parse(), Parser::parse(), QTestPrivate::parseBlackList(), parseColorValue(), QMapboxCommon::parseGeoLocation(), QAuthenticatorPrivate::parseHttpResponse(), parseIntOption(), parseProvider(), platformFromMkSpec(), preprocessMetadata(), QQmlJSScope::prettyName(), QGlobalNetworkProxy::proxyForQuery(), pythonRoot(), qDecodeOCIType(), qmlsqldatabase_executeSql(), qQmlJSSymbolNamespaceForPath(), qRegisterNotificationCallbacks(), qRelocateResourceFile(), qt_punycodeDecoder(), qtModule(), QAndroidSystemLocale::query(), queryQtPaths(), readGradleProperties(), QConfFileSettingsPrivate::readIniFile(), QConfFileSettingsPrivate::readIniSection(), QSSGMesh::MeshInternal::readMeshData(), QDir::relativeFilePath(), QPlatformTheme::removeMnemonics(), removeOptionalQuotes(), DocumentFile::rename(), QUrl::resolved(), QSSGQmlUtilities::sanitizeQmlId(), QDomEntityPrivate::save(), QDeviceDiscoveryUDev::scanConnectedDevices(), scanImports(), QFileDialogOptions::setDefaultSuffix(), QMessagePattern::setPattern(), QQmlImportInstance::setQmldirContent(), QV4::UrlObject::setSearch(), QNdefNfcUriRecord::setUri(), QmlIR::IRBuilder::signalNameFromSignalPropertyName(), QQmlJSUtils::sourceDirectoryPath(), splitIntoFamilies(), QCompleter::splitPath(), Widget::startsWithFunction(), QSettingsPrivate::stringListToVariantList(), QSSGQmlUtilities::stripParentDirectory(), QAbstractSpinBoxPrivate::stripped(), QSvgNode::styleProperty(), styleUri(), QQmlDataTest::testFileUrl(), QUrlPrivate::toLocalFile(), QNetworkCookie::toRawForm(), QUrl::toString(), translateDriveName(), QQuickComboBoxPrivate::tryComplete(), updateLibsXml(), QGeoMapMapboxGLPrivate::updateSceneGraph(), QQuickImageSelector::updateSource(), QNetworkCookieJar::validateCookie(), QQmlConnectionsParser::verifyBindings(), QV4::UrlCtor::virtualCallAsConstructor(), QQmlJSImportVisitor::visit(), QDockWidgetLayout::wmSupportsNativeWindowDeco(), QTextMarkdownWriter::writeBlock(), and QSSGQmlUtilities::writeNodeProperties().
bool QString::startsWith | ( | QChar | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 5318 of file qstring.cpp.
References at, Qt::CaseSensitive, and foldCase().
bool QString::startsWith | ( | QLatin1StringView | s, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Definition at line 5307 of file qstring.cpp.
References QStringView.
|
inlinenoexcept |
Returns true
if the string starts with the string view str; otherwise returns false
.
{search-comparison-case-sensitivity} {search}
Definition at line 350 of file qstring.h.
References QtPrivate::startsWith().
Swaps string other with this string. This operation is very fast and never fails.
Definition at line 181 of file qstring.h.
Referenced by insert(), insert_helper(), remove(), replace(), and replace_with_copy().
|
inline |
Definition at line 376 of file qstring.h.
Referenced by QFontconfigDatabase::fallbacksForFamily().
double QString::toDouble | ( | bool * | ok = nullptr | ) | const |
Returns the string converted to a double
value.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for other reasons (e.g. underflow).
If ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toDouble()
For historical reasons, this function does not handle thousands group separators. If you need to convert such numbers, use QLocale::toDouble().
This function ignores leading and trailing whitespace.
Definition at line 7642 of file qstring.cpp.
References ok, and QStringView.
Referenced by parseBoundingBox(), qEnvironmentVariableOptionalReal(), QDoubleSpinBoxPrivate::round(), setWidthAttribute(), Widget::toDoubleFunction(), toFloat(), and wrapInFunction().
float QString::toFloat | ( | bool * | ok = nullptr | ) | const |
Returns the string converted to a float
value.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for other reasons (e.g. underflow).
If ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toFloat()
For historical reasons, this function does not handle thousands group separators. If you need to convert such numbers, use QLocale::toFloat().
Example:
This function ignores leading and trailing whitespace.
Definition at line 7688 of file qstring.cpp.
References QLocaleData::convertDoubleToFloat(), ok, and toDouble().
Referenced by QPrintPreviewDialogPrivate::_q_zoomFactorChanged(), QGnomeThemePrivate::configureFonts(), Widget::toFloatFunction(), and wrapInFunction().
QString QString::toHtmlEscaped | ( | ) | const |
Converts a plain text string to an HTML string with HTML metacharacters {<},
{>},
{&}, and
{"} replaced by HTML entities.
Example:
Definition at line 9926 of file qstring.cpp.
References ch, reserve(), and squeeze().
Referenced by QtAndroidDialogHelpers::htmlText(), and typeNameToXml().
|
inline |
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toInt()
Example:
This function ignores leading and trailing whitespace.
Definition at line 660 of file qstring.h.
Referenced by GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(), QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(), QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(), QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QQuickGridScaledImage::QQuickGridScaledImage(), QTuioHandler::QTuioHandler(), QPrintPreviewDialogPrivate::_q_pageNumEdited(), QFontDialogPrivate::_q_sizeChanged(), QFontDialogPrivate::_q_updateSample(), checked_var_value(), QIBusPlatformInputContextPrivate::createConnection(), decodeFsEncString(), QAndroidMetaData::extractMetadata(), QQmlJS::Dom::ModuleIndex::iterateDirectSubpaths(), QQmlJS::Dom::DomEnvironment::loadModuleDependency(), GeoMapSource::mapStyle(), Recognizer::parse(), parseCmakeBoolean(), parseIntOption(), QHttpHeaderParser::parseStatus(), parseVersion(), qtVersion(), QGLXContext::queryDummyContext(), runRcc(), QPpdPrintDevice::state(), QSystemLocalePrivate::toCurrencyString(), Widget::toIntFunction(), and wrapInFunction().
|
inlinenoexcept |
Definition at line 540 of file qstring.h.
References qTokenize().
|
inlinenoexcept |
Definition at line 534 of file qstring.h.
References qTokenize().
|
inlinenoexcept |
Definition at line 528 of file qstring.h.
References qTokenize(), and qToStringViewIgnoringNull().
Referenced by QDir::relativeFilePath().
|
inline |
|
inline |
Definition at line 559 of file qstring.h.
Referenced by GeoCodingManagerEngineEsri::GeoCodingManagerEngineEsri(), GeoRoutingManagerEngineEsri::GeoRoutingManagerEngineEsri(), GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(), QEglFSKmsScreen::QEglFSKmsScreen(), QGeoCodingManagerEngineMapbox::QGeoCodingManagerEngineMapbox(), QGeoCodingManagerEngineOsm::QGeoCodingManagerEngineOsm(), QGeoRoutingManagerEngineMapbox::QGeoRoutingManagerEngineMapbox(), QGeoRoutingManagerEngineOsm::QGeoRoutingManagerEngineOsm(), QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QPlaceManagerEngineMapbox::QPlaceManagerEngineMapbox(), QPlaceManagerEngineOsm::QPlaceManagerEngineOsm(), QGeoFileTileCache::~QGeoFileTileCache(), QAbstractSocketPrivate::_q_connectToNextAddress(), QSSGRenderReflectionMap::addReflectionMapEntry(), QSSGRenderShadowMap::addShadowMapEntry(), QDBusMarshaller::appendCrossMarshalling(), QImageReaderWriterHelpers::appendImagePluginMimeTypes(), QQuickAnimatorPrivate::apply(), QMacStylePrivate::aquaSizeConstrain(), QSocks5PasswordAuthenticator::beginAuthenticate(), QAuthenticatorPrivate::calculateResponse(), QQmlDataTest::canImportModule(), QTextureFileReader::canRead(), QSctpSocketPrivate::canReadNotification(), QEglFSKmsGbmCursor::changeCursor(), QLocalePrivate::codeToScript(), QuickTestResult::compare(), QMetaObject::connectSlotsByName(), QAbstractSocket::connectToHost(), createImageNode(), createReadHandlerHelper(), createWriteHandlerHelper(), QDeclarativeSearchResultModel::data(), decodePolyline(), QAuthenticatorPrivate::digestMd5Response(), QPainter::drawText(), QPainter::drawText(), QPainter::drawText(), QPainter::drawText(), QPdfEnginePrivate::drawTextItem(), encodeLabel(), QuickTestResult::expectFail(), QAbstractSocketPrivate::fetchConnectionParameters(), QNativeSocketEnginePrivate::fetchConnectionParameters(), QGtk3Interface::fileIcon(), findSlot(), freeDesktopTrashLocation(), QHostInfoAgent::fromName(), QFont::fromString(), getDevice(), getQtLibsFromElf(), QSSGRenderShaderMetadata::getShaderMetaData(), QSSGInputUtil::getStreamForTextureFile(), getWinLocaleName(), hasValidSignal(), QHttpNetworkRequestPrivate::header(), QGeoSatelliteInfoSourceGypsy::init(), QNativeSocketEngine::initialize(), QAbstractSocketPrivate::initSocketLayer(), isPossiblySvg(), loadAndroidStyle(), QHostInfoAgent::lookup(), QSysInfo::machineUniqueId(), makeCacheKey(), QXcbMime::mimeDataForAtom(), msgConnect(), QNativeSocketEnginePrivate::nativeReceiveDatagram(), QNativeSocketEnginePrivate::nativeSendDatagram(), openFramebufferDevice(), operator<<(), operator<<(), QDateTimeParser::parse(), QGeoRouteParserOsrmV4Private::parseReply(), QHttpNetworkConnectionPrivate::prepareRequest(), QWindowsFontEngine::properties(), qDecodeDataUrl(), QAlsaAudioSource::read(), QImageReader::read(), QAbstractSocketPrivate::readFromSocket(), QXcbDropData::retrieveData_sys(), QQuickFolderListModel::roleFromString(), QDeclarativeGeoMap::setActiveMapType(), QMessagePattern::setPattern(), QEglFSKmsGbmCursor::setPos(), QTextBrowserPrivate::setSource(), QXcbWindow::setWindowRole(), timeUnit(), QUrl::toAce(), toDouble(), toDouble(), QUrl::toEncoded(), QNetworkHeadersPrivate::toHttpDate(), QNetworkCookie::toRawForm(), updateStringsXml(), Jpeg2000JasperReader::write(), QTextDocumentWriter::write(), QSctpSocket::writeDatagram(), QUdpSocket::writeDatagram(), QPNGImageWriter::writeImage(), QPdfEnginePrivate::writeTail(), and QSctpSocketPrivate::writeToSocket().
|
inline |
|
inline |
Definition at line 567 of file qstring.h.
Referenced by QQmlDataTest::QQmlDataTest(), QGridLayout::addWidget(), arg(), buildAndroidProject(), QProcEnvValue::bytes(), QCoreApplicationPrivate::checkReceiverThread(), QCupsPrintEnginePrivate::closePrintDevice(), QWindowsMimeText::convertFromMime(), QXcbWindow::create(), QMinimalBackingStore::flush(), freeDesktopTrashLocation(), QDirectFbBlitterPlatformPixmap::fromFile(), installCoverageTool(), QQuick3DFileInstancing::loadFromXmlFile(), msgBeginFailed(), msgProblemParsing(), myMessageOutput(), QDB2Driver::open(), QIBaseDriver::open(), openProcess(), QHaikuServices::openUrl(), QQmlError::operator<<(), qDecodeOCIType(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), QByteArray::qvsnprintf(), QWasmIDBSettingsPrivate_onCheck(), Preprocessor::resolveInclude(), runAdb(), runMoc(), runUic(), QToolBarAreaLayout::saveState(), scanImports(), searchIncludePaths(), QWidget::setLayout(), QHaikuWindow::setWindowTitle(), QSvgHandler::startElement(), stderr_message_handler(), QQuickWheelHandlerPrivate::targetMetaProperty(), wrapInFunction(), QColorOutputPrivate::write(), RCCFileInfo::writeDataBlob(), RCCFileInfo::writeDataName(), and writePrologue().
|
inline |
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toLongLong()
Example:
This function ignores leading and trailing whitespace.
Definition at line 664 of file qstring.h.
Referenced by Widget::toLongFunction(), and wrapInFunction().
QString::toLongLong | ( | bool * | ok = nullptr , |
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toLongLong()
Example:
This function ignores leading and trailing whitespace.
Referenced by QCacheItem::canCompress(), QMimerSQLResult::data(), QNetworkDiskCache::prepare(), and Widget::toLongLongFunction().
|
inline |
Definition at line 368 of file qstring.h.
Referenced by GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(), QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(), QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia(), QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(), QMacSettingsPrivate::QMacSettingsPrivate(), _q_lower(), QComboBoxPrivate::_q_returnPressed(), activeConditions(), QQmlEngine::addImageProvider(), QODBCDriverPrivate::adjustCase(), QQmlJSLinter::applyFixes(), automaticPipelineCacheFileName(), QCss::StyleSheet::buildIndexes(), QTextureFileReader::canRead(), QLocalePrivate::codeToLanguage(), QLocalePrivate::codeToScript(), comify(), QMacMimeFileUri::convertToMime(), QMacMimeUrl::convertToMime(), MyStylePlugin::create(), createReadHandlerHelper(), createWriteHandlerHelper(), QCalendarBackend::dateTimeToString(), QKeySequencePrivate::decodeString(), QFFmpeg::deviceTypes(), Recognizer::expand(), QNetworkReplyHttpImplPrivate::fetchCacheMetaData(), find_translation(), QHttpNetworkReplyPrivate::findChallenge(), getFontWeight(), QSSGAssetImportManager::getOptionsForFile(), QTextStreamPrivate::getReal(), QQmlEngine::imageProvider(), QQmlEnginePrivate::imageProvider(), QSSGAssetImportManager::importFile(), QSortedModelEngine::indexHint(), QApplicationPrivate::initialize(), QFont::insertSubstitution(), QFont::insertSubstitutions(), QSysInfo::kernelType(), QQmlJSLinter::lintFile(), QMimeBinaryProvider::loadMimeTypePrivate(), QCompletionEngine::lookupCache(), macQueryInternal(), QMimeGlobPattern::matchFileName(), QCompletionEngine::matchHint(), moduleNameToOptionName(), QFileSystemModelPrivate::node(), QTextHtmlStyleSelector::nodeNames(), QQmlJSTypeReader::operator()(), QDateTimeParser::parse(), QTextHtmlParser::parseAttributes(), QTextHtmlParser::parseCloseTag(), parseHtmlMetaForEncoding(), QAuthenticatorPrivate::parseHttpResponse(), QTextHtmlParser::parseTag(), QQuickNinePatchImage::pixmapChange(), QSysInfo::productVersion(), qGetColumnType(), QDir::relativeFilePath(), QQmlEngine::removeImageProvider(), QFont::removeSubstitutions(), QSSGQmlUtilities::sanitizeQmlId(), QCompletionEngine::saveInCache(), QQuickShapePrivate::selectRendererType(), QDesktopServices::setUrlHandler(), QFont::substitutes(), QLocale::toLower(), Widget::toLowerFunction(), QXcbConnection::windowManagerName(), QTextDocumentWriter::write(), DomUI::write(), DomIncludes::write(), DomInclude::write(), DomResources::write(), DomResource::write(), DomActionGroup::write(), DomAction::write(), DomActionRef::write(), DomButtonGroup::write(), DomButtonGroups::write(), DomCustomWidgets::write(), DomHeader::write(), DomCustomWidget::write(), DomLayoutDefault::write(), DomLayoutFunction::write(), DomTabStops::write(), DomLayout::write(), DomLayoutItem::write(), DomRow::write(), DomColumn::write(), DomItem::write(), DomWidget::write(), DomSpacer::write(), DomColor::write(), DomGradientStop::write(), DomGradient::write(), DomBrush::write(), DomColorRole::write(), DomColorGroup::write(), DomPalette::write(), DomFont::write(), DomPoint::write(), DomRect::write(), DomLocale::write(), DomSizePolicy::write(), DomSize::write(), DomDate::write(), DomTime::write(), DomDateTime::write(), DomStringList::write(), DomResourcePixmap::write(), DomResourceIcon::write(), DomString::write(), DomPointF::write(), DomRectF::write(), DomSizeF::write(), DomChar::write(), DomUrl::write(), DomProperty::write(), DomConnections::write(), DomConnection::write(), DomConnectionHints::write(), DomConnectionHint::write(), DomDesignerData::write(), DomSlots::write(), DomPropertySpecifications::write(), DomPropertyToolTip::write(), and DomStringPropertySpecification::write().
|
inline |
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toShort()
Example:
This function ignores leading and trailing whitespace.
Definition at line 656 of file qstring.h.
Referenced by Widget::toShortFunction().
|
inline |
Returns a std::string object with the data contained in this QString.
The Unicode data is converted into 8-bit characters using the toUtf8() function.
This method is mostly useful to pass a QString to a function that accepts a std::string object.
Definition at line 1319 of file qstring.h.
References QByteArray::toStdString(), and toUtf8().
Referenced by QWasmVideoOutput::addSourceElement(), QWasmVideoOutput::createVideoElement(), QWasmLocalStorageSettingsPrivate::get(), QFileDialog::getOpenFileContent(), qstdweb::Promise::make(), QLinuxMediaDevice::parseLink(), QLinuxMediaDevice::parsePad(), QWasmLocalStorageSettingsPrivate::remove(), QFileDialog::saveFileContent(), QWasmLocalStorageSettingsPrivate::set(), QWasmAudioOutput::setSource(), and TitleBar::setTitle().
|
inline |
Returns a std::u16string object with the data contained in this QString. The Unicode data is the same as returned by the utf16() method.
Definition at line 1339 of file qstring.h.
References data(), and size().
|
inline |
Returns a std::u32string object with the data contained in this QString. The Unicode data is the same as returned by the toUcs4() method.
Definition at line 1345 of file qstring.h.
References data(), and size().
Referenced by qt_punycodeDecoder().
|
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 method is mostly useful to pass a QString to a function that accepts a std::wstring object.
Definition at line 1325 of file qstring.h.
References data(), resize(), size(), str, and toWCharArray().
Referenced by compilerRunTimeLibs(), QWindowsDirect2DIntegration::create(), operator<<(), and vcRedistDir().
Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from this string will be encoded in UCS-4. Any invalid sequence of code units in this string is replaced by the Unicode's replacement character (QChar::ReplacementCharacter, which corresponds to {U+FFFD}).
The returned list is not \0'-terminated.
Definition at line 5662 of file qstring.cpp.
References qt_convert_to_ucs4().
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toUInt()
Example:
This function ignores leading and trailing whitespace.
Definition at line 662 of file qstring.h.
Referenced by QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(), QSystemLocalePrivate::firstDayOfWeek(), QBluetoothSocketPrivateWinRT::localPort(), matches(), QHostAddress::parseSubnet(), QBluetoothSocketPrivateWinRT::peerPort(), runRcc(), Widget::toUIntFunction(), and QIBusPlatformInputContext::update().
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toULongLong()
Example:
This function ignores leading and trailing whitespace.
Definition at line 666 of file qstring.h.
Referenced by Widget::toULongFunction().
QString::toULongLong | ( | bool * | ok = nullptr , |
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toULongLong()
Example:
This function ignores leading and trailing whitespace.
Referenced by Widget::toULongLongFunction().
|
inline |
Definition at line 372 of file qstring.h.
Referenced by _q_upper(), QODBCDriverPrivate::adjustCase(), QWindowsFileIconEngine::cacheKey(), QLocalePrivate::codeToScript(), QLocalePrivate::codeToTerritory(), QCalendarBackend::dateTimeToString(), QQuickDialogTestUtils::findDialogButton(), KeyboardModifier::getForEvent< EmscriptenKeyboardEvent >(), Driver::headerFileName(), keysymToQtKey_internal(), QMapboxCommon::mapboxNameForCategory(), QV4::QQmlXMLHttpRequestCtor::method_open(), QV4::QQmlXMLHttpRequestCtor::method_setRequestHeader(), Widget::numberFunction(), CppGenerator::operator()(), QDB2Driver::primaryIndex(), QOCIDriver::primaryIndex(), QSSGQmlUtilities::qmlComponentName(), QDB2Driver::record(), QOCIDriver::record(), QmlTypeRegistrar::runExtract(), QDB2Driver::tables(), QOCIDriver::tables(), TestQString::toUpper(), QLocale::toUpper(), and Widget::toUpperFunction().
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 ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0b", base 2 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.
The string conversion will always happen in the 'C' locale. For locale-dependent conversion use QLocale::toUShort()
Example:
This function ignores leading and trailing whitespace.
Definition at line 658 of file qstring.h.
Referenced by Widget::toUShortFunction().
|
inline |
|
inline |
Definition at line 563 of file qstring.h.
Referenced by QDBusError::QDBusError(), QQuickVisualTestUtils::QQuickApplicationHelper::QQuickApplicationHelper(), QUtcTimeZonePrivate::QUtcTimeZonePrivate(), _q_lower(), _q_upper(), activeConditions(), QSSGQmlUtilities::addResource(), addStartCond(), QCborStreamWriter::append(), QtStringBuilder::appendToByteArray(), buildAndroidProject(), QSSGStageGeneratorBase::buildShaderSourcePass2(), byteArrayFromBuffer(), QTextureFileReader::canRead(), WorkspaceHandlers::clientInitialized(), QmlLsp::codeActionHandler(), computeFaceIndex(), QLowEnergyControllerPrivateWinRT::connectToDevice(), QWindowsMimeHtml::convertFromMime(), convertToEnum(), convertToExtendedType(), QGtk3MenuItem::create(), QRhiD3D11::create(), QRhiMetal::create(), createCameraDevice(), QQuickDragAttachedPrivate::createMimeData(), QtObject::createQmlObject(), QUuid::createUuidV3(), QUuid::createUuidV5(), QQmlTableModel::data(), QQmlDelegateChooser::delegate(), deserializeBlockMemberVar(), deserializeInOutVar(), QmlLsp::QmlLintSuggestions::diagnose(), QNetworkReplyWasmImplPrivate::doSendRequest(), QCtfLibImpl::doTracepoint(), dumpAttributeVariant(), QQmlCustomParser::evaluateEnum(), QODBCResult::exec(), QPSQLDriverPrivate::exec(), execCommand(), QuickTestResult::expectFailContinue(), QFontconfigDatabase::fallbacksForFamily(), formatQtModules(), genVulkanFunctionsH(), genVulkanFunctionsPC(), genVulkanFunctionsPH(), QWaylandMimeHelper::getByteArray(), getDevice(), QNearFieldTargetPrivateImpl::getTagTechnology(), QQnxClipboard::MimeData::hasFormat(), host_name_to_settings_key(), QTextMarkdownImporter::import(), importCompletions(), importImp(), QWaylandInputMethodEventBuilder::indexFromWayland(), QWaylandInputMethodEventBuilder::indexToWayland(), QQmlDelegateModelItemMetaType::initializeMetaObject(), QBasicPlatformVulkanInstance::initInstance(), QQmlPropertyPrivate::initProperty(), QQmlPrivate::initValueLookup(), QuickTestResultPrivate::intern(), QQnxAbstractNavigator::invokeUrl(), isRunning(), QKmsScreenConfig::loadConfig(), loadCubeMap(), QShaderDescriptionPrivate::loadFromStream(), QSSGBufferManager::loadLightmap(), loadRulesFromFile(), QV4::ExecutableCompilationUnit::localCacheFilePath(), QLockFilePrivate::lockFileContents(), QOpenGLDebugLogger::logMessage(), makeCacheKey(), QDBusMessagePrivate::makeLocal(), matches(), QV4::QQmlXMLHttpRequestCtor::method_send(), obtainSDKVersion(), QQmlEngine::offlineStorageDatabaseFilePath(), QMimerSQLDriver::open(), QMYSQLDriver::open(), AndroidAbstractFileEngine::open(), QDBusError::operator=(), operator>>(), Moc::parsePluginData(), QSSGBufferManager::primitivePath(), processNode(), Q_LOGGING_CATEGORY(), qDBusPropertyGet(), qDBusPropertySet(), qFillBufferWithString(), qRelocateResourceFile(), qSaveQmlJSUnitAsCpp(), qt_color_from_string(), RCCResourceLibrary::readFiles(), readInputFile(), QQmlMetaType::registerPluginTypes(), QtQuickControls2Plugin::registerTypes(), removePendingQPropertyBinding(), QFontconfigDatabase::resolveFontFamilyAlias(), QSSGShaderUtils::resolveShader(), QQnxClipboard::MimeData::retrieveData(), QmlTypeRegistrar::runExtract(), runRcc(), QSSGQmlUtilities::sanitizeQmlId(), QDomDocumentPrivate::saveDocument(), QPSQLDriverPrivate::sendQuery(), QQmlTableModel::setData(), QQuickFontValueType::setFeatures(), AndroidAbstractFileEngine::setFileName(), QGstreamerMetaData::setMetaData(), QPdfDocument::setPassword(), QGtk3MenuItem::setText(), QNdefNfcUriRecord::setUri(), QQmlDMAbstractItemModelData::setValue(), QXcbWindow::setWindowIconText(), QGtk3Dialog::show(), QDomDocument::toByteArray(), QDBusMessagePrivate::toDBusMessage(), QIcc::toIccProfile(), JsonOutput::toList(), QQmlPropertyCache::toMetaObjectBuilder(), QNetworkCookie::toRawForm(), toStdString(), QV4::ExecutableCompilationUnit::translateFrom(), QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(), QQmlType::typeName(), ucalTimeZoneDisplayName(), QtQuickControls2Plugin::unregisterTypes(), QQuickMultiEffectPrivate::updateBlurItemsAmount(), QQuickListViewPrivate::updateSectionCriteria(), QtWaylandClient::QWaylandTextInputv1::updateState(), QtWaylandClient::QWaylandTextInputv2::updateState(), QtWaylandClient::QWaylandTextInputv4::updateState(), ModelNodeMetaObject::updateValues(), ModelNodeMetaObject::updateValues(), QFFmpegMetaData::value(), VDMAbstractItemModelDataType::value(), VDMObjectDelegateDataType::value(), QQmlObjectModel::variantValue(), QV4::ModelObject::virtualPut(), waitToFinish(), and RCCFileInfo::writeDataBlob().
|
inline |
Fills the array with the data contained in this QString object. The array is encoded in UTF-16 on platforms where wchar_t is 2 bytes wide (e.g. windows) and in UCS-4 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).
This function returns the actual length of the string in array.
Definition at line 1146 of file qstring.h.
References qToStringViewIgnoringNull(), and QStringView::toWCharArray().
Referenced by QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext(), QQnxInputContext::checkSpelling(), QWindowsFontDatabaseFT::populateFamily(), QWindowsFontDatabase::populateFamily(), qt_getEnglishName(), QWindowsNativeFileDialogBase::setNameFilters(), toSpannableString(), and toStdWString().
|
inline |
Definition at line 380 of file qstring.h.
Referenced by QQuickGridScaledImage::QQuickGridScaledImage(), Parser::addIncludesRecursive(), backendType(), createImageNode(), QQmlJS::Dom::LineWriter::ensureNewline(), fileArchitecture(), filterSpecs(), Parser::findEnumValues(), QUrl::fromUserInput(), getQtLibsFromElf(), QQmlDebugTranslationServicePrivate::getStyleNameForFont(), gradleBuildFlags(), QGeoSatelliteInfoSourceGypsy::init(), isPossiblySvg(), QQuickStackElement::load(), QHostInfo::localDomainName(), maybeEscapeFirstChar(), mergeGradleProperties(), QV4::GlobalFunctions::method_parseInt(), nextField(), Parser::parse(), parseClockValue(), QTextHtmlParser::parseCloseTag(), parseCompOp(), parseFont(), QHttpHeaderParser::parseHeaders(), parseLength(), QT_BEGIN_NAMESPACE::parseLocation(), parseOthers(), parseOtoolLibraryLine(), parseProvider(), parseRenderingHints(), parseTestArgs(), qt_mac_removeAmpersandEscapes(), qt_strippedText(), queryQtPaths(), quick_test_main_with_setup(), reachableSymbols(), readGradleProperties(), QConfFileSettingsPrivate::readIniFile(), QConfFileSettingsPrivate::readIniSection(), QQmlJS::Dom::IndentingLineWriter::reindentAndSplit(), QUrl::setUserInfo(), QAbstractSpinBoxPrivate::stripped(), strippedText(), Widget::trimmedFunction(), updateAndroidManifest(), updateLibsXml(), and QTornOffMenu::updateWindowTitle().
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 6159 of file qstring.cpp.
Referenced by QZipWriterPrivate::addEntry(), QCoreApplicationPrivate::appendApplicationPathToLibraryPaths(), decode(), QXcbScreen::defaultName(), QQmlData::destroyed(), QLCDNumberPrivate::drawString(), filterSpecs(), find_translation(), QStandardPaths::findExecutable(), QmlTypesClassDescription::findType(), QWindowsFontDatabaseBase::fontDefToLOGFONT(), QAndroidInputContext::getCursorCapsMode(), QXcbScreen::getName(), QAndroidInputContext::getTextAfterCursor(), iniChopTrailingSpaces(), leftJustified(), QSysInfo::machineHostName(), QTestPrivate::parseBlackList(), qQmlJSGenerateLoader(), qt_getEnglishName(), qt_mac_removeMnemonics(), QQC2_NAMESPACE::qt_mac_removeMnemonics(), qtModule(), QPlatformTheme::removeMnemonics(), rightJustified(), QSqlRelationalTableModel::selectStatement(), QWindowsNativeFileDialogBase::setNameFilters(), QV4::UrlObject::setProtocol(), QKeySequence::toString(), Widget::truncateFunction(), uuidFromString(), and QV4::UrlCtor::virtualCallAsConstructor().
|
inline |
Returns a Unicode representation of the string.
The result remains valid until the string is modified.
Definition at line 1085 of file qstring.h.
References data().
Referenced by QString(), _q_PKCS12_keygen(), QLocalePrivate::codeToLanguage(), QLocalePrivate::codeToTerritory(), QWindowsMimeText::convertFromMime(), QBuiltInMimes::convertFromMime(), count(), count(), QSQLiteResult::exec(), fromRawData(), fromUcs4(), fromUtf16(), indexOf(), indexOf(), indexOf(), insert(), QTextEngine::itemize(), keysymToQtKey_internal(), QMimeGlobPattern::matchFileName(), operator<<(), parseNumbersArray(), parseNumbersArray(), parseNumbersList(), QTextDocumentPrivate::plainText(), sanitizeNameForDBus(), QQmlJS::Lexer::setCode(), setRawData(), setUnicode(), toDouble(), toDouble(), and RCCFileInfo::writeDataName().
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 6737 of file qstring.cpp.
References QArrayDataPointer< T >::data(), QArrayDataPointer< T >::isMutable(), QArrayData::KeepSize, and QArrayDataPointer< T >::size.
Referenced by QOCIDateTime::QOCIDateTime(), QWinSettingsPrivate::~QWinSettingsPrivate(), arg(), QLastResortMimes::canConvertToMime(), QBluetoothSocketPrivateWinRT::connectToService(), QBluetoothSocketPrivateWinRT::connectToServiceHelper(), QLastResortMimes::convertToMime(), WindowCreationData::create(), createCameraSource(), createChangeNotification(), QWindowsApplication::createMessageWindow(), createOrOpenKey(), QPdfSearchModelPrivate::doSearch(), QDB2Result::exec(), QRhiD3D11::executeCommandBuffer(), QWindowsXpNativeFileDialog::existingDirCallback(), QWindowsFontDatabaseBase::fontDefToLOGFONT(), getDevmode(), QSGRenderLoop::handleContextCreationFailure(), QWindowsSystemProxy::init(), init_platform(), QWin32PrintEnginePrivate::initialize(), launchMail(), SourceResolver::load(), QSysInfo::machineHostName(), mailCommand(), QFileDialogPrivate::maxNameLength(), mkDir(), QOCIDriver::open(), openKey(), openWebBrowser(), qToTChar(), QtPrivate::qustrchr(), QWinSettingsPrivate::readKey(), readSymLink(), QWindowsInputContext::reconvertString(), QWindowsContext::registerWindowClass(), QWinSettingsPrivate::remove(), runMoc(), QWindowsNativeFileDialogBase::setLabelText(), QWindowsNativeFileDialogBase::setWindowTitle(), QWindowsBaseWindow::setWindowTitle_sys(), shellExecute(), QWindowsNativeFileDialogBase::shellItem(), showParserMessage(), QSystemLocalePrivate::toCurrencyString(), and QSSGMesh::MeshInternal::writeMeshData().
|
static |
Equivalent method to asprintf(), but takes a va_list ap instead a list of variable arguments. See the asprintf() 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 7099 of file qstring.cpp.
References append_utf8(), arg, base, QLocaleData::c(), QLocaleData::CapitalEorX, cb, ch, d, QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocaleData::DFSignificantDigits, QLocaleData::doubleToString(), form, fromLatin1(), QChar::fromUcs2(), fromUtf8(), i, QtMiscUtils::isAsciiDigit(), QtMiscUtils::isAsciiUpper(), QLocaleData::LeftAdjusted, leftJustified(), lm_h, lm_hh, lm_j, lm_l, lm_L, lm_ll, lm_none, lm_t, lm_z, QLocaleData::longLongToString(), parse_field_width(), parse_flag_characters(), parse_length_modifier(), qstrlen(), qstrnlen(), rightJustified(), setUtf16(), QLocaleData::ShowBase, QtMiscUtils::toAsciiLower(), and QLocaleData::unsLongLongToString().
Referenced by asprintf(), qErrnoWarning(), qErrnoWarning(), qffmpegLogCallback(), qt_message(), and QByteArray::qvsnprintf().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
related |
\macro QStringLiteral(str)
The macro generates the data for a QString out of the string literal str at compile time. Creating a QString from it is free in this case, and the generated string data is stored in the read-only segment of the compiled object file.
If you have code that looks like this:
then a temporary QString will be created to be passed as the {hasAttribute} function parameter. This can be quite expensive, as it involves a memory allocation and the copy/conversion of the data into QString's internal encoding.
This cost can be avoided by using QStringLiteral instead:
In this case, QString's internal data will be generated at compile time; no conversion or allocation will occur at runtime.
Using QStringLiteral instead of a double quoted plain C++ string literal can significantly speed up creation of QString instances from data known at compile time.
{u} in those cases. It is optional otherwise.Literal operator that creates a QString out of the first size characters in the char16_t string literal str.
The QString is created at compile time, and the generated string data is stored in the read-only segment of the compiled object file. Duplicate literals may share the same read-only memory. This functionality is interchangeable with QStringLiteral, but saves typing when many string literals are present in the code.
The following code creates a QString:
Definition at line 1475 of file qstring.h.
References str.
Returns a string which is the result of concatenating s1 and s2 (s1 is converted to Unicode using the QString::fromUtf8() function).
Definition at line 1308 of file qstring.h.
References fromUtf8(), and s2.
Returns a string which is the result of concatenating s1 and s2 (s2 is converted to Unicode using the QString::fromUtf8() function).
Definition at line 1304 of file qstring.h.
References s2.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
related |
Writes the given string to the specified stream.
Definition at line 9318 of file qstring.cpp.
References QSysInfo::BigEndian, QDataStream::BigEndian, QSysInfo::ByteOrder, constData(), isNull(), out, size(), str, toLatin1(), and unicode().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
related |
Reads a string from the specified stream into the given string.
Definition at line 9350 of file qstring.cpp.
References QSysInfo::BigEndian, QDataStream::BigEndian, blockSize, QSysInfo::ByteOrder, clear(), data(), fromLatin1(), qMin(), QDataStream::ReadCorruptData, QDataStream::ReadPastEnd, resize(), and str.
|
friend |
|
friend |
Definition at line 964 of file qstring.h.
Referenced by QByteArray::operator+(), QByteArray::operator+(), QByteArray::operator+(), QByteArray::operator+(), and QByteArray::operator+().
|
friend |
Definition at line 963 of file qstring.h.
Referenced by arg(), count(), count(), endsWith(), endsWith(), indexOf(), indexOf(), indexOf(), insert(), insert(), isRightToLeft(), lastIndexOf(), lastIndexOf(), replace(), split(), startsWith(), startsWith(), and toDouble().