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. Modify the variable QT_SCALE_FACTOR when the program is running
Forum Updated to NodeBB v4.3 + New Features

Modify the variable QT_SCALE_FACTOR when the program is running

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by
    #1

    Hi!

    In an application, I use the qputenv command in my main.cpp file to fix the size of my QML dialog boxes

    qputenv("QT_SCALE_FACTOR",scale);

    There are two problems:

    • The command crashes the program under macos if scale != 1.0

    • Since it is only possible to change the system variable QT_SCALE_FACTOR when the program starts, I can no longer use this way to change the size of the boxes once the program has started.

    Is there another way to act on the variable QT_SCALE_FACTOR? or to act on the same parameter when the program is running?

    With my thanks,

    JonBJ 1 Reply Last reply
    0
    • F Francky033

      Hi!

      In an application, I use the qputenv command in my main.cpp file to fix the size of my QML dialog boxes

      qputenv("QT_SCALE_FACTOR",scale);

      There are two problems:

      • The command crashes the program under macos if scale != 1.0

      • Since it is only possible to change the system variable QT_SCALE_FACTOR when the program starts, I can no longer use this way to change the size of the boxes once the program has started.

      Is there another way to act on the variable QT_SCALE_FACTOR? or to act on the same parameter when the program is running?

      With my thanks,

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Francky033
      Take a look at https://stackoverflow.com/a/44003927/489865
      ?

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Francky033
        wrote on last edited by
        #3

        Thanks JonB! This is exactly what I'm looking for!

        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