Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. List of Qt and QML environment variables

List of Qt and QML environment variables

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 7.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JapieKrekel
    wrote on last edited by
    #1

    Is there a list somewhere with all the Qt environment variables and their meaning?

    I did a grep on Qt source code and there are dozens of environment variables that influence the run time behaviour of an application, but I can only find information about a handfull of them on the qt-project site.

    E.g.
    QML_FIXED_ANIMATION_STEP (use it when your animations look weird on QtQuick 2 on an embedded device) ,
    QML_IMPORT_TRACE (to show qml import loading mechanism, "see here":http://qt-project.org/doc/qt-5.0/qtquick/qtquick-debugging.html)
    QML_SHOW_FRAMERATE (...)
    ...and so on...

    1 Reply Last reply
    2
    • A Offline
      A Offline
      adamhendry
      wrote on last edited by
      #2
      1. Most variables/enums for Qt are in QtCore.Qt: https://doc.qt.io/qtforpython-6/PySide6/QtCore/Qt.html

      Many were added in Qt5:

      (a) WA stands for Widget Attribute: QtCore.Qt.WidgetAttribute
      (b) AA stands for Application Attribute: .QtCore.Qt.ApplicationAttribute

      These are used within code and set with QAppliction.setAttribute and tested with QApplication.testAttribue. e.g.

      from PyQt5.QtCore import Qt
      from PyQt5.QtWidgets import QApplication
      
      app = QApplication([])
      app.setAttribute(Qt.AA_DontShowIconsInMenus, True)
      

      There are many others that control a vast array of the items in Qt.

      1. Environment variables are often used for specific plugins and abstractions. For example

        (a) QPA stand for Qt Platform Abstraction, which controls the platform/windowing mode your app uses: https://doc.qt.io/qt-5/qpa.html#qpa-plugins

        E.g.

        QT_QPA_PLATFORM=offscreen 
        

        runs your program in headless mode (no screen), which may or may not be useful for testing.

        From the docs:

      Qt integrates with the windowing system on the target platform using Qt Platform Abstraction (QPA). QPA is an abstraction of a windowing system which makes porting Qt to new platforms simple and quick. One such system is the Wayland protocol. Qt can be used together with Wayland as a light-weight windowing system on embedded hardware to support a multi-process graphical user interface.

      The Qt Platform Abstraction uses Qt's plugin system. This plugin system provides APIs to extend Qt in specific areas (such as adding support for new image formats, database drivers, and so on) and also for writing your own extensible Qt applications which support third-party plugins.

      Instructions on which values are valid are listed here (though the docs could be improved):

      https://doc.qt.io/qt-5/qguiapplication.html#platformName-prop

      The Qt Wiki seems to have a set of useful environment variable configurations for different setups:

      https://wiki.qt.io/Qt_6.2_Tools_and_Versions

      (b) There's also the `Qt Quick Scene Graph` (`QSG`)  and `Rendering Hardware Interface` (`RHI`):
      
      QSG_RHI_BACKEND=software
      

      which you can find more about here:

      https://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html#rendering-via-the-qt-rendering-hardware-interface

      1. Qt QuickControls (which I've yet to use) list environment variables here:

      https://doc.qt.io/qt-5/qtquickcontrols2-environment.html

      1. For QMake (which I haven't used), supported variables are listed here:

      https://doc.qt.io/qt-5/qmake-variable-reference.html

      1. Lastly, there's also a list of all available environment variables for Qt5 here on GitHub:

      https://github.com/pyqt/python-qt5/wiki/Qt-Environment-Variable-Reference

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved