Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtyperevision.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <QtCore/qtyperevision.h>
5#include <QtCore/qhashfunctions.h>
6
7#ifndef QT_NO_DATASTREAM
8# include <QtCore/qdatastream.h>
9#endif
10
11#ifndef QT_NO_DEBUG_STREAM
12# include <QtCore/qdebug.h>
13#endif
14
15#include <algorithm>
16#include <limits>
17
19
21
22
157#ifndef QT_NO_DATASTREAM
166{
167 return out << revision.toEncodedVersion<quint16>();
168}
169
178{
180 in >> value;
182 return in;
183}
184#endif
185
186#ifndef QT_NO_DEBUG_STREAM
188{
189 QDebugStateSaver saver(debug);
190 if (revision.hasMajorVersion()) {
191 if (revision.hasMinorVersion())
192 debug.nospace() << revision.majorVersion() << '.' << revision.minorVersion();
193 else
194 debug.nospace().noquote() << revision.majorVersion() << ".x";
195 } else {
196 if (revision.hasMinorVersion())
197 debug << revision.minorVersion();
198 else
199 debug.noquote() << "invalid";
200 }
201 return debug;
202}
203#endif
204
212size_t qHash(const QTypeRevision &key, size_t seed)
213{
214 return qHash(key.toEncodedVersion<quint16>(), seed);
215}
216
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtCore
\inmodule QtCore
size_t qHash(const QTypeRevision &key, size_t seed)
\inmodule QtCore
constexpr bool hasMinorVersion() const
Returns true if the minor version is known, otherwise false.
constexpr bool hasMajorVersion() const
Returns true if the major version is known, otherwise false.
constexpr quint8 minorVersion() const
Returns the minor version encoded in the revision.
static constexpr QTypeRevision fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given value.
constexpr Integer toEncodedVersion() const
Transforms the revision into an integer value, encoding the minor version into the least significant ...
constexpr quint8 majorVersion() const
Returns the major version encoded in the revision.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1390
GLuint64 key
GLuint in
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
QDataStream & operator>>(QDataStream &in, QTypeRevision &revision)
QDataStream & operator<<(QDataStream &out, const QTypeRevision &revision)
unsigned short quint16
Definition qtypes.h:48
QTextStream out(stdout)
[7]