Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to change the name and the emplacement of the SQLite database ?

    QML and Qt Quick
    2
    3
    1371
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SlimIT last edited by

      Hi,

      is there a way to change the name and the emplacement of the SQLite database ?

      As exemple my database name is : 33704e7720b9d2247ed1258cad464a99.sqlite and is placed in this folder under linux : /home/slimittn/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/Databases/.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • D
        D0IT last edited by

        When opening the database connection you can give the database the path you want by passing the appropriate path to "QSqlDatabase::setDatabaseName.":http://doc-snapshot.qt-project.org/4.8/qsqldatabase.html#setDatabaseName

        1 Reply Last reply Reply Quote 0
        • S
          SlimIT last edited by

          Thanks.

          I need to do that with QML and not C++.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post