Results 1 to 5 of 5

Thread: location save file database

  1. #1
    Join Date
    Oct 2015
    Posts
    46
    Thanks
    19
    Platforms
    Windows

    Default location save file database

    I created databse with this code:
    Qt Code:
    1. import QtQuick 2.2
    2. import QtQuick.LocalStorage 2.0
    3. Item {
    4. Component.onCompleted: {
    5. var db = LocalStorage.openDatabaseSync("MyExample", "1.0", "Example database", 10000);
    6. db.transaction( function(tx) {
    7. tx.executeSql ('CREATE TABLE IF NOT EXISTS Greeting (salutation TEXT, salutee TEXT)');
    8. tx.executeSql ('INSERT INTO Greeting VALUES (?,?)', ['hello', 'world']);
    9. var result = tx.executeSql('select * from Greeting');
    10. for(var i = 0; i < result.rows.length; i++) {
    11. console.log(result.rows[i].salutation);
    12. }
    13. });
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    it where is save?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: location save file database

    The documentation says:
    They are stored in the Databases subdirectory of QQmlEngine:fflineStoragePath()
    For which the documentation says:
    The default is QML/OfflineStorage in the platform-standard user application data directory.
    Which most likely means it uses QStandardPaths::AppDataLocation with QStandardPaths::writableLocation().

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    ravandi (9th January 2016)

  4. #3
    Join Date
    Oct 2015
    Posts
    46
    Thanks
    19
    Platforms
    Windows

    Default Re: location save file database

    How do I change the storage location?


    Added after 1 59 minutes:


    you mean ,this is folder?
    F:\qt\5.5\mingw492_32\qml\QtQuick\LocalStorage
    Last edited by ravandi; 9th January 2016 at 18:54.

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: location save file database

    Quote Originally Posted by ravandi View Post
    How do I change the storage location?
    The documentation clearly states that the setter for the offlineStoragePath property is QQmlEngine::setOfflineStoragePath().

    Quote Originally Posted by ravandi View Post
    you mean ,this is folder?
    Unlikely, that doesn't look like a user location.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    ravandi (10th January 2016)

  7. #5
    Join Date
    Oct 2015
    Posts
    46
    Thanks
    19
    Platforms
    Windows

    Default Re: location save file database

    I found it:
    Qt Code:
    1. C:\Users\Name system\AppData\Local\table\QML\OfflineStorage\Databases
    To copy to clipboard, switch view to plain text mode 
    thanks.

Similar Threads

  1. Read image and save to database?
    By Gokulnathvc in forum Newbie
    Replies: 6
    Last Post: 22nd July 2011, 00:18
  2. how to save a image file ( say png ) into mysql database?
    By AviMittal in forum Qt Programming
    Replies: 12
    Last Post: 21st July 2011, 12:49
  3. how to save database
    By khalid_se in forum Newbie
    Replies: 7
    Last Post: 10th July 2011, 18:47
  4. Replies: 2
    Last Post: 25th March 2011, 04:19
  5. Save images to database
    By jnk5y in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2006, 19:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.