Add window icon

This commit is contained in:
atse 2023-09-14 16:53:31 +08:00
parent 9e96be30e9
commit 7ea9752b0f
3 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,10 @@
<property name="windowTitle">
<string>Thermostat Control Panel</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>thermostat-icon-256x256.png</normaloff>thermostat-icon-256x256.png</iconset>
</property>
<widget class="QWidget" name="main_widget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -15,6 +15,9 @@ class Ui_MainWindow(object):
MainWindow.resize(1280, 720)
MainWindow.setMinimumSize(QtCore.QSize(1280, 720))
MainWindow.setMaximumSize(QtCore.QSize(3840, 2160))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("thermostat-icon-256x256.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
MainWindow.setWindowIcon(icon)
self.main_widget = QtWidgets.QWidget(parent=MainWindow)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(1)