QOperatingSystemVersion: Add debug operator
Change-Id: Ibc942196bef0edc74f34501830fc83cb64259e39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
parent
29b38bea45
commit
34aa7a18af
@ -43,6 +43,7 @@
|
||||
#endif
|
||||
|
||||
#include <qversionnumber.h>
|
||||
#include <qdebug.h>
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#include <private/qjni_p.h>
|
||||
@ -510,4 +511,16 @@ const QOperatingSystemVersion QOperatingSystemVersion::AndroidNougat_MR1 =
|
||||
const QOperatingSystemVersion QOperatingSystemVersion::AndroidOreo =
|
||||
QOperatingSystemVersion(QOperatingSystemVersion::Android, 8, 0);
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
QDebug operator<<(QDebug debug, const QOperatingSystemVersion &ov)
|
||||
{
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace();
|
||||
debug << "QOperatingSystemVersion(" << ov.name()
|
||||
<< ", " << ov.majorVersion() << '.' << ov.minorVersion()
|
||||
<< '.' << ov.microVersion() << ')';
|
||||
return debug;
|
||||
}
|
||||
#endif // !QT_NO_DEBUG_STREAM
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -128,6 +128,11 @@ private:
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QOperatingSystemVersion, QT_VERSION < QT_VERSION_CHECK(6, 0, 0) ? Q_RELOCATABLE_TYPE : Q_PRIMITIVE_TYPE);
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
class QDebug;
|
||||
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QOperatingSystemVersion &ov);
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QOPERATINGSYSTEMVERSION_H
|
||||
|
Loading…
Reference in New Issue
Block a user