aboutsummaryrefslogtreecommitdiffstats
path: root/examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc')
-rw-r--r--examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc22
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc b/examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc
index 6a153c2..ebbce73 100644
--- a/examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc
+++ b/examples/enginio/widgets/todos-cpp/doc/src/todos-cpp.qdoc
@@ -27,7 +27,7 @@
/*!
\title Enginio C++ Examples - Todos
\example todos-cpp
- \brief The Todo example shows the \l {EnginioModelCpp}{EnginioModel} usage together with QtWigets.
+ \brief The Todo example shows how to use the \l {EnginioModelCpp}{EnginioModel} with Qt Widgets.
\ingroup enginio-examples
\inmodule enginio-qt
@@ -49,26 +49,26 @@
}
\endcode
- The first step is to create a TodosModel which inherits \l {EnginioModelCpp}{EnginioModel}
+ The first step is to create a TodosModel which inherits \l {EnginioModelCpp}{EnginioModel},
and defines the main roles which will be used. As we are interested in the To Do \c title
and the \c completed information we need to define these two roles.
\snippet todos-cpp/todosmodel.h definition
- By default views (for example \l QListView) use the \l{Qt::ItemDataRole} role to display or edit the content.
+ By default, views (for example \l QListView) use the \l{Qt::ItemDataRole} role to display or edit the content.
The newly created \l{EnginioModelCpp}{EnginioModel} is empty and defines basic roles. Most roles are created
- dynamically, based on the json data-structure. They have no predefined value in the \l Qt::ItemDataRole enum.
+ dynamically, based on the JSON datastructure. They have no predefined value in the \l Qt::ItemDataRole enum.
\l{EnginioModelCpp}{EnginioModel} automatically populates itself as soon as the
\l{EnginioModel::query}{query} and \l{EnginioModel::client}{client} properties have been set.
When the data is downloaded, the model resets itself, and sets up the internal data cache and roles names.
- \l{EnginioModelCpp}{EnginioModel} guesses the role names based on heuristics and it may be wrong if not all
- objects received from the backend have exactly the same structure, for example a property can be missing
- in certain objects. To protect against such cases we overload \l{EnginioModel::roleNames()}{roleNames()}.
+ \l{EnginioModelCpp}{EnginioModel} guesses the role names based on heuristics. It may be wrong if not all
+ objects received from the backend have exactly the same structure. For example, a property can be missing
+ in certain objects. To protect against such cases, we overload \l{EnginioModel::roleNames()}{roleNames()}.
Overriding \l{EnginioModel::roleNames()}{roleNames()} can also be used to match default Qt roles to the named
ones.
\snippet todos-cpp/todosmodel.cpp roleNames
- In this example we map the \l Qt::DisplayRole and \l Qt::EditRole to the "title" property in the JSON.
+ In this example we map the \l Qt::DisplayRole and \l Qt::EditRole to the \c title property in the JSON.
This way the right string is shown by default and editing works as expected.
Remember to always call the base class implementation to avoid situations in which the internal cache is not in sync.
@@ -84,18 +84,18 @@
\snippet todos-cpp/mainwindow.cpp client
- It is used by model to connect to the Enginio backend. Next we need to construct
+ It is used by the model to connect to the Enginio backend. Next we need to construct
and configure our model too. The configuration is based on two steps, assigning
an \l EnginioClient instance and by creating a query.
\snippet todos-cpp/mainwindow.cpp model
- The model has to be assigned to a view, in our case it is a \l QListView.
+ The model has to be assigned to a view. In our case it is a \l QListView.
\snippet todos-cpp/mainwindow.cpp assignModel
To make the application fully functional, a way to add and remove "To Dos" is needed.
- To do so, we need to connect correct buttons to slots for adding a new item:
+ To do so, we need to connect the correct buttons to slots for adding a new item:
\snippet todos-cpp/mainwindow.cpp appendItem