Results 1 to 5 of 5

Thread: Qt creator upgrade to 2.0 no sql support linux

  1. #1
    Join Date
    Jan 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt creator upgrade to 2.0 no sql support linux

    I recently upgraded to 2.0 from 1.3.1 and have no sql drivers on linux.

    Specifically i am looking to use MySQL. Works fine in 1.3.1, but I try the following code in 2.0:

    Qt Code:
    1. qDebug() << QSqlDatabase::drivers();
    2. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    To copy to clipboard, switch view to plain text mode 

    I then get this result:
    Qt Code:
    1. QSqlDatabase: QMYSQL driver not loaded
    2. QSqlDatabase: available drivers:
    3. QSqlError(-1, "Driver not loaded", "Driver not loaded")
    To copy to clipboard, switch view to plain text mode 

    In my sdk directory, there is no src directory to build the drivers. I did, however find the following directory:

    qtcreator-1.3.85/bin/sqldrivers

    Here there was an existing libqsqlite.so

    I downloaded the src code for qt 4.6.3, built the mysql driver successfully, and copied it to this folder, but to no avail.

    I've changed to qt version inside the previous version of creator (1.3.1) to every version of qt that i have installed: 4.6.3 and 4.7.0 beta. Run a rebuild and it runs just fine, with the following code and response:

    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2. #include <QtSql>
    3. #include <QDebug>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QCoreApplication a(argc, argv);
    8.  
    9. qDebug() << "sql drivers" << QSqlDatabase::drivers();
    10.  
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 

    response:
    Qt Code:
    1. sql drivers ("QSQLITE", "QMYSQL3", "QMYSQL")
    To copy to clipboard, switch view to plain text mode 

    My question is then, where is the new version of qtcreator looking for these driver files? And, more importantly, how do i get the new version running with sql support.

  2. #2
    Join Date
    Jun 2009
    Posts
    33
    Thanks
    5
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt creator upgrade to 2.0 no sql support linux

    I am having the exact same problem. The addDatabase function kicks out this error. Our code has not changed since creator 1.2.1. My test show we can access our database at the command line but not in creator 2.0. I have success using qtcreator-2.0-beta (qtcreator-1.3.83) but not qtcreator-rc1(qtcreator-1.3.85 ) or qtcreator-2.0. Sounds like a bug; I'm going back to beta until this is fixed unless someone can get a workaround going.

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt creator upgrade to 2.0 no sql support linux

    Same exact issue here as well. I am not even using the sdk that I downloaded to get the latest qtcreator. I am using the ubuntu standard qmake and qt libs that were working in 1.3??? guess I am going back too.

  4. #4
    Join Date
    Jan 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt creator upgrade to 2.0 no sql support linux

    I eventually got it to work. I had to download the source code for 4.7 and rebuild with sql support. Works great now!

  5. #5
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt creator upgrade to 2.0 no sql support linux

    The not finding SQL plugins is because the default plugin path has been hard coded to /home/berlin or something rather than the Qt install path.

Similar Threads

  1. Qt Creator with MS SDK support...
    By jiapei100 in forum Qt Tools
    Replies: 2
    Last Post: 9th October 2009, 21:10
  2. Japanese support in QT Embedded Linux
    By Beppe in forum Qt Programming
    Replies: 0
    Last Post: 28th May 2009, 15:16
  3. Replies: 4
    Last Post: 7th January 2009, 10:13
  4. regarding qt/embedded support in MontaVista linux
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 6th February 2007, 12:46
  5. Qt and jpg support in Linux ?
    By probine in forum Qt Programming
    Replies: 2
    Last Post: 22nd January 2007, 23:46

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.