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

QLibraryInfo version subgroups are not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 4.8.5
    • Core: Other
    • None

    Description

      I have the following qt.conf:

      [Paths]
      Prefix=/foo

      [Paths/4]
      Prefix=/bar

      [Paths/5]
      Prefix=/baz

      Now I copy qmake from both 4.8.5 and 5.2.1 into that folder and query the prefix:

      ./qmake -query QT_INSTALL_PREFIX; ./qmake-qt5 -query QT_INSTALL_PREFIX
      /foo
      /foo

      This is not what the documentation of qt.conf says. Digging a bit in 4.8.5 lead to this patch that makes things work for me:

      diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
      index aa474a2..0fb90e6 100644
      --- a/src/corelib/global/qlibraryinfo.cpp
      +++ b/src/corelib/global/qlibraryinfo.cpp
      @@ -361,6 +361,7 @@ QLibraryInfo::location(LibraryLocation loc)
       
               if(!key.isNull()) {
                   QSettings *config = QLibraryInfoPrivate::configuration();
      +            (void) config->childGroups();
                   config->beginGroup(QLatin1String("Paths"));
       
                   QString subKey;
      

      ./qmake-test -query QT_INSTALL_PREFIX
      /bar

      Of course the patch is nonsense, but it may show that something in QSettings is wrong.

      Btw, one of the inline comments says:

      if QT_VERSION is 6.0.2, then we use 'Paths/5'

      but the API docs says

      \o 6.0.2 matches \c Paths/6

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            buddenha Oswald Buddenhagen
            rebemlix Rolf Eike Beer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes