Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Fontsize on 'some' windows machines too big

Fontsize on 'some' windows machines too big

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 480 Views 1 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.
  • B Offline
    B Offline
    Bouke
    wrote on last edited by
    #1

    Hi all,
    Creating pyuic5 py files from QT designer .ui files.
    On 'some' windows machines (definitly on a Surface book 2), the interface font size is way too big. (See the image below.)
    Is this a known issue?
    I'm going to try to decrease the pointsize, with some code like:

    font = self.font()
    font.setPointSize(9) # 13 is default
    QApplication.instance().setFont(font)

    Not sure it that will work, but if it does, is there a way to detect what machines will have this issue so my work can auto adjust?

    Thanks,
    Bouke

    ALEchange.png

    jsulmJ 1 Reply Last reply
    0
    • B Bouke

      Hi all,
      Creating pyuic5 py files from QT designer .ui files.
      On 'some' windows machines (definitly on a Surface book 2), the interface font size is way too big. (See the image below.)
      Is this a known issue?
      I'm going to try to decrease the pointsize, with some code like:

      font = self.font()
      font.setPointSize(9) # 13 is default
      QApplication.instance().setFont(font)

      Not sure it that will work, but if it does, is there a way to detect what machines will have this issue so my work can auto adjust?

      Thanks,
      Bouke

      ALEchange.png

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Bouke It's probably related to https://doc.qt.io/qt-5/highdpi.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bouke
        wrote on last edited by
        #3

        Yeah, that seemed to be the case.

        I've added:
        os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
        qapp = QApplication(sys.argv)
        qapp.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)

        and now it looks normal at the clients side.
        (I don't have a similar system, so I can't really test.)

        Next step is to make QT aware of the Zoom factor as set in Windows.
        Any hints on that?

        Bouke

        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