I cannot figure out how to apply attributes when initialising QApplication. I'm trying to add HighDPI scaling (by changing the attributes of QApplication), but there doesn't appear to be any function for adding attributes. Does it need to be done in command-line with sys.argv
?
I am using a Qt Designer .ui file for my UI.
What I want is to add is an attribute to the QApplication class hopefully within code. If necessary, I will use command-line.
There appears to be a way in PyQt5, but I'm using PySide2.
Checking the documentation shows that there isn't a function for it. Is there a workaround, such as going to QCoreApplication
? I have noticed that QCoreApplication does have a function for it, but I'm trying to modify QApplication, a child of QCoreApplication.
Relevant code:
import sys
from PySide2.QtUiTools import QUiLoader
from PySide2.QtWidgets import QApplication
from PySide2.QtCore import QFile, QIODevice
if __name__ == "__main__":
app = QApplication(sys.argv)