Refactor PD Pattern Tasks ui files

All files contain the same add/remove buttons and a feature list.

These common elements are moved into the TaskTransformedParameters.ui file.
The same goes for the common OK Button that is used in a MultiTransform.

The ui files for the patterns only contain their distinctive
parameters. And the common ui files contain an empy widget that will
be filled with the respective parameter widgets from the patterns.
This commit is contained in:
André Althaus
2024-02-17 10:40:04 +01:00
parent c4daf256b2
commit 5139182dbe
7 changed files with 158 additions and 437 deletions

View File

@@ -41,6 +41,7 @@ set(PartDesignGui_UIC_SRCS
TaskHoleParameters.ui
TaskRevolutionParameters.ui
TaskTransformedMessages.ui
TaskTransformedParameters.ui
TaskMirroredParameters.ui
TaskLinearPatternParameters.ui
TaskPolarPatternParameters.ui

View File

@@ -7,47 +7,25 @@
<x>0</x>
<y>0</y>
<width>270</width>
<height>339</height>
<height>188</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="toolTip">
<string>List can be reordered by dragging</string>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@@ -184,27 +162,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
@@ -221,49 +178,11 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>comboDirection</tabstop>
<tabstop>checkReverse</tabstop>
<tabstop>spinLength</tabstop>
<tabstop>spinOccurrences</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonAddFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonRemoveFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>70</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>198</x>
<y>21</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonRemoveFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonAddFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>198</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>70</x>
<y>21</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -7,47 +7,25 @@
<x>0</x>
<y>0</y>
<width>253</width>
<height>260</height>
<height>55</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="toolTip">
<string>List can be reordered by dragging</string>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -62,70 +40,11 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>comboPlane</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonAddFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonRemoveFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>66</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>186</x>
<y>21</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonRemoveFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonAddFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>66</x>
<y>21</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -6,48 +6,26 @@
<rect>
<x>0</x>
<y>0</y>
<width>256</width>
<height>266</height>
<width>229</width>
<height>174</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="toolTip">
<string>List can be reordered by dragging</string>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
@@ -66,57 +44,20 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<widget class="QWidget" name="subFeatureWidget" native="true"/>
</item>
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>listTransformFeatures</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonAddFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonRemoveFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>67</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>188</x>
<y>21</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonRemoveFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonAddFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>188</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>67</x>
<y>21</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -7,47 +7,25 @@
<x>0</x>
<y>0</y>
<width>253</width>
<height>339</height>
<height>206</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="toolTip">
<string>List can be reordered by dragging</string>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@@ -196,27 +174,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
@@ -233,49 +190,11 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>comboAxis</tabstop>
<tabstop>checkReverse</tabstop>
<tabstop>polarAngle</tabstop>
<tabstop>spinOccurrences</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonAddFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonRemoveFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>66</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>186</x>
<y>21</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonRemoveFeature</sender>
<signal>clicked(bool)</signal>
<receiver>buttonAddFeature</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
<y>21</y>
</hint>
<hint type="destinationlabel">
<x>66</x>
<y>21</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -7,44 +7,25 @@
<x>0</x>
<y>0</y>
<width>253</width>
<height>270</height>
<height>85</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -55,7 +36,7 @@
</widget>
</item>
<item>
<widget class="Gui::QuantitySpinBox" name="spinFactor"/>
<widget class="Gui::QuantitySpinBox" name="spinFactor" native="true"/>
</item>
</layout>
</item>
@@ -73,40 +54,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="buttonOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
@@ -123,13 +70,8 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>spinFactor</tabstop>
<tabstop>spinOccurrences</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PartDesignGui::TaskTransformedParameters</class>
<widget class="QWidget" name="PartDesignGui::TaskTransformedParameters">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>262</width>
<height>207</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="buttonAddFeature">
<property name="text">
<string>Add feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRemoveFeature">
<property name="text">
<string>Remove feature</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidgetFeatures">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="toolTip">
<string>List can be reordered by dragging</string>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="featureUI" native="true"/>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUpdateView">
<property name="text">
<string>Update view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>buttonAddFeature</tabstop>
<tabstop>buttonRemoveFeature</tabstop>
<tabstop>listWidgetFeatures</tabstop>
<tabstop>checkBoxUpdateView</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>