Made UI resizeable.

This commit is contained in:
jupfi 2023-07-10 15:47:38 +02:00
parent 9eb4999246
commit 5a12f27fa2
3 changed files with 75 additions and 34 deletions

View file

@ -10,33 +10,47 @@
<height>1080</height> <height>1080</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="QStackedWidget" name="stackedWidgetPulseProgrammer"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="geometry"> <item>
<rect> <widget class="QStackedWidget" name="stackedWidgetSettings">
<x>860</x> <property name="sizePolicy">
<y>0</y> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<width>1061</width> <horstretch>0</horstretch>
<height>1081</height> <verstretch>0</verstretch>
</rect> </sizepolicy>
</property> </property>
<widget class="QWidget" name="page_3"/> <property name="autoFillBackground">
<widget class="QWidget" name="page_4"/> <bool>true</bool>
</widget> </property>
<widget class="QStackedWidget" name="stackedWidgetSettings"> <widget class="QWidget" name="page_3"/>
<property name="geometry"> <widget class="QWidget" name="page_4"/>
<rect> </widget>
<x>10</x> </item>
<y>0</y> <item>
<width>831</width> <widget class="QStackedWidget" name="stackedWidgetPulseProgrammer">
<height>1081</height> <property name="sizePolicy">
</rect> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
</property> <horstretch>0</horstretch>
<widget class="QWidget" name="page"/> <verstretch>0</verstretch>
<widget class="QWidget" name="page_2"/> </sizepolicy>
</widget> </property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<widget class="QWidget" name="page"/>
<widget class="QWidget" name="page_2"/>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View file

@ -24,6 +24,14 @@ class SpectrometerView(ModuleView):
self.blank = QWidget() self.blank = QWidget()
self._ui_form.stackedWidgetSettings.setStyleSheet(
"QStackedWidget { background-color: #fafafa; border: 2px solid #000; }"
)
self._ui_form.stackedWidgetPulseProgrammer.setStyleSheet(
"QStackedWidget { background-color: #fafaaa; border: 2px solid #000; }"
)
def on_active_spectrometer_changed(self, module): def on_active_spectrometer_changed(self, module):
"""This method is called when the active spectrometer is changed. """This method is called when the active spectrometer is changed.
It changes the active view in the stacked widget to the one that was just activated. It changes the active view in the stacked widget to the one that was just activated.

View file

@ -13,24 +13,43 @@ class Ui_Form(object):
def setupUi(self, Form): def setupUi(self, Form):
Form.setObjectName("Form") Form.setObjectName("Form")
Form.resize(1920, 1080) Form.resize(1920, 1080)
self.stackedWidgetPulseProgrammer = QtWidgets.QStackedWidget(parent=Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
self.stackedWidgetPulseProgrammer.setGeometry(QtCore.QRect(860, 0, 1061, 1081)) sizePolicy.setHorizontalStretch(0)
self.stackedWidgetPulseProgrammer.setObjectName("stackedWidgetPulseProgrammer") sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout.setObjectName("horizontalLayout")
self.stackedWidgetSettings = QtWidgets.QStackedWidget(parent=Form)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.stackedWidgetSettings.sizePolicy().hasHeightForWidth())
self.stackedWidgetSettings.setSizePolicy(sizePolicy)
self.stackedWidgetSettings.setAutoFillBackground(True)
self.stackedWidgetSettings.setObjectName("stackedWidgetSettings")
self.page_3 = QtWidgets.QWidget() self.page_3 = QtWidgets.QWidget()
self.page_3.setObjectName("page_3") self.page_3.setObjectName("page_3")
self.stackedWidgetPulseProgrammer.addWidget(self.page_3) self.stackedWidgetSettings.addWidget(self.page_3)
self.page_4 = QtWidgets.QWidget() self.page_4 = QtWidgets.QWidget()
self.page_4.setObjectName("page_4") self.page_4.setObjectName("page_4")
self.stackedWidgetPulseProgrammer.addWidget(self.page_4) self.stackedWidgetSettings.addWidget(self.page_4)
self.stackedWidgetSettings = QtWidgets.QStackedWidget(parent=Form) self.horizontalLayout.addWidget(self.stackedWidgetSettings)
self.stackedWidgetSettings.setGeometry(QtCore.QRect(10, 0, 831, 1081)) self.stackedWidgetPulseProgrammer = QtWidgets.QStackedWidget(parent=Form)
self.stackedWidgetSettings.setObjectName("stackedWidgetSettings") sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.stackedWidgetPulseProgrammer.sizePolicy().hasHeightForWidth())
self.stackedWidgetPulseProgrammer.setSizePolicy(sizePolicy)
self.stackedWidgetPulseProgrammer.setAutoFillBackground(True)
self.stackedWidgetPulseProgrammer.setObjectName("stackedWidgetPulseProgrammer")
self.page = QtWidgets.QWidget() self.page = QtWidgets.QWidget()
self.page.setObjectName("page") self.page.setObjectName("page")
self.stackedWidgetSettings.addWidget(self.page) self.stackedWidgetPulseProgrammer.addWidget(self.page)
self.page_2 = QtWidgets.QWidget() self.page_2 = QtWidgets.QWidget()
self.page_2.setObjectName("page_2") self.page_2.setObjectName("page_2")
self.stackedWidgetSettings.addWidget(self.page_2) self.stackedWidgetPulseProgrammer.addWidget(self.page_2)
self.horizontalLayout.addWidget(self.stackedWidgetPulseProgrammer)
self.retranslateUi(Form) self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form) QtCore.QMetaObject.connectSlotsByName(Form)