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

Nonexistent QT_STYLE_OVERRIDE style prevents main window from being shown

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.2.2
    • Quick: Other
    • None
    • Zorin OS 16
    • Linux/X11

    Description

      With Qt6, when the QT_STYLE_OVERRIDE environment variable references an "invalid" (nonexistent) style, it prevents the main window from being shown, and the following generic/non-descriptive message is printed to the terminal:

      qrc:/src/MainApplicationWindow.qml: module "adwaita" is not installed
      

      I believe this is a regression from Qt5: with Qt5, the main window would open and be displayed just fine, and a helpful warning similar to the following would be printed (which is no longer printed with Qt6):

      QApplication: invalid style override 'adwaita' passed, ignoring it.
          Available styles: Windows, Fusion
      

      I stumbled upon this when testing a Qt application on Zorin OS 16, where they hardcode QT_STYLE_OVERRIDE=adwaita but the custom version of Qt I was testing with did not have the adwaita style built into it, and as a result the main window would not be shown.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            abandali Amin Bandali
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes