mirror of https://github.com/qt/qtdoc.git
ToDoList example: Fix some qmllint warnings
Pick-to: 6.10 Task-number: QTBUG-138189 Change-Id: I8c3d60bfd75a1756966c93346c808763726ea54b Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit is contained in:
parent
e31802fb15
commit
ac229f05e3
|
@ -4,7 +4,6 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQml
|
||||
import QtQuick
|
||||
import QtQuick.LocalStorage
|
||||
|
||||
QtObject {
|
||||
|
@ -19,7 +18,7 @@ QtObject {
|
|||
let db = LocalStorage.openDatabaseSync("ToDoList", "1.0", "ToDoList app database")
|
||||
|
||||
db.transaction(function (tx) {
|
||||
tx.executeSql('CREATE TABLE IF NOT EXISTS tasks (
|
||||
tx.executeSql(`CREATE TABLE IF NOT EXISTS tasks (
|
||||
task_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
task_name,
|
||||
task_dueDate TEXT,
|
||||
|
@ -27,7 +26,7 @@ QtObject {
|
|||
task_notes TEXT,
|
||||
done INTEGER,
|
||||
highlighted INTEGER
|
||||
)');
|
||||
)`);
|
||||
})
|
||||
|
||||
_db = db
|
||||
|
@ -40,8 +39,8 @@ QtObject {
|
|||
function addTask(taskName, taskDueDate, taskDueTime, taskNotes, taskDone, taskHighlighted) {
|
||||
let results
|
||||
root._database().transaction(function(tx){
|
||||
tx.executeSql("INSERT INTO tasks (task_name, task_dueDate, task_dueTime,
|
||||
task_notes, done, highlighted) VALUES(?,?,?,?,?,?);",
|
||||
tx.executeSql(`INSERT INTO tasks (task_name, task_dueDate, task_dueTime,
|
||||
task_notes, done, highlighted) VALUES(?,?,?,?,?,?);`,
|
||||
[taskName, taskDueDate, taskDueTime, taskNotes, taskDone, taskHighlighted])
|
||||
results = tx.executeSql("SELECT * FROM tasks ORDER BY task_id DESC LIMIT 1")
|
||||
})
|
||||
|
@ -50,8 +49,8 @@ QtObject {
|
|||
|
||||
function updateTask(taskId, taskName, taskDueDate, taskDueTime, taskNotes) {
|
||||
root._database().transaction(function (tx) {
|
||||
tx.executeSql("UPDATE tasks set task_name=?, task_dueDate=?, task_dueTime=?,
|
||||
task_notes=? WHERE task_id=?",
|
||||
tx.executeSql(`UPDATE tasks set task_name=?, task_dueDate=?, task_dueTime=?,
|
||||
task_notes=? WHERE task_id=?`,
|
||||
[taskName, taskDueDate, taskDueTime, taskNotes, taskId])
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue