aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qt/todos/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt/todos/mainwindow.cpp')
-rw-r--r--examples/qt/todos/mainwindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/qt/todos/mainwindow.cpp b/examples/qt/todos/mainwindow.cpp
index 65ba026..cfb5026 100644
--- a/examples/qt/todos/mainwindow.cpp
+++ b/examples/qt/todos/mainwindow.cpp
@@ -83,13 +83,16 @@ void MainWindow::error(EnginioReply *error)
qWarning() << Q_FUNC_INFO << error;
}
+//![removeItem]
void MainWindow::removeItem()
{
QModelIndex index = m_view->currentIndex();
EnginioReply *reply = m_model->remove(index.row());
QObject::connect(reply, &EnginioReply::finished, reply, &EnginioReply::deleteLater);
}
+//![removeItem]
+//![appendItem]
void MainWindow::appendItem()
{
bool ok;
@@ -99,11 +102,12 @@ void MainWindow::appendItem()
if (ok && !text.isEmpty()){
QJsonObject object;
object["title"] = text;
- object["completed"] = false;
+ object["completed"] = false; // By default a new To Do is not completed
EnginioReply *reply = m_model->append(object);
QObject::connect(reply, &EnginioReply::finished, reply, &EnginioReply::deleteLater);
}
}
+//![appendItem]
void MainWindow::toggleCompleted()
{