Results 1 to 3 of 3

Thread: QT QSqlDatabase: QSQLITE driver not loaded MAC

  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QT QSqlDatabase: QSQLITE driver not loaded MAC

    Anyone know how to get this working on mac ?

    So far I have tried

    main.cpp
    Qt Code:
    1. #ifdef Q_WS_MAC
    2. QDir dir(QApplication::applicationDirPath());
    3. dir.cdUp();
    4. dir.cd("plugins");
    5. QApplication::addLibraryPath(QStringList(dir.absolutePath()));
    6. #endif
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. db = QSqlDatabase::addDatabase("QSQLITE");
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. mkdir App.app/Contents/plugins
    2. mkdir App.app/Contents/plugins/sqldrivers
    3. cp /Developer/Qt/Desktop/Qt/473/gcc/plugins/sqldrivers/libqsqlite.dylib App.app/Contents/plugins/sqldrivers/.
    4.  
    5. install_name_tool -id @executable_path/../plugins/sqldrivers/libqsqlite.dylib App.app/Contents/plugins/sqldrivers/libqsqlite.dylib
    6. install_name_tool -change /Developer/Qt/Desktop/Qt/473/gcc/lib/QtSql.framework/Versions/4/QtSql @executable_path/../Frameworks/QtSql.framework/Versions/Current/QtSql App.app/Contents/plugins/sqldrivers/libqsqlite.dylib
    7. install_name_tool -change /Developer/Qt/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/Current/QtCore App.app/Contents/plugins/sqldrivers/libqsqlite.dylib
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. QT += network webkit xml sql declarative script svg
    To copy to clipboard, switch view to plain text mode 

    Thanks for pointing me with any direction

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT QSqlDatabase: QSQLITE driver not loaded MAC

    Try reading this [WIKI]Current working directory[/WIKI].

    I never tried in Mac but in Windows works.

    Many official Qt Examples use the same code
    Last edited by mcosta; 1st July 2011 at 17:40. Reason: updated contents
    A camel can go 14 days without drink,
    I can't!!!

  3. The following user says thank you to mcosta for this useful post:

    migel (1st July 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT QSqlDatabase: QSQLITE driver not loaded MAC

    qt.conf

    Qt Code:
    1. [Paths]
    2. Plugins = ./plugins
    To copy to clipboard, switch view to plain text mode 

    This is how to load the plugin

Similar Threads

  1. QSqlDatabase: QMYSQL driver not loaded
    By onder in forum Newbie
    Replies: 12
    Last Post: 29th March 2017, 14:43
  2. QtNetwork + Qsqlite = driver not loaded ?
    By LordG in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 28th January 2016, 22:29
  3. QSqlDatabase: QMYSQL driver not loaded
    By earthling in forum Qt Programming
    Replies: 13
    Last Post: 4th December 2010, 15:19
  4. QSqlDatabase: QODBC driver not loaded
    By gutiory in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2010, 09:24
  5. Replies: 6
    Last Post: 28th April 2009, 06:58

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.