#๐Ÿ”’ Windows Resolution Scaling with UI

25 messages ยท Page 1 of 1 (latest)

grim turret
#

Hello all I have this code here

layout = QVBoxLayout()
central_widget = QWidget()

self.setCentralWidget(central_widget)
central_widget.setLayout(layout)

header_label = QLabel("Key |                              Message                              | Enabled? | Enter?")
header_label.setFont(QFont("Tahoma", 10, QFont.Bold))
layout.addWidget(header_label)

Problem is it completely breaks on other scales on windows. It's fine on 100% and completely not fine on any else. Any way to make this scale to the windows scale? Everything else does but this :(

solemn nimbusBOT
#

@grim turret

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

grim turret
#

100% scale:

#

125% scale:

dire viper
#

@grim turret is this code in PyQt6

grim turret
dire viper
#

U didnt set any window scale

#

Btw do u write the code for the gui as well

grim turret
dire viper
#

Y dont u use Qt designer for making your UIs

#

Its way easy

grim turret
dire viper
#

Type this in your cmd

pyqt5-tools designer
#

It will open up the qt designer for you

grim turret
dire viper
#

I never encountered scaling issues in my qt code

#

So yes

grim turret
#

Ooh alright, I'll give it a go tomorrow then. Thank you.

dire viper
#

Np

#

Im using qt designer for a quite long time

#

So just ask if u get stuck anywhere

#

Bye

solemn nimbusBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.