Crude relocation of port spinbox from .ui file

This commit is contained in:
atse 2023-07-26 13:22:27 +08:00
parent cc1fddddda
commit cbffb8d700
3 changed files with 12 additions and 40 deletions

View File

@ -198,6 +198,18 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.menu = QtWidgets.QMenu() self.menu = QtWidgets.QMenu()
self.menu.setTitle('Thermostat settings') self.menu.setTitle('Thermostat settings')
self.port_set_spin = QtWidgets.QSpinBox()
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.port_set_spin.sizePolicy().hasHeightForWidth())
self.port_set_spin.setSizePolicy(sizePolicy)
self.port_set_spin.setMinimumSize(QtCore.QSize(70, 0))
self.port_set_spin.setMaximumSize(QtCore.QSize(70, 16777215))
self.port_set_spin.setMaximum(65535)
self.port_set_spin.setProperty("value", 23)
self.port_set_spin.setObjectName("port_set_spin")
port = QtWidgets.QWidgetAction(self.menu) port = QtWidgets.QWidgetAction(self.menu)
port.setDefaultWidget(self.port_set_spin) port.setDefaultWidget(self.port_set_spin)
self.menu.addAction(port) self.menu.addAction(port)

View File

@ -212,34 +212,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QSpinBox" name="port_set_spin">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>23</number>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="connect_btn"> <widget class="QPushButton" name="connect_btn">
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -104,18 +104,6 @@ class Ui_MainWindow(object):
self.ip_set_line.setClearButtonEnabled(True) self.ip_set_line.setClearButtonEnabled(True)
self.ip_set_line.setObjectName("ip_set_line") self.ip_set_line.setObjectName("ip_set_line")
self.settings_layout.addWidget(self.ip_set_line) self.settings_layout.addWidget(self.ip_set_line)
self.port_set_spin = QtWidgets.QSpinBox(parent=self.bottom_settings_group)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.port_set_spin.sizePolicy().hasHeightForWidth())
self.port_set_spin.setSizePolicy(sizePolicy)
self.port_set_spin.setMinimumSize(QtCore.QSize(70, 0))
self.port_set_spin.setMaximumSize(QtCore.QSize(70, 16777215))
self.port_set_spin.setMaximum(65535)
self.port_set_spin.setProperty("value", 23)
self.port_set_spin.setObjectName("port_set_spin")
self.settings_layout.addWidget(self.port_set_spin)
self.connect_btn = QtWidgets.QPushButton(parent=self.bottom_settings_group) self.connect_btn = QtWidgets.QPushButton(parent=self.bottom_settings_group)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)