From 789929f939a60462373beae37ab4373809095cff Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 22 Jan 2020 13:12:56 +0100 Subject: Use QTypeRevision for all versions and revisions In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale --- src/quick/items/qquicktableview.cpp | 8 +++++--- src/quick/items/qquicktableview_p_p.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 66e89f0a09..496aea73d1 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -2121,15 +2121,17 @@ void QQuickTableViewPrivate::fixup(QQuickFlickablePrivate::AxisData &data, qreal QQuickFlickablePrivate::fixup(data, minExtent, maxExtent); } -int QQuickTableViewPrivate::resolveImportVersion() +QTypeRevision QQuickTableViewPrivate::resolveImportVersion() { const auto data = QQmlData::get(q_func()); if (!data || !data->propertyCache) - return 0; + return QTypeRevision::zero(); const auto cppMetaObject = data->propertyCache->firstCppMetaObject(); const auto qmlTypeView = QQmlMetaType::qmlType(cppMetaObject); - return qmlTypeView.minorVersion(); + + // TODO: did we rather want qmlTypeView.revision() here? + return qmlTypeView.metaObjectRevision(); } void QQuickTableViewPrivate::createWrapperModel() diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h index c629ae0a5d..03fe019916 100644 --- a/src/quick/items/qquicktableview_p_p.h +++ b/src/quick/items/qquicktableview_p_p.h @@ -395,7 +395,7 @@ public: void scheduleRebuildTable(QQuickTableViewPrivate::RebuildOptions options); - int resolveImportVersion(); + QTypeRevision resolveImportVersion(); void createWrapperModel(); void initItemCallback(int modelIndex, QObject *item); -- cgit v1.2.3