From 7910d9d27d4f6c20734c05fcc9ae6f5237fd19d6 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Sat, 23 Jun 2018 12:34:03 +0200 Subject: QQmlDelegateModel: remove rows and columns properties This change reverts 59a9c7c3d9ed. Adding support for rows and columns to a QQmlDelegateModel is no longer needed now that TableView will use QQmlTableInstanceModel. Besides, QQmlDelegateModel was designed from the ground up to only support list models, so just adding those properties was a bit half-baked. Change-Id: I1d58355d98999dc6a2a0b88ea64852c9eb918447 Reviewed-by: Mitch Curtis --- src/qml/types/qqmldelegatemodel.cpp | 29 ----------------------------- src/qml/types/qqmldelegatemodel_p.h | 7 ------- src/qml/types/qqmlmodelsmodule.cpp | 1 - 3 files changed, 37 deletions(-) (limited to 'src/qml/types') diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index cdd336006f..0d82cca001 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -550,35 +550,6 @@ void QQmlDelegateModel::setRootIndex(const QVariant &root) } } -/*! - \qmlproperty int QtQml.Models::DelegateModel::rows - - Contains the number of rows in the model. If the model - is a list of items, it will be equal to the number of items - in the list. - - \since QtQml.Models 2.12 -*/ -int QQmlDelegateModel::rows() const -{ - Q_D(const QQmlDelegateModel); - return d->m_adaptorModel.rowCount(); -} - -/*! - \qmlproperty int QtQml.Models::DelegateModel::columns - - Contains the number of columns in the model. If the model - is a list of items, it will be equal to \c 1. - - \since QtQml.Models 2.12 -*/ -int QQmlDelegateModel::columns() const -{ - Q_D(const QQmlDelegateModel); - return d->m_adaptorModel.columnCount(); -} - /*! \qmlmethod QModelIndex QtQml.Models::DelegateModel::modelIndex(int index) diff --git a/src/qml/types/qqmldelegatemodel_p.h b/src/qml/types/qqmldelegatemodel_p.h index 65b1b82d70..5c66a90798 100644 --- a/src/qml/types/qqmldelegatemodel_p.h +++ b/src/qml/types/qqmldelegatemodel_p.h @@ -88,8 +88,6 @@ class Q_QML_PRIVATE_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public Q_PROPERTY(QQmlListProperty groups READ groups CONSTANT) Q_PROPERTY(QObject *parts READ parts CONSTANT) Q_PROPERTY(QVariant rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged) - Q_PROPERTY(int rows READ rows NOTIFY rowsChanged REVISION 12) - Q_PROPERTY(int columns READ columns NOTIFY columnsChanged REVISION 12) Q_CLASSINFO("DefaultProperty", "delegate") Q_INTERFACES(QQmlParserStatus) public: @@ -109,9 +107,6 @@ public: QVariant rootIndex() const; void setRootIndex(const QVariant &root); - int rows() const; - int columns() const; - Q_INVOKABLE QVariant modelIndex(int idx) const; Q_INVOKABLE QVariant parentModelIndex() const; @@ -145,8 +140,6 @@ Q_SIGNALS: void filterGroupChanged(); void defaultGroupsChanged(); void rootIndexChanged(); - Q_REVISION(12) void rowsChanged(); - Q_REVISION(12) void columnsChanged(); private Q_SLOTS: void _q_itemsChanged(int index, int count, const QVector &roles); diff --git a/src/qml/types/qqmlmodelsmodule.cpp b/src/qml/types/qqmlmodelsmodule.cpp index d9756704d1..9c170cb008 100644 --- a/src/qml/types/qqmlmodelsmodule.cpp +++ b/src/qml/types/qqmlmodelsmodule.cpp @@ -59,7 +59,6 @@ void QQmlModelsModule::defineModule() #endif #if QT_CONFIG(qml_delegate_model) qmlRegisterType(uri, 2, 1, "DelegateModel"); - qmlRegisterType(uri, 2, 9, "DelegateModel"); qmlRegisterType(uri, 2, 1, "DelegateModelGroup"); #endif qmlRegisterType(uri, 2, 1, "ObjectModel"); -- cgit v1.2.3