Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPSQL driver not loaded
Forum Updated to NodeBB v4.3 + New Features

QPSQL driver not loaded

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 343 Views
  • 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.
  • I Offline
    I Offline
    Idodoqdo
    wrote on last edited by
    #1

    Hello everyone, I know that this topic has been raised more than once, but I did not find anything for myself ... Here is the code:

    db_ = QSqlDatabase::addDatabase("QPSQL");
        db_.setHostName("localhost");
        db_.setDatabaseName("lshiela");
        db_.setUserName("lshiela");
        db_.setPassword("");
        qDebug()  <<  QSqlDatabase::drivers();
        if (db_.open()) {
            qDebug() << "db open";
        } else {
            qDebug() << "db not open";
        }
    

    get:
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE
    QList("QSQLITE")
    db not open

    But there is libqsqlpsql.dylib in sqldrivers folder. Why can't he see her? Thanks

    Christian EhrlicherC 1 Reply Last reply
    0
    • I Idodoqdo

      Hello everyone, I know that this topic has been raised more than once, but I did not find anything for myself ... Here is the code:

      db_ = QSqlDatabase::addDatabase("QPSQL");
          db_.setHostName("localhost");
          db_.setDatabaseName("lshiela");
          db_.setUserName("lshiela");
          db_.setPassword("");
          qDebug()  <<  QSqlDatabase::drivers();
          if (db_.open()) {
              qDebug() << "db open";
          } else {
              qDebug() << "db not open";
          }
      

      get:
      QSqlDatabase: QPSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE
      QList("QSQLITE")
      db not open

      But there is libqsqlpsql.dylib in sqldrivers folder. Why can't he see her? Thanks

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Idodoqdo said in QPSQL driver not loaded:

      But there is libqsqlpsql.dylib in sqldrivers folder. Why can't he see her? Thanks

      Maybe because you're using another Qt installation for your running program?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      I 2 Replies Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @Idodoqdo said in QPSQL driver not loaded:

        But there is libqsqlpsql.dylib in sqldrivers folder. Why can't he see her? Thanks

        Maybe because you're using another Qt installation for your running program?

        I Offline
        I Offline
        Idodoqdo
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        Yes it looks like that one

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @Idodoqdo said in QPSQL driver not loaded:

          But there is libqsqlpsql.dylib in sqldrivers folder. Why can't he see her? Thanks

          Maybe because you're using another Qt installation for your running program?

          I Offline
          I Offline
          Idodoqdo
          wrote on last edited by
          #4

          @Christian-Ehrlicher
          No. I look for the presence of the library in the same qt in which I run. Please tell me what I need to provide to make the problem clearer

          1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            There are a lot of such questions in the forum - you can search for QT_DEBUG_PLUGINS

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            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