diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-06-23 12:34:03 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-18 22:12:01 +0000 |
commit | 7910d9d27d4f6c20734c05fcc9ae6f5237fd19d6 (patch) | |
tree | 3a7c85ae58b2b0ffa5510a7544d0e1d298924cfe | |
parent | ab1df24c8283cafd76f05c86004963c4c2d0673f (diff) |
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 <mitch.curtis@qt.io>
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 29 | ||||
-rw-r--r-- | src/qml/types/qqmldelegatemodel_p.h | 7 | ||||
-rw-r--r-- | src/qml/types/qqmlmodelsmodule.cpp | 1 |
3 files changed, 0 insertions, 37 deletions
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 @@ -551,35 +551,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) QAbstractItemModel provides a hierarchical tree of data, whereas 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<QQmlDelegateModelGroup> 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<int> &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<QQmlDelegateModel>(uri, 2, 1, "DelegateModel"); - qmlRegisterType<QQmlDelegateModel,12>(uri, 2, 9, "DelegateModel"); qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 1, "DelegateModelGroup"); #endif qmlRegisterType<QQmlObjectModel>(uri, 2, 1, "ObjectModel"); |