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. How do I deploy an existing sqlite database with my qt application on Symbian device?
Forum Updated to NodeBB v4.3 + New Features

How do I deploy an existing sqlite database with my qt application on Symbian device?

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 5 Posters 6.8k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hungchuviet
    wrote on last edited by
    #1

    I have one SQLite database, I want to deploy it with my App on symbina device.
    But I don't know how to do?
    Help me!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      Try this in the .pro file:
      @sqfiles.sources = file with sqlite
      DEPLOYMENT += sqfiles@

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kalle
        wrote on last edited by
        #3

        An SQLite database is just one single file that needs to be installed on the device. If you are using QMake, use the DEPLOYMENT variable to do that.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kalle
          wrote on last edited by
          #4

          Alexander beat me there while I was typing :-)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexander
            wrote on last edited by
            #5

            kalle :)

            1 Reply Last reply
            0
            • R Offline
              R Offline
              remy_david
              wrote on last edited by
              #6

              Hello,

              This solution works as long as you deploy to C:\ drive on Symbian.
              But when deploying on E:\ (aka mass storage), this won't work :

              .pro
              @sqldeployment.sources = db.sqlite
              sqldeployment.path = .
              DEPLOYMENT += sqldeployment@

              .cpp
              @QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
              db.setDatabaseName("db.sqlite");@

              The file db.sqlite exists in E:\Private\appID\ folder but do not get loaded by QSqlDatabase
              With C:\Private\appID\ it works fine.

              Any clue ?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                remy_david
                wrote on last edited by
                #7

                Ok I found a solution :

                @
                QString apppath = QApplication::applicationDirPath();
                QString dbpath(apppath);
                dbpath.append(QDir::separator()).append("db.sqlite");
                dbpath = QDir::toNativeSeparators(dbpath);
                db.setDatabaseName(dbpath);
                @

                This way it works both with C:\ and E:\ deployment.
                I can't see why the other way did not work however.

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  francomartins
                  wrote on last edited by
                  #8

                  @
                  QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
                  db.setDatabaseName(qApp->applicationDirPath()+"/"db.sqlite");
                  @

                  for windows users use on main.cpp for define a librarypath :
                  @
                  #ifdef Q_OS_WIN32
                  QString env = getenv("SYSTEMROOT");
                  QCoreApplication::addLibraryPath(env+"\system32");
                  #endif
                  @

                  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