42 #include <QtCore/qversionnumber.h>
43 #include <QtCore/qhash.h>
44 #include <QtCore/private/qlocale_tools_p.h>
45 #include <QtCore/qcollator.h>
47 #ifndef QT_NO_DATASTREAM
48 # include <QtCore/qdatastream.h>
51 #ifndef QT_NO_DEBUG_STREAM
52 # include <QtCore/qdebug.h>
182 if (m_segments.isUsingPointer())
183 return *m_segments.pointer_segments;
186 result.resize(segmentCount());
187 for (
int i = 0;
i < segmentCount(); ++
i)
222 for (
i = m_segments.size();
i; --
i)
223 if (m_segments.at(
i - 1) != 0)
243 if (segmentCount() >
other.segmentCount())
245 for (
int i = 0;
i < segmentCount(); ++
i) {
246 if (segmentAt(
i) !=
other.segmentAt(
i))
269 if (
Q_LIKELY(!
v1.m_segments.isUsingPointer() && !
v2.m_segments.isUsingPointer())) {
271 const qint8 *ptr1 =
v1.m_segments.inline_segments + InlineSegmentStartIdx;
272 const qint8 *ptr2 =
v2.m_segments.inline_segments + InlineSegmentStartIdx;
273 commonlen = qMin(
v1.m_segments.size(),
274 v2.m_segments.size());
275 for (
int i = 0;
i < commonlen; ++
i)
276 if (
int x = ptr1[
i] - ptr2[
i])
279 commonlen = qMin(
v1.segmentCount(),
v2.segmentCount());
280 for (
int i = 0;
i < commonlen; ++
i) {
281 if (
v1.segmentAt(
i) !=
v2.segmentAt(
i))
282 return v1.segmentAt(
i) -
v2.segmentAt(
i);
288 if (
v1.segmentCount() > commonlen) {
290 if (
v1.segmentAt(commonlen) != 0)
291 return v1.segmentAt(commonlen);
294 }
else if (
v2.segmentCount() > commonlen) {
296 if (
v2.segmentAt(commonlen) != 0)
297 return -
v2.segmentAt(commonlen);
317 int commonlen = qMin(
v1.segmentCount(),
v2.segmentCount());
319 for (
i = 0;
i < commonlen; ++
i) {
320 if (
v1.segmentAt(
i) !=
v2.segmentAt(
i))
406 #if QT_STRINGVIEW_LEVEL < 2
466 const char *lastGoodEnd =
start;
467 const char *endOfString =
string.end();
477 }
while (
start < endOfString && (
end < endOfString && *
end ==
'.'));
480 *suffixIndex = int(lastGoodEnd -
string.
begin());
485 void QVersionNumber::SegmentStorage::setVector(
int len,
int maj,
int min,
int mic)
489 pointer_segments->data()[0] = maj;
491 pointer_segments->data()[1] = min;
493 pointer_segments->data()[2] = mic;
498 #ifndef QT_NO_DATASTREAM
524 if (!
version.m_segments.isUsingPointer())
526 in >> *
version.m_segments.pointer_segments;
531 #ifndef QT_NO_DEBUG_STREAM
535 debug.nospace().noquote();
536 debug <<
"QVersionNumber(" <<
version.toString() <<
")";
552 for (
int i = 0;
i <
key.segmentCount(); ++
i)
553 seed =
hash(seed,
key.segmentAt(
i));
691 #ifndef QT_NO_DATASTREAM
720 #ifndef QT_NO_DEBUG_STREAM
733 debug.noquote() <<
"invalid";
small capitals from c petite p scientific i
[1]
The QDataStream class provides serialization of binary data to a QIODevice.
operator>>(QDataStream &ds, qfloat16 &f)
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
template< typename Enum > size_t qHash(QFlags< Enum > flags, size_t seed=0) noexcept
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
void resize(qsizetype size)
void append(parameter_type t)
The QString class provides a Unicode character string.
static QString number(int, int base=10)
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
The QTypeRevision class contains a lightweight representation of a version number with two 8-bit segm...
static constexpr QTypeRevision fromEncodedVersion(Integer value)
constexpr bool hasMinorVersion() const
constexpr bool hasMajorVersion() const
constexpr Integer toEncodedVersion() const
constexpr quint8 minorVersion() const
constexpr quint8 majorVersion() const
The QVersionNumber class contains a version number with an arbitrary number of segments.
Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const noexcept
static Q_CORE_EXPORT QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2)
QVersionNumber() noexcept
static Q_CORE_EXPORT QVersionNumber fromString(const QString &string, int *suffixIndex=nullptr)
Q_CORE_EXPORT QString toString() const
int segmentCount() const noexcept
Q_CORE_EXPORT QVersionNumber normalized() const
int segmentAt(int index) const noexcept
static Q_CORE_EXPORT int compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept
QHash< int, QWidget * > hash
[35multi]
EGLOutputLayerEXT EGLint EGLAttrib value
QT_BEGIN_NAMESPACE typedef signed char qint8
GLint GLfloat GLfloat GLfloat v2
GLint GLint GLint GLint GLint x
[0]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QTextStream out(stdout)
[7]
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.