aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qqmlobjectmodel.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <[email protected]>2021-04-30 12:16:38 +0200
committerRichard Moe Gustavsen <[email protected]>2021-04-30 15:20:48 +0200
commit499fcb5d399321c3d887ead8f5a5b8696841a7f9 (patch)
tree5b4f84c34509d723b8b66bb090cbe012a1983f47 /src/qmlmodels/qqmlobjectmodel.cpp
parent70e1d5234af1f454be60f0a18594ba82fea8a8f3 (diff)
qqmltableinstancemodel: add setRequiredProperty()
Add a virtual function setRequiredProperty() to QQmlInstanceModel that we override in QQmlTableInstanceModel. This function can be called from QQuickTableView, upon getting the initItem signal, to assign initial values to any required properties that the view makes use of. This patch is added as a preparation for adding selection support to QQuickTableView (which will make use of "required property isSelected" on the delegate) Change-Id: I55885bafa14da1d432c120bef807e73165f1466c Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qmlmodels/qqmlobjectmodel.cpp')
-rw-r--r--src/qmlmodels/qqmlobjectmodel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qmlmodels/qqmlobjectmodel.cpp b/src/qmlmodels/qqmlobjectmodel.cpp
index 19aaaae88e..49588b306c 100644
--- a/src/qmlmodels/qqmlobjectmodel.cpp
+++ b/src/qmlmodels/qqmlobjectmodel.cpp
@@ -451,6 +451,17 @@ void QQmlObjectModel::clear()
d->clear();
}
+bool QQmlInstanceModel::setRequiredProperty(int index, const QString &name, const QVariant &value)
+{
+ Q_UNUSED(index);
+ Q_UNUSED(name);
+ Q_UNUSED(value);
+ // The view should not call this function, unless
+ // it's actually handled in a subclass.
+ Q_UNREACHABLE();
+ return false;
+}
+
QT_END_NAMESPACE
#include "moc_qqmlobjectmodel_p.cpp"