Qt World Summit: Register Today!

[solved] sqlite database location

  • I am using Qt on a Mac now, and was wondering where exactly can I find the sqlite database successfully created with LocalStorage.openDatabaseSync ?

    On Windows I found it in Users\User\AppData\Local\Qt Project\QtQmlViewer\QML\OfflineStorage\Databases where half of those folders were "hidden", and with the friendly name a2998f7c243edb1cb69267c3c137616c.sqlite

    I'm new to the Mac, and have spent ages looking for something similar, or anywhere it might have put it.
    Are there hidden folders on the Mac I should track down ? Searching the entire machine for any file like .sqlite shows nothing. And yet the database is being created.

  • Lifetime Qt Champion


    You should be able to get the path using "QQmlEngine::offlineStoragePath":http://qt-project.org/doc/qt-5/qqmlengine.html#offlineStoragePath-prop

    Hope it helps

  • Thank you, that's a start.
    any idea how to get at that via javascript please ?

  • I would expect, on OS X, for it to be in users/username/library/Application Support where all the other applications write their data. Qt doesn't seem to do this, so I'm assuming that Qt, or at least the installation process, isn't quite out of beta yet.

  • I have made some progress with this.
    It turns out that it can't create the database file, due to permissions and/or the folder it wants not existing. This problem has been reported in this forum elsewhere.

    In fact, because it couldn't open the file, instead it built the database in RAM, and continued to add records until the application ran out of memory.

    Qt was installed on a brand new Mac. If, as a result of this installation, a simple app falls over due to incorrect configurations, then this is the fault of the installer, not the customer.

    We will wait until there is a fix before proceeding with a commercial licence.

  • Lifetime Qt Champion

    Don't you have something like

    @"/Users/username/Library/Application Support/organization_name/application_name/QML/OfflineStorage"@


  • Oh good grief !!!!


    So I need to retract my complaint about Qt. All is forgiven.

    In fact, from what I have seen so far, I'm actually impressed with most of Qt

    Thanks for pointing me in the right direction.

  • Lifetime Qt Champion

    You're welcome !

    That's what Qt does ;)

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

Log in to reply