![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qversionnumber.h>
Public Types | |
template<typename Integer > | |
using | if_valid_segment_type = typename std::enable_if< std::is_integral< Integer >::value, bool >::type |
template<typename Integer > | |
using | if_valid_value_type = typename std::enable_if< std::is_integral< Integer >::value &&(sizeof(Integer) > sizeof(quint16)||(sizeof(Integer)==sizeof(quint16) &&!std::is_signed< Integer >::value)), bool >::type |
Public Member Functions | |
constexpr | QTypeRevision ()=default |
Produces an invalid revision. | |
constexpr bool | hasMajorVersion () const |
Returns true if the major version is known, otherwise false. | |
constexpr quint8 | majorVersion () const |
Returns the major version encoded in the revision. | |
constexpr bool | hasMinorVersion () const |
Returns true if the minor version is known, otherwise false. | |
constexpr quint8 | minorVersion () const |
Returns the minor version encoded in the revision. | |
constexpr bool | isValid () const |
Returns true if the major version or the minor version is known, otherwise false. | |
template<typename Integer , if_valid_value_type< Integer > = true> | |
constexpr Integer | toEncodedVersion () const |
Transforms the revision into an integer value, encoding the minor version into the least significant byte, and the major version into the second least significant byte. | |
Static Public Member Functions | |
template<typename Integer , if_valid_segment_type< Integer > = true> | |
static constexpr bool | isValidSegment (Integer segment) |
Returns true if the given number can be used as either major or minor version in a QTypeRevision. | |
template<typename Major , typename Minor , if_valid_segment_type< Major > = true, if_valid_segment_type< Minor > = true> | |
static constexpr QTypeRevision | fromVersion (Major majorVersion, Minor minorVersion) |
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a valid segments. | |
template<typename Major , if_valid_segment_type< Major > = true> | |
static constexpr QTypeRevision | fromMajorVersion (Major majorVersion) |
Produces a QTypeRevision from the given majorVersion with an invalid minor version. | |
template<typename Minor , if_valid_segment_type< Minor > = true> | |
static constexpr QTypeRevision | fromMinorVersion (Minor minorVersion) |
Produces a QTypeRevision from the given minorVersion with an invalid major version. | |
template<typename Integer , if_valid_value_type< Integer > = true> | |
static constexpr QTypeRevision | fromEncodedVersion (Integer value) |
Produces a QTypeRevision from the given value. | |
static constexpr QTypeRevision | zero () |
Produces a QTypeRevision with major and minor version {0}. | |
Friends | |
constexpr bool | operator== (QTypeRevision lhs, QTypeRevision rhs) |
constexpr bool | operator!= (QTypeRevision lhs, QTypeRevision rhs) |
constexpr bool | operator< (QTypeRevision lhs, QTypeRevision rhs) |
constexpr bool | operator> (QTypeRevision lhs, QTypeRevision rhs) |
constexpr bool | operator<= (QTypeRevision lhs, QTypeRevision rhs) |
constexpr bool | operator>= (QTypeRevision lhs, QTypeRevision rhs) |
Related Symbols | |
(Note that these are not member symbols.) | |
QDataStream & | operator<< (QDataStream &out, const QTypeRevision &revision) |
QDataStream & | operator>> (QDataStream &in, QTypeRevision &revision) |
\inmodule QtCore
The QTypeRevision class contains a lightweight representation of a version number with two 8-bit segments, major and minor, either of which can be unknown.
Use this class to describe revisions of a type. Compatible revisions can be expressed as increments of the minor version. Breaking changes can be expressed as increments of the major version. The return values of \l QMetaMethod::revision() and \l QMetaProperty::revision() can be passed to \l QTypeRevision::fromEncodedVersion(). The resulting major and minor versions specify in which Qt versions the properties and methods were added.
Definition at line 318 of file qversionnumber.h.
using QTypeRevision::if_valid_segment_type = typename std::enable_if< std::is_integral<Integer>::value, bool>::type |
Definition at line 322 of file qversionnumber.h.
using QTypeRevision::if_valid_value_type = typename std::enable_if< std::is_integral<Integer>::value && (sizeof(Integer) > sizeof(quint16) || (sizeof(Integer) == sizeof(quint16) && !std::is_signed<Integer>::value)), bool>::type |
Definition at line 326 of file qversionnumber.h.
|
constexprdefault |
Produces an invalid revision.
Referenced by fromEncodedVersion(), fromMajorVersion(), fromMinorVersion(), fromVersion(), and zero().
|
inlinestaticconstexpr |
Produces a QTypeRevision from the given value.
value encodes both the minor and major versions in the least significant and second least significant byte, respectively.
value must not have any bits outside the least significant two bytes set. Integer
needs to be at least 16 bits wide, and must not have a sign bit in the least significant 16 bits.
Definition at line 366 of file qversionnumber.h.
References QTypeRevision(), Integer, and Q_ASSERT.
Referenced by availableRevisions(), QmlTypesClassDescription::collect(), collectExtraVersions(), isAllowedInMajorVersion(), isRevisionAllowed(), QQmlPropertyData::load(), QQmlPropertyData::load(), operator>>(), QQmlPrivate::revisionClassInfo(), QQmlPrivate::revisionClassInfos(), and QmlTypeRegistrar::write().
|
inlinestaticconstexpr |
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
majorVersion needs to be a valid segment.
Definition at line 352 of file qversionnumber.h.
References QTypeRevision(), isValidSegment(), majorVersion(), and Q_ASSERT.
Referenced by assignVersions(), QmlIR::IRBuilder::extractVersion(), QQmlMetaTypeData::propertyCache(), qmlProtectModule(), qmlRegisterAnonymousSequentialContainer(), qmlRegisterNamespaceAndRevisions(), QQmlPrivate::qmlRegisterSequenceAndRevisions(), QQmlPrivate::qmlRegisterSingletonAndRevisions(), QQmlPrivate::qmlRegisterTypeAndRevisions(), QQmlPrivate::qmlRegisterTypeAndRevisions< QQmlTypeNotAvailable, void >(), resolveImport(), and resolveModuleVersion().
|
inlinestaticconstexpr |
Produces a QTypeRevision from the given minorVersion with an invalid major version.
minorVersion needs to be a valid segment.
Definition at line 359 of file qversionnumber.h.
References QTypeRevision(), isValidSegment(), minorVersion(), and Q_ASSERT.
Referenced by Moc::parsePropertyAttributes(), Moc::parseRevision(), QQmlPrivate::qmlregister(), qmlRegisterAnonymousType(), qmlRegisterCustomType(), qmlRegisterExtendedUncreatableType(), qmlRegisterRevision(), qmlRegisterType(), qmlRegisterUncreatableType(), QQmlTypeModuleVersion::type(), and QQmlImports::validVersion().
|
inlinestaticconstexpr |
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a valid segments.
Definition at line 344 of file qversionnumber.h.
References QTypeRevision(), isValidSegment(), majorVersion(), minorVersion(), and Q_ASSERT.
Referenced by assignVersions(), QmlIR::IRBuilder::extractVersion(), QQmlMetaType::latestModuleVersion(), QQmlMetaType::matchingModuleVersion(), Moc::parseRevision(), parseVersion(), parseVersion(), QQmlMetaTypeData::propertyCache(), QQmlPrivate::qmlregister(), qmlRegisterAnonymousType(), qmlRegisterCustomExtendedType(), qmlRegisterCustomType(), qmlRegisterExtendedType(), qmlRegisterExtendedType(), qmlRegisterExtendedUncreatableType(), qmlRegisterInterface(), qmlRegisterModule(), qmlRegisterRevision(), qmlRegisterSingletonType(), qmlRegisterSingletonType(), qmlRegisterSingletonType(), qmlRegisterSingletonType(), qmlRegisterType(), qmlRegisterType(), qmlRegisterType< void >(), qmlRegisterUncreatableMetaObject(), qmlRegisterUncreatableType(), qmlTypeId(), resolveImport(), QQuickStyle::setFallbackStyle(), QQuickStyle::setStyle(), and uniqueRevisions().
|
inlineconstexpr |
Returns true if the major version is known, otherwise false.
Definition at line 376 of file qversionnumber.h.
Referenced by assignVersions(), QQmlType::availableInVersion(), findCompositeSingletons(), QQmlImportInstance::getVersionedScripts(), isAllowedInMajorVersion(), QQmlPropertyCache::isAllowedInRevision(), isValid(), isVersionAllowed(), QQmlImportDatabase::lockModule(), QQmlMetaType::matchingModuleVersion(), QQmlMetaType::moduleImports(), operator<<(), QQmlMetaTypeData::propertyCache(), QQmlMetaType::protectModule(), qQmlResolveImportPaths(), QQmlJSScope::qualifiedNameFrom(), QQmlImportInstance::resolveType(), QQmlMetaType::typeModule(), uniqueRevisions(), and QQmlTypeLoader::Blob::updateQmldir().
|
inlineconstexpr |
Returns true if the minor version is known, otherwise false.
Definition at line 379 of file qversionnumber.h.
Referenced by assignVersions(), QQmlType::availableInVersion(), QQmlImportInstance::getVersionedScripts(), QQmlPropertyCache::isAllowedInRevision(), isValid(), isVersionAllowed(), QQmlMetaType::matchingModuleVersion(), operator<<(), QQmlMetaTypeData::propertyCache(), qQmlResolveImportPaths(), QQmlJSScope::qualifiedNameFrom(), and QQmlMetaType::registerModule().
|
inlineconstexpr |
Returns true if the major version or the minor version is known, otherwise false.
Definition at line 382 of file qversionnumber.h.
References hasMajorVersion(), and hasMinorVersion().
Referenced by QQmlImports::addFileImport(), QQmlImports::addLibraryImport(), QmlTypesClassDescription::collect(), QQmlPropertyCache::createStandalone(), QQmlPluginImporter::importDynamicPlugin(), QQmlPluginImporter::importPlugins(), QQmlPluginImporter::importStaticPlugin(), isRevisionAllowed(), QQmlImportDatabase::lockModule(), QQmlDirParser::parse(), Moc::parseSignals(), Moc::parseSlots(), QQmlPrivate::qmlregister(), QQuickStylePlugin::registerTypes(), QQmlTypeLoader::Blob::updateQmldir(), QQmlImports::updateQmldirContent(), QQmlImports::validVersion(), and QmlTypeRegistrar::write().
|
inlinestaticconstexpr |
Returns true if the given number can be used as either major or minor version in a QTypeRevision.
The valid range for segment is {>=
0} and {<
255}.
Definition at line 333 of file qversionnumber.h.
References Integer.
Referenced by fromMajorVersion(), fromMinorVersion(), fromVersion(), Moc::parsePropertyAttributes(), Moc::parseRevision(), and QQmlTypeModuleVersion::type().
|
inlineconstexpr |
Returns the major version encoded in the revision.
Definition at line 377 of file qversionnumber.h.
Referenced by assignVersions(), QQmlType::availableInVersion(), checkRegistration(), QQuickDesignerSupportItems::createPrimitive(), findCompositeSingletons(), QQmlMetaTypeData::findTypeModule(), fromMajorVersion(), fromVersion(), getTypeModule(), QQmlImportInstance::getVersionedScripts(), isAllowedInMajorVersion(), QQmlPropertyCache::isAllowedInRevision(), isVersionAllowed(), QQmlMetaType::matchingModuleVersion(), namespaceContainsRegistrations(), operator<<(), operator<<(), QQmlMetaTypeData::propertyCache(), qQmlResolveImportPaths(), QQmlJSScope::qualifiedNameFrom(), QQmlImportInstance::resolveType(), QQmlImportNamespace::resolveType(), uniqueRevisions(), QQmlImports::versionString(), and QmlTypeRegistrar::write().
|
inlineconstexpr |
Returns the minor version encoded in the revision.
Definition at line 380 of file qversionnumber.h.
Referenced by QQmlTypeModule::add(), assignVersions(), QQmlType::availableInVersion(), QQuickDesignerSupportItems::createPrimitive(), findCompositeSingletons(), fromMinorVersion(), fromVersion(), QQmlImportInstance::getVersionedScripts(), QQmlPropertyCache::isAllowedInRevision(), isVersionAllowed(), QQmlMetaType::matchingModuleVersion(), operator<<(), operator<<(), QQmlMetaTypeData::propertyCache(), qQmlResolveImportPaths(), QQmlJSScope::qualifiedNameFrom(), QQmlMetaType::registerModule(), QQmlImportInstance::resolveType(), QQmlImportNamespace::resolveType(), uniqueRevisions(), QQmlImports::versionString(), and QmlTypeRegistrar::write().
Transforms the revision into an integer value, encoding the minor version into the least significant byte, and the major version into the second least significant byte.
Integer
needs to be at least 16 bits wide, and must not have a sign bit in the least significant 16 bits.
Definition at line 385 of file qversionnumber.h.
References Integer.
Referenced by operator<<(), Moc::parsePropertyAttributes(), Moc::parseSignals(), Moc::parseSlots(), and Moc::testFunctionRevision().
|
inlinestaticconstexpr |
Produces a QTypeRevision with major and minor version {0}.
Definition at line 372 of file qversionnumber.h.
References QTypeRevision().
Referenced by QV4::CompiledData::Import::Import(), QQmlImports::addInlineComponentImport(), QQmlPropertyCacheAliasCreator< ObjectContainer >::appendAliasesToPropertyCache(), QQmlPropertyCacheCreator< ObjectContainer >::createMetaObject(), QQmlPropertyCache::createStandalone(), QQmlPropertyData::hasRevision(), QQmlPropertyCache::isAllowedInRevision(), isRevisionAllowed(), qmlRegisterAnonymousSequentialContainer(), qmlRegisterAnonymousType(), qmlRegisterCustomExtendedType(), qmlRegisterCustomType(), qmlRegisterExtendedType(), qmlRegisterExtendedType(), qmlRegisterExtendedUncreatableType(), qmlRegisterSingletonType(), qmlRegisterSingletonType(), qmlRegisterSingletonType(), qmlRegisterType(), qmlRegisterType< void >(), qmlRegisterUncreatableMetaObject(), qmlRegisterUncreatableType(), and QQuickTableViewPrivate::resolveImportVersion().
|
friend |
Definition at line 395 of file qversionnumber.h.
|
friend |
Definition at line 400 of file qversionnumber.h.
|
related |
Writes the revision revision to stream out.
Definition at line 683 of file qversionnumber.cpp.
References out, and toEncodedVersion().
|
friend |
Definition at line 426 of file qversionnumber.h.
|
friend |
Definition at line 390 of file qversionnumber.h.
|
friend |
Definition at line 421 of file qversionnumber.h.
|
friend |
Definition at line 431 of file qversionnumber.h.
|
related |
Reads a revision from stream in and stores it in revision.
Definition at line 695 of file qversionnumber.cpp.
References fromEncodedVersion().