diff options
author | Samuel Gaist <[email protected]> | 2015-08-02 22:48:52 +0200 |
---|---|---|
committer | Samuel Gaist <[email protected]> | 2015-08-04 10:46:33 +0000 |
commit | e3fc58eb8556c3908ad6f8a3eb644d5fa66f5ddd (patch) | |
tree | 3ea6df0b992766b8d3ef20220fe73c7d5177fc9a | |
parent | ecb432549b367a4fc0e7bb077308b4afaf622878 (diff) |
Task-number: QTBUG-38678
Change-Id: Ie6d8f231573fb783ab0d6f3aaf9231fcbf3364b3
Reviewed-by: Sze Howe Koh <[email protected]>
-rw-r--r-- | desktop_devguide/chapter_04/step_1.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop_devguide/chapter_04/step_1.rst b/desktop_devguide/chapter_04/step_1.rst index 2586899..2b4f8d9 100644 --- a/desktop_devguide/chapter_04/step_1.rst +++ b/desktop_devguide/chapter_04/step_1.rst @@ -37,7 +37,7 @@ As mentioned before, we first load the `Note` component in the `Page` component: } ... -Now let's define a Javascript function that will creates QML `Note` objects. While creating a QML object, we must ensure that one of the arguments is the parent of the `this` object. Considering to have a `Note` item container within the `Page` component would be a good idea for managing our note objects, as we would like to save these notes in a database. +Now let's define a Javascript function that will create QML `Note` objects. While creating a QML object, we must ensure that one of the arguments is the parent of the `this` object. Considering to have a `Note` item container within the `Page` component would be a good idea for managing our note objects, as we would like to save these notes in a database. .. code-block:: js @@ -153,7 +153,7 @@ In the `main.qml` file, let's see how to call the function for creating new note Deleting Note Objects --------------------- -Deleting the `Note` objects is a more straightforward process because the QML :qt5:`Item <qtquick/qml-qtquick2-item.html>` type provides a JavaScript function called :qt5:`destroy() <qtqml/qtqml-javascript-dynamicobjectcreation.html#deleting-objects-dynamically>`. As we already have a container item whose childrens are `Note` items, we can simply iterate through the list of children and call :qt5:`destroy() <qtqml/qtqml-javascript-dynamicobjectcreation.html#deleting-objects-dynamically>` on each of them. +Deleting the `Note` objects is a more straightforward process because the QML :qt5:`Item <qtquick/qml-qtquick2-item.html>` type provides a JavaScript function called :qt5:`destroy() <qtqml/qtqml-javascript-dynamicobjectcreation.html#deleting-objects-dynamically>`. As we already have a container item whose children are `Note` items, we can simply iterate through the list of children and call :qt5:`destroy() <qtqml/qtqml-javascript-dynamicobjectcreation.html#deleting-objects-dynamically>` on each of them. In the `Page` component, let's define a function to perform this operation for us: |