Results 1 to 2 of 2

Thread: PyQt5 GUI -- Resolution Inconsistency issue in Desktop and Laptop

  1. #1
    Join Date
    Jun 2025
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Question PyQt5 GUI -- Resolution Inconsistency issue in Desktop and Laptop

    Hello,

    I am developing a GUI using PyQt5. Whenever I connect my laptop to an extended monitor via an HDMI cable and disconnect it and run my GUI on laptop the font size of all of the Buttons become too small making it too tuff to read.

    I have tried using -
    QApplication.setAttribute(Qt.AA_EnableHighDpiScali ng)
    QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)

    But it still does not help with the issue.

    All the GUI components i have created to VBox or HBox layouts.

    Please note that this issue gets resolved once i restart my laptop and re-run the GUI.

    Can you please help me in resolving this issue.

  2. #2
    Join Date
    Oct 2024
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Windows

    Default Re: PyQt5 GUI -- Resolution Inconsistency issue in Desktop and Laptop

    You try this way. I think so.

    import sys
    from PyQt5.QtWidgets import QApplication
    from PyQt5.QtCore import Qt

    # ??t các thu?c tính DPI **tr??c** khi t?o QApplication
    QApplication.setAttribute(Qt.AA_EnableHighDpiScali ng, True)
    QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)

    app = QApplication(sys.argv)

Similar Threads

  1. UI file showing different in desktop and laptop ..
    By riarioriu3 in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2012, 10:44
  2. QwtScale and QwtPlot scale inconsistency.
    By umituzun84 in forum Qwt
    Replies: 5
    Last Post: 18th June 2010, 11:25
  3. Strange inconsistency with QTimer
    By starlon in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2009, 06:57
  4. QGraphicsView.AnchorViewCenter inconsistency ?
    By AchipA in forum Qt Programming
    Replies: 3
    Last Post: 1st June 2009, 18:26
  5. QListWidget - inconsistency across operating systems?
    By scwizard in forum Qt Programming
    Replies: 20
    Last Post: 20th February 2007, 01:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.