Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89130

setLibraryPaths keeps the applications directory in path, docs should mention it

    XMLWordPrintable

Details

    • All
    • efa5a699729c6ff9f9d7991d12ed70139e3be669 (qt/qtbase/dev) f120933e53970ee425cfa5ce621b29c435a1000e (qt/qtbase/6.0) 41937df503b0c09ea319194d78a41a16ef5e0bbf (qt/tqtc-qtbase/tqtc/lts-5.15)
    • Da Vinci sprint 25

    Description

      https://doc.qt.io/qt-5/qcoreapplication.html#setLibraryPaths says:

      Sets the list of directories to search when loading libraries to paths. All existing paths will be deleted and the path list will consist of the paths given in paths.

      Which is not correct because the applications path is added:

      #include <QApplication>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          qputenv("QT_DEBUG_PLUGINS","1");
          QStringList sl;
          sl.append("/home/kapinter/Qt/5.15.1/gcc_64/lib");
          QCoreApplication::setLibraryPaths(sl);
          QApplication app(argc, argv);
          return app.exec();
      }
      

      and the log shows that it is still searching in the location where the application is.
      The code is visible here void QCoreApplicationPrivate::init() :
      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qcoreapplication.cpp#n789

      Attachments

        For Gerrit Dashboard: QTBUG-89130
        # Subject Branch Project Status CR V

        Activity

          People

            paulwicking Paul Wicking
            karimpinter Karim Pinter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes