Nominate our 2022 Qt Champions!

QT shell environment variables?

  • Does there exist any "authoritative" list of QT 5.x shell environment variables, and their definitions? Way too much purely anecdotal information on the web about trying different settings related to font and screen metrics in X11, and unfortunately anecdotal information is often wrong.

  • Lifetime Qt Champion


    Do you mean like the QT_DEBUG_PLUGINS environment variable ?

  • @SGaist said in QT shell environment variables?:


    Do you mean like the QT_DEBUG_PLUGINS environment variable ?

    Yes. My immediate need is related to font and screen scaling under X11, but IMHO, there really should be an authoritative list of ALL the QT_ environment variables that are available.

    My use case involves two physical displays with differing pixel densities. Sometimes I need to make one large "single display variable" desktop, and other times I can treat each display as a separate X11 display...consistency of font metrics across both displays is a non-trivial problem for one framework, let alone also having to support GTK and electron GUI apps.

  • Lifetime Qt Champion

    AFAIK, these variables are documented were they make sense, QT_DEBUG_PLUGINS is the plugin development part.

    But I do understand the need.

    One thing you can do is to open a suggestion on the bug report system to create a central list for these (if there's not already one such suggestions)

    If you are looking for something specific, grepping through Qt's source for qEnvironmentVariable may help you find what you are looking for.

  • While we're on the subject, what is the exact purpose of QT_FONT_DPI? Its use seems to be counter-intuitive.

    the 96dpi display scales propertly when it is either unset, or set at 96
    the 50dpi display only scales properly when it is explicitly set to 96

    This doesn't make sense to me, as I would expect to tell Qt what the native dpi of the 50dpi display is via the QT_FONT_DPI variable. Thus QT_FONT_DPI=50 should mean use fonts scaled to 50dpi, right?

  • Lifetime Qt Champion

    @Kent-Dorfman said in QT shell environment variables?:


    That I don't know, sorry.

    You should bring that to the interest mailing list. You'll find there Qt's developers/maintainers.

Log in to reply