adamtheone / canDrive

Tools for hacking your car
https://www.youtube.com/playlist?list=PLNiFaO8hU1z0o_6DSxk-jcVAM3UCUR-pY
MIT License
545 stars 148 forks source link

README.md Update - High DPI Scaling In PyQt5 #25

Closed MRRIZK closed 2 years ago

MRRIZK commented 2 years ago

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.AAUseHighDpiPixmaps, 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!

adamtheone commented 2 years ago

Added and pushed. Thanks!