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. SOLVED Qt 5.1 ios How to Bundle and use SQLite database in application
QtWS25 Last Chance

SOLVED Qt 5.1 ios How to Bundle and use SQLite database in application

Scheduled Pinned Locked Moved Mobile and Embedded
28 Posts 9 Posters 21.5k 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.
  • elliott0124E Offline
    elliott0124E Offline
    elliott0124
    wrote on last edited by
    #21

    Hi!

    I'm follow this example.
    But It doesn't work for me.

    In Desktop, iOS simulator mode is fine.
    But it doesn't work with my iPad.

    Thanks you if you can help me.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jraichouni
      wrote on last edited by
      #22

      I currently work on my work environment and do also have no iPad (iPhone only) but it shall work as described in above posts.

      1 Reply Last reply
      0
      • elliott0124E Offline
        elliott0124E Offline
        elliott0124
        wrote on last edited by
        #23

        Hi, Jamil

        Thanks for your feedback.

        Then I tried with my iPhone5s. And It just work, but my iPadRetina don't.
        Post QT creator error log above:

        This plugin does not support propagateSizeHints()
        &
        Failed to make complete framebuffer object 8cdd

        Thanks again for your help.

        1 Reply Last reply
        0
        • elliott0124E Offline
          elliott0124E Offline
          elliott0124
          wrote on last edited by
          #24

          [Solved]
          Update to QT5.2.1, iPad just work fine.

          Thanks you.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vtong
            wrote on last edited by
            #25

            Hi,
            Please help. I build my app for iPad, and using database Sqlite.
            Can you explain the QString dbFilePath = "(...)"; why it is "(...)"
            Thanks and regards

            [quote author="Jamil Raichouni" date="1389206294"]Hi!

            Take the example in the current thread.

            The important things to consider are:

            .pro file:
            @
            QT += sql
            ios:QTPLUGIN += qsqlite

            deploy the database file via something like:

            databases.files = ../../src/data/xp-apt.sqlite
            ios: databases.path = Documents
            macx: databases.path = Contents/Resources
            QMAKE_BUNDLE_DATA += databases

            note, that the path databases.files is relative to the cwd, in which

            the process qmake runs

            @

            The class implementing the initialisation/ access to the db needs to do the following for instance:
            @
            #include <QtSql>
            (...)

            QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "some_name");
            QSqlDatabase db = QSqlDatabase::database("some_name", false);
            QString dbFilePath = "(...)";
            db.setDatabaseName(dbFilePath);
            db.open();
            QSqlQuery *q = new QSqlQuery(db);
            (...)
            @

            Hope that helps![/quote]

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #26

              It's a placeholder text that you must replace with the path to your database file

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vtong
                wrote on last edited by
                #27

                Thanks SGaist,
                It works now.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SherifOmran
                  wrote on last edited by
                  #28

                  hi every body,

                  i ve the same issue, should this mean that we don't need to use Q_IMPORT_PLUGIN(qsqlite);
                  any more for static compiling?

                  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