Keep window in the same scale

13 Views Asked by At

I'm fairly new to PyQt5, and have program where I initialize the window like this:

`def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(480, 800)

self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")

self.enm_label = QtWidgets.QLabel(self.centralwidget)
self.enm_label.setGeometry(QtCore.QRect(0, 0, 480, 60))`

When I open the program on my Desktop, where the screen is 24 inches wide and the windows resolution scale is 100%, the program looks fine, like this: https://imgur.com/a/ogc5O6Z

But when I open the program on my laptop, which is 16 inches wide and the windows resolution scale is 150%, it looks like this: https://imgur.com/a/1pheruF Even if I resize the window, the labels don't change size or position, they are always cutted like in the image, even in full screen.

Like I said before, I'm fairly new to PyQt5 and this size aspect was never mentioned in any of the PyQt5 tutorials I watched...

How can I fix this? I'm willing to give more information about my code, if needed.

Thanks in advance.

I didn't tried anything because I have no clue on what could I do here.

I'm expecting the program to open correctly, showing the labels in full, or at least allowing me to resize and show what's left of the labels.

0

There are 0 best solutions below