Skip to content
Snippets Groups Projects
Commit 029db460 authored by Ivo Peterek's avatar Ivo Peterek
Browse files

TMP: working on combobox items selection #2

parent fc11cecb
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TabWidget(object):
def __init__(self):
self.current_labels_dic = {'xLabel':None, 'funcLabel':None}
self.tab_widget = None
self.data_path = ''
self.config_path = ''
......@@ -189,6 +190,7 @@ class Ui_TabWidget(object):
lineEdit_parameters_list = []
self.comboBox_parameters_list = []
self.all_parameters = ['key', 'config', 'funcLabel', 'xLabel']
self.combobox_items_dic = {}
for i in range(self.parameters_count):
label_parameters_list.append(QtWidgets.QLabel('Parameter {}'.format(i+1)))
label_parameters_list[i].setFont(font)
......@@ -196,6 +198,9 @@ class Ui_TabWidget(object):
lineEdit_parameters_list.append(QtWidgets.QLineEdit())
self.comboBox_parameters_list.append(QtWidgets.QComboBox())
self.combobox_items_dic[self.comboBox_parameters_list[-1]] = list(self.all_parameters)
func_list = []
......@@ -454,7 +459,6 @@ class Ui_TabWidget(object):
def retranslateUi(self, TabWidget_p):
_translate = QtCore.QCoreApplication.translate
TabWidget_p.setWindowTitle(_translate("TabWidget", "Radar configuration"))
......@@ -528,12 +532,32 @@ class Ui_TabWidget(object):
def __parameters_combobox(self, current_combo_box):
self.unused_labels = self.all_parameters
if current_combo_box.currentText() in ['xLabel', 'funcLabel']:
self.unused_labels.remove(current_combo_box.currentText())
if self.current_labels_dic[current_combo_box.currentText()] != current_combo_box:
self.current_labels_dic[current_combo_box.currentText()] = current_combo_box
for key, val in self.combobox_items_dic.items():
if key == current_combo_box:
continue
self.combobox_items_dic[key].remove(current_combo_box.currentText())
key.clear()
key.addItems(self.combobox_items_dic[key])
else:
if current_combo_box in self.current_labels_dic.values():
self.current_labels_dic[current_combo_box.currentText()] = None
for key, val in self.combobox_items_dic.items():
if key == current_combo_box:
continue
self.combobox_items_dic[key].append(current_combo_box.currentText())
key.clear()
key.addItems(self.combobox_items_dic[key])
for e in [l for l in self.comboBox_parameters_list if l is not current_combo_box]:
'''for e in [l for l in self.comboBox_parameters_list if l is not current_combo_box]:
e.clear()
e.addItems(self.unused_labels)
e.addItems(self.unused_labels)'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment