We have so far seen that QML is quite a powerful declarative language, but combining it with with JavaScript makes it even more powerful. QML not only enables us to have inline JavaScript [http://qt-project.org/doc/qt-5.0/qtqml/qtqml-javascript-expressions.html#custom-methods] functions, but also to import entire JavaScript libraries or files.
Part of the core functionality of NoteApp* is to enable users to create, edit, and delete notes as they like, but the application should also be able to store notes automatically without prompting them.
This chapter will guide you about using JavaScript to add logic to QML code, and implementing local storage using Qt Quick Local Storage [http://qt-project.org/doc/qt-5.0/qtquick/qmlmodule-qtquick-localstorage2-qtquick-localstorage-2.html].
Note
You will find the implementation related to this chapter in the zip file provided in the Get the Source Code and the Guide in Different Formats section.
The main topics covered in this chapter are:
- Using JavaScript for implementing the functionality of Dynamic Object Management
- How to store data locally using the Qt Quick Database API
This chapter has the following steps: