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. High DPI and AppImage format
Forum Updated to NodeBB v4.3 + New Features

High DPI and AppImage format

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 783 Views 2 Watching
  • 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.
  • A Offline
    A Offline
    aran
    wrote on last edited by
    #1

    Hi all,

    I encountered some odd behavior when using an AppImage of a Qt5 application. In the app, before the creation of QApplication, I set QApplication::setAttribute(Qt::AA_EnableHighDpiScaling). This works all fine and dandy when compiling and running normally on a high DPI screen. However, once packed in an AppImage, the UI elements look all tiny and squished, no scaling to take the high DPI into account was done. However, it I set the environment variable QT_AUTO_SCREEN_SCALE_FACTOR=1 before running the AppImage, it all looks good again. According to the documentation about Qt::AA_EnableHighDpiScaling:

    This corresponds to setting the QT_AUTO_SCREEN​_SCALE_FACTOR environment variable to 1.

    Has anybody else seen this before? Does anyone know of a way to ensure the AppImage respects the Qt::AA_EnabledHighDpiScaling attribute?

    Thanks in advance

    A 1 Reply Last reply
    0
    • A aran

      Hi all,

      I encountered some odd behavior when using an AppImage of a Qt5 application. In the app, before the creation of QApplication, I set QApplication::setAttribute(Qt::AA_EnableHighDpiScaling). This works all fine and dandy when compiling and running normally on a high DPI screen. However, once packed in an AppImage, the UI elements look all tiny and squished, no scaling to take the high DPI into account was done. However, it I set the environment variable QT_AUTO_SCREEN_SCALE_FACTOR=1 before running the AppImage, it all looks good again. According to the documentation about Qt::AA_EnableHighDpiScaling:

      This corresponds to setting the QT_AUTO_SCREEN​_SCALE_FACTOR environment variable to 1.

      Has anybody else seen this before? Does anyone know of a way to ensure the AppImage respects the Qt::AA_EnabledHighDpiScaling attribute?

      Thanks in advance

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      @aran said in High DPI and AppImage format:

      AppImage

      I would check the Qt Issue tracker for related issues.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SimonSchroeder
        wrote on last edited by
        #3

        As a simple workaround you could have a small script inside your AppImage which first sets the environment variable and then launches your actual app. The AppImage then needs to be configured to launch the script instead. At least, this fixes the user experience.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aran
          wrote on last edited by
          #4

          Well, as it turns out there were some environment variables set that caused the highdpi scaling to be disabled. I must have set them at some point, though I can't recall when or why...

          Thanks @Asperamanca and @SimonSchroeder for your input!

          1 Reply Last reply
          0
          • A aran has marked this topic as solved on

          • Login

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