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

Documentation Qt Quick Controls Style Selection at Runtime

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.4.0
    • None
    • Windows

    Description

      Hi,

      I am trying to select a style at runtime with Qt Quick Controls like documented below (with environment variable or command option)

      https://doc.qt.io/qt-6/qtquickcontrols2-styles.html#run-time-style-selection

      1) If I try in Qt Creator to set the environment variable QT_QUICK_CONTROLS_STYLE=material I got the following error

      QQmlApplicationEngine failed to load component
      qrc:/Styles/main.qml: module "basic" is not installed.

      Same if I set the env var in C++ with qputenv(). Problem solved with qputenv("QT_QUICK_CONTROLS_STYLE", "QtQuick.Controls.Material");

      2) Same for the command line option -style. When adding in the Projects > Run Settings a command line argument I need to put -style QtQuick.Controls.Material and not -style material. 

       

      Maybe the documentation could be updated accordingly.

      Attachments

        Activity

          People

            docteam Qt Documentation Team
            pijaouen Pierre Jaouen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: