2

I'm currently developing an application for smartphone.

I want to generate a notification every time that the Date match with the time now. Every data are stored on a Qt Quick Local Storage 2.0 that is fill during some process on my QML files.

I'm using a QTimer to check every minute if one of my data match the time now, but my problem is that i dont know how to read the database ...

Or maybe i thinking about using this : WorkerScript but it dont seems that I can run this on the background every minutes when my app is close

  • Did you try to google that? [link1](http://doc.qt.io/qt-5/qtquick-localstorage-qmlmodule.html) [link2](http://doc.qt.io/qt-5/qtquick-localstorage-example.html) – folibis Oct 20 '16 at 07:29
  • First of all you can use `Timer` to keep everything in QML, no need to move to C++. If you still want to use `QTimer` remember that `LocalStorage` creates DBs and `QSqlDatabase` it's the C++ class to handle them. You should start from that. Anyhow, I would change approach, totally. Local notifications should be scheduled with [`AlarmManager`](http://stackoverflow.com/a/31946656/2538363) on Android (a similar approach can be used in iOS). No need to check for current time, you just set the notification in the future. Easier and more correct. – BaCaRoZzo Oct 20 '16 at 21:27

0 Answers0