mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix,refactor: config_dialog.ui changed design of general box, remove plot works
This commit is contained in:
@ -40,12 +40,23 @@ class MainApp(QWidget, Ui_Form):
|
||||
new_tab.pushButton_y_new.clicked.connect(
|
||||
lambda: self.add_new_signal(new_tab.tableWidget_y_signals)
|
||||
)
|
||||
new_tab.pushButton_remove_current_plot.clicked.connect(self.remove_current_plot)
|
||||
|
||||
# Tab header name
|
||||
new_tab_name = f"Plot {self.tabWidget_plots.count() + 1}"
|
||||
|
||||
# Add new tab
|
||||
self.tabWidget_plots.addTab(
|
||||
new_tab_widget, new_tab_name
|
||||
) # Add the new QWidget as a new tab
|
||||
self.tab_ui_objects.append(new_tab) # Append the Tab_Ui_Form object to the list
|
||||
|
||||
def remove_current_plot(self):
|
||||
current_index = self.tabWidget_plots.currentIndex()
|
||||
if current_index != -1: # Ensure there is a tab to remove
|
||||
self.tabWidget_plots.removeTab(current_index)
|
||||
del self.tab_ui_objects[current_index]
|
||||
|
||||
def add_new_signal(self, tableWidget_y_signals):
|
||||
row_position = tableWidget_y_signals.rowCount()
|
||||
tableWidget_y_signals.insertRow(row_position)
|
||||
@ -64,7 +75,7 @@ class MainApp(QWidget, Ui_Form):
|
||||
}
|
||||
|
||||
for index in range(self.tabWidget_plots.count()):
|
||||
tab = self.tabWidget_plots.widget(index)
|
||||
# tab = self.tabWidget_plots.widget(index) #TODO can be removed
|
||||
ui_object = self.tab_ui_objects[index]
|
||||
table = ui_object.tableWidget_y_signals
|
||||
signals = [
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>558</width>
|
||||
<width>572</width>
|
||||
<height>769</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -21,26 +21,88 @@
|
||||
<property name="title">
|
||||
<string>Plot Layout Settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Number of Columns</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spinBox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Scan Types</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_scanTypes">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_add_new_plot">
|
||||
<property name="text">
|
||||
<string>Add New Plot</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Appearance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_appearance">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dark</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>bright</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Default Color Palette</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" rowspan="3">
|
||||
<widget class="QComboBox" name="comboBox_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_colormap">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>magma</string>
|
||||
@ -58,40 +120,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Number of Columns</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="4">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_add_new_plot">
|
||||
<property name="text">
|
||||
<string>Add New Plot</string>
|
||||
</property>
|
||||
</widget>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Reference in New Issue
Block a user