summaryrefslogtreecommitdiff
path: root/src/enginio_client/enginiomodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/enginio_client/enginiomodel.cpp')
-rw-r--r--src/enginio_client/enginiomodel.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/enginio_client/enginiomodel.cpp b/src/enginio_client/enginiomodel.cpp
index 3d5f93d..644b9a6 100644
--- a/src/enginio_client/enginiomodel.cpp
+++ b/src/enginio_client/enginiomodel.cpp
@@ -480,6 +480,25 @@ void EnginioModel::setOperation(Enginio::Operation operation)
}
/*!
+ Reload the model data from the server.
+ This is similar to reset and will emit \l modelAboutToBeReset() and \l modelReset().
+ This function invalidated the internal state of the model, reloads it from the backend
+ and resets all views.
+
+ \note when using this function while other requests to the server are made the result
+ is undefined. For example when calling append() and then reset() before append finished,
+ the model may or may not contain the result of the append operation.
+
+ \return reply from backend
+ \since 1.1
+*/
+EnginioReply *EnginioModel::reload()
+{
+ Q_D(EnginioModel);
+ return d->reload();
+}
+
+/*!
\include model-append.qdocinc
\sa EnginioClient::create()
*/
@@ -543,7 +562,6 @@ EnginioReply *EnginioModel::setData(int row, const QVariant &value, const QStrin
return d->setValue(row, role, value);
}
-
Qt::ItemFlags EnginioBaseModel::flags(const QModelIndex &index) const
{
return QAbstractListModel::flags(index) | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;