adamtheone/canDrive

README.md Update - High DPI Scaling In PyQt5

MRRIZK opened this issue · 1 comments

On high resolution monitors the layout of the GUI is not correct when scaling is enabled. Potentially add functionality to support High DPI monitors ie: check box and subsequent restart or add the below to the readme file for others to know where to change.

canSniffer_ui.py (Change to)

from PyQt5 import QtCore, QtGui, QtWidgets

QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) #enable highdpi scaling
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) #use highdpi icons

PS: Adding the above worked for me. No idea if it is the correct way to achieve the desired outcome. Thanks!

Added and pushed. Thanks!