Results 1 to 4 of 4

Thread: Looking for simple way to integrate a Database

  1. #1
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Looking for simple way to integrate a Database

    Currently I am working on a project for a business systems class that at its base level will take information from a database, apply some algorithms to it, and display it to the user through a GUI. I am also taking a class that teaches OO C++ using Qt and as I really enjoy using it I would like to use Qt to develop my program for my other class.

    So basically my question is what is the easiest way to integrate a simple database into my Qt program, one that I can read and write to. I have experience with MySQL, and I believe there is support in Qt for that, but since I am not experienced with it I was hoping someone with a little more experience could help me out.

  2. #2
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Looking for simple way to integrate a Database

    Qt comes with SQLite built in. Just add QT += sql to your pro file.
    See here: http://doc.trolltech.com/4.5/qtsql.html and here: http://www.hwaci.com/sw/sqlite/docs.html

  3. #3
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Looking for simple way to integrate a Database

    Thats exactly what I am looking for, thank you. One other question I have though is how exactly should I create the database? I have worked with online sql databases before when doing some web design, using php in html to execute queries, but what is the best method here? Should I create one online and connect to it there? Or is there a way I can create one locally?

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Looking for simple way to integrate a Database

    You are free to create your database locally or somewhere else. It depends on the needs of your application. Simple use the QSqlDatabase and define the necessary connection details (local or in the internet). If you need a local database I would go with SQLite for the beginning.

Similar Threads

  1. how to integrate qt and Qwt linux
    By qtlinuxnewbie in forum Newbie
    Replies: 0
    Last Post: 2nd February 2010, 07:17
  2. Simple DataBase problems
    By briang in forum Newbie
    Replies: 2
    Last Post: 31st December 2009, 09:42
  3. i want to integrate msvc2005 with Qt4.3
    By coder1985 in forum Installation and Deployment
    Replies: 13
    Last Post: 28th November 2007, 00:13
  4. How to Integrate Qt with 'C'
    By deepakn in forum Newbie
    Replies: 3
    Last Post: 8th August 2007, 15:46
  5. Install and integrate Qt4 with VC6 ?
    By aamer4yu in forum Installation and Deployment
    Replies: 3
    Last Post: 3rd October 2006, 10:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.