QtPrivate Namespace

Classes

Functions

int compareMemory(QByteArrayView lhs, QByteArrayView rhs)
int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QStringView lhs, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QStringView lhs, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QLatin1StringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QLatin1StringView lhs, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QLatin1StringView lhs, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QBasicUtf8StringView<false> lhs = false, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QBasicUtf8StringView<false> lhs = false, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)
int compareStrings(QBasicUtf8StringView<false> lhs = false, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)
QByteArray convertToLatin1(QStringView string)
QByteArray convertToLocal8Bit(QStringView string)
QString convertToQString(QAnyStringView string)
QList<uint> convertToUcs4(QStringView string)
QByteArray convertToUtf8(QStringView string)
QBindingStatus *getBindingStatus(QBindingStatusAccessToken)
bool isAnyBindingEvaluating()
bool isRightToLeft(QStringView string)
bool isValidUtf8(QByteArrayView s)
const char16_t *qustrchr(QStringView str, char16_t c)
bool shouldLogToStderr()

Classes

class RefCount

class ResultItem

class ResultIteratorBase

class ResultStoreBase

Function Documentation

[noexcept] QLatin1StringView trimmed(QLatin1StringView s)

[noexcept] QStringView trimmed(QStringView s)

\internal \since 5.10

Returns s with whitespace removed from the start and the end.

Whitespace means any character for which QChar::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.

See also QString::trimmed(), QStringView::trimmed(), and QLatin1StringView::trimmed().

[noexcept] bool startsWith(QLatin1StringView haystack, QLatin1StringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool startsWith(QLatin1StringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool startsWith(QStringView haystack, QLatin1StringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\since5.10 \since 5.10 \since 5.10 \since 5.10 \internal

Returns true if haystack starts with needle, otherwise returns false.

If cs is Qt::CaseSensitive (the default), the search is case-sensitive; otherwise the search is case-insensitive.

See also QtPrivate::endsWith(), QString::endsWith(), QStringView::endsWith(), and QLatin1StringView::endsWith().

[noexcept] bool endsWith(QLatin1StringView haystack, QLatin1StringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool endsWith(QLatin1StringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool endsWith(QStringView haystack, QLatin1StringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

[noexcept] bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\since5.10 \since 5.10 \since 5.10 \since 5.10 \internal

Returns true if haystack ends with needle, otherwise returns false.

If cs is Qt::CaseSensitive (the default), the search is case-sensitive; otherwise the search is case-insensitive.

See also QtPrivate::startsWith(), QString::endsWith(), QStringView::endsWith(), and QLatin1StringView::endsWith().

int QtPrivate::compareMemory(QByteArrayView lhs, QByteArrayView rhs)

\internal

[noexcept] int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 5.10

Returns an integer that compares to 0 as lhs compares to rhs.

If cs is Qt::CaseSensitive (the default), the comparison is case-sensitive; otherwise the comparison is case-insensitive.

Case-sensitive comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-visible strings with QString::localeAwareCompare().

See also Comparing Strings.

[noexcept] int compareStrings(QStringView lhs, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 5.10

This is an overloaded function.

Returns an integer that compares to 0 as lhs compares to rhs.

If cs is Qt::CaseSensitive (the default), the comparison is case-sensitive; otherwise the comparison is case-insensitive.

Case-sensitive comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-visible strings with QString::localeAwareCompare().

See also Comparing Strings.

[noexcept] int compareStrings(QStringView lhs, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 6.0

This is an overloaded function.

[noexcept] int compareStrings(QLatin1StringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 5.10

This is an overloaded function.

[noexcept] int compareStrings(QLatin1StringView lhs, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 5.10

This is an overloaded function.

Returns an integer that compares to 0 as lhs compares to rhs.

If cs is Qt::CaseSensitive (the default), the comparison is case-sensitive; otherwise the comparison is case-insensitive.

Case-sensitive comparison is based exclusively on the numeric Latin-1 values of the characters and is very fast, but is not what a human would expect. Consider sorting user-visible strings with QString::localeAwareCompare().

See also Comparing Strings.

[noexcept] int compareStrings(QLatin1StringView lhs, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 6.0

This is an overloaded function.

[noexcept] int compareStrings(QBasicUtf8StringView<false> lhs = false, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 6.0

This is an overloaded function.

[noexcept] int compareStrings(QBasicUtf8StringView<false> lhs = false, QLatin1StringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 6.0

This is an overloaded function.

[noexcept] int compareStrings(QBasicUtf8StringView<false> lhs = false, QBasicUtf8StringView<false> rhs = false, Qt::CaseSensitivity cs = Qt::CaseSensitive)

\internal\since 6.0

This is an overloaded function.

QByteArray convertToLatin1(QStringView string)

\since5.10 \internal

Returns a Latin-1 representation of string as a QByteArray.

The behavior is undefined if string contains non-Latin1 characters.

See also QString::toLatin1(), QStringView::toLatin1(), QtPrivate::convertToUtf8(), QtPrivate::convertToLocal8Bit(), and QtPrivate::convertToUcs4().

QByteArray convertToLocal8Bit(QStringView string)

\since5.10 \internal

Returns a local 8-bit representation of string as a QByteArray.

On Unix systems this is equivalent to toUtf8(), on Windows the systems current code page is being used.

The behavior is undefined if string contains characters not supported by the locale's 8-bit encoding.

See also QString::toLocal8Bit() and QStringView::toLocal8Bit().

QString convertToQString(QAnyStringView string)

\since6.0 \internal

Returns a UTF-16 representation of string as a QString.

See also QString::toLatin1(), QStringView::toLatin1(), QtPrivate::convertToUtf8(), QtPrivate::convertToLocal8Bit(), and QtPrivate::convertToUcs4().

QList<uint> convertToUcs4(QStringView string)

\since5.10 \internal

Returns a UCS-4/UTF-32 representation of 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.

See also QString::toUcs4(), QStringView::toUcs4(), QtPrivate::convertToLatin1(), QtPrivate::convertToLocal8Bit(), and QtPrivate::convertToUtf8().

QByteArray convertToUtf8(QStringView string)

\since5.10 \internal

Returns a UTF-8 representation of string as a QByteArray.

UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QStringView.

See also QString::toUtf8() and QStringView::toUtf8().

QBindingStatus *QtPrivate::getBindingStatus(QBindingStatusAccessToken)

\internalReturns the binding statusof the current thread.

bool QtPrivate::isAnyBindingEvaluating()

\internalThis function can be used to detect whether we are currently evaluating a binding. This can e.g. be used to defer the allocation of extra data for a QPropertyBindingStorage in a getter. Note that this function accesses TLS storage, and is therefore soemwhat costly to call.

[noexcept] bool isRightToLeft(QStringView string)

\since5.11 \internal

Returns true if the string is read right to left.

See also QString::isRightToLeft().

[noexcept] bool QtPrivate::isValidUtf8(QByteArrayView s)

\internal

[noexcept] const char16_t *QtPrivate::qustrchr(QStringView str, char16_t c)

\internal

Searches for character c in the string str and returns a pointer to it. Unlike strchr() and wcschr() (but like glibc's strchrnul()), if the character is not found, this function returns a pointer to the end of the string – that is, str.end().

bool QtPrivate::shouldLogToStderr()

Returns true if logging stderr should be ensured.

This is normally the case if stderr has a console attached, but may be overridden by the user by setting the QT_FORCE_STDERR_LOGGING environment variable to 1.

\internal

See also stderrHasConsoleAttached().