Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to compile qt with sqlite driver on ubuntu
Forum Updated to NodeBB v4.3 + New Features

How to compile qt with sqlite driver on ubuntu

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 4 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.
  • D Offline
    D Offline
    dhay06
    wrote on last edited by
    #1

    hi,
    i used qt with sqlite in Windows and i hadn't problems, but when i tried to develop my project(witch works perfectly in windows) i got some problems, sqlite isn't configured in qt so how can configure it ?

    i'v download libqt4-sql-sqlite from synaptic and i have "libqsqlite.so" and "libqsqlite2.so" files in usr/lib/qt4/plugins/sqldirvers.

    how to compile qt with this driver?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fcrochik
      wrote on last edited by
      #2

      Compile qt with this driver?
      If you downloaded the "qt" binaries you should have already the sqlite plugin.
      If you downloaded qt sources and compiled it on ubuntu it will also generate the sqlite plugin.

      I don't see any scenario that you would download the sqlite plugin by itself.

      Can you give us some more details about your issue?

      Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dhay06
        wrote on last edited by
        #3

        i'v solved the probleme, i look that it was a problem with qdir and not with the sqlite driver, im sorry !
        In windows i save my data base in the hoempath() with this code @db.setDatabaseName(QDir::homePath()+"\mydatabase.db3");@ and it work fine but in ubuntu i wrote simply @db.setDatabaseName("mydatabase.db3")@ to work.

        why it didn't work with Qdir ?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fcrochik
          wrote on last edited by
          #4

          One of the issues that you should be aware is that the "directory delimiter" is different on Windows and linux. You can use "/" on windows but not "" on linux. Could that be the problem?

          Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            The backslash is not a valid path delimiter in unix/linux. You should try

            @
            db.setDatabaseName(QDir::homePath()+"/mydatabase.db3");
            @

            This works with Windows too, Qt takes care of translating the slash to backslashes when actually accessing the filesystem.

            Also, is your database file really in your homedir?

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dhay06
              wrote on last edited by
              #6

              it works, thank you :)

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vsorokin
                wrote on last edited by
                #7

                And I recommend use direct slash in Windows too, It also will be work.

                --
                Vasiliy

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  In fact it is the only one supported in Qt:

                  bq. From "QFile":http://doc.qt.nokia.com/stable/qfile.html API docs:
                  QFile expects the file separator to be '/' regardless of operating system. The use of other separators (e.g., '') is not supported

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vsorokin
                    wrote on last edited by
                    #9

                    Volker, Yes, You are right, but unofficially, as I know \ worked in Windows (or worked earlier)

                    --
                    Vasiliy

                    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