Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Creating Database in iOS Application

Creating Database in iOS Application

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 3 Posters 745 Views
  • 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.
  • R Offline
    R Offline
    Refi
    wrote on last edited by aha_1980
    #1

    I have developed an application in iOS using qt . Actually it has to create a db sqlitedata.db . But Db is not getting created . I have used "QStandardPaths::standardLocations(QStandardPaths::StandardLocation type)" to get the correct path. The path it gave me (when I used qDebug() ) was:
    /var/mobile/Applications/262093E8-F9A7-4624-9559-FB3C6BF393E5/Library/Application Support/sqlitedata.db . But Inside Library folder there is no folder named Application Support and database . Please give me a solution to create a DB and read and update the DB through application .

    jsulmJ 1 Reply Last reply
    0
    • R Refi

      I have developed an application in iOS using qt . Actually it has to create a db sqlitedata.db . But Db is not getting created . I have used "QStandardPaths::standardLocations(QStandardPaths::StandardLocation type)" to get the correct path. The path it gave me (when I used qDebug() ) was:
      /var/mobile/Applications/262093E8-F9A7-4624-9559-FB3C6BF393E5/Library/Application Support/sqlitedata.db . But Inside Library folder there is no folder named Application Support and database . Please give me a solution to create a DB and read and update the DB through application .

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @Refi What parameter did you pass to QStandardPaths::standardLocations(QStandardPaths::StandardLocation type)?
      You should use QStandardPaths::AppDataLocation
      For creating and updating a database please take time to read http://doc.qt.io/qt-5/sql-programming.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Refi What parameter did you pass to QStandardPaths::standardLocations(QStandardPaths::StandardLocation type)?
        You should use QStandardPaths::AppDataLocation
        For creating and updating a database please take time to read http://doc.qt.io/qt-5/sql-programming.html

        R Offline
        R Offline
        Refi
        wrote on last edited by
        #3

        @jsulm
        Thank you I will try QStandardPaths::AppDataLocation

        1 Reply Last reply
        0
        • J.HilkJ Online
          J.HilkJ Online
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          ios is quirky with that,

          make sure the path returned from QStandardPath actually exists. If it doesn't, than create it first.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          R 1 Reply Last reply
          1
          • J.HilkJ J.Hilk

            ios is quirky with that,

            make sure the path returned from QStandardPath actually exists. If it doesn't, than create it first.

            R Offline
            R Offline
            Refi
            wrote on last edited by
            #5

            @J.Hilk
            Thank you . When created folders, it worked !

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved