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

QSettings relies on qApp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      We have upgraded from Qt 5.12 to 5.15. Now I receive an assertion when I start one of our applications with Qt debug build.

      ASSERT failure in getRelocatablePrefix: "Failed to find the Qt prefix path.", file qtbase/src/corelib/global/qlibraryinfo.cpp, line 63
      

      Note: All the Qt libs are in the same folder as the executable
      According to https://doc.qt.io/qt-5/qt-conf.html I created then a qt.conf file in the application folder to adapt the Libraries path

      [Paths]
      Libraries=.
      

      However, it did not help.
      Other some debugging I found the root cause:

      • We are using QSettings before an instance of QApplication is created (we are using a global static object that uses QSettings, but the issue is easiyl reproducible with creating a QSettings object before creating QCoreApplication, see e.g. QTBUG-53539)
      • In qlibraryinfo.cpp QSettings *QLibraryInfoPrivate::findConfiguration() the search path for qt.conf is:
      1. resource system
      2. filesystem but only if QCoreApplication::instance()

      I circumvented the problem now by creating a qt.conf resource file and integrating it into the executable. But then I loose the possibility to adopt any paths by using a qt.conf in the installation folder.

        Attachments

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

          Activity

            People

            Assignee:
            alexandru.croitor Alexandru Croitor
            Reporter:
            axelm Axel Müller
            PM Owner:
            Maurice Kalinowski
            RnD Owner:
            Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes