My program works fine untill, running a function few times, and after few times of running function the gui start turnning all white and grey, but functionallity works fine, have no idea why.
Before the problem
After the problem
tried to follow the cade and change thing but nothing works, it still happens
there is alot of the code that going on so let me just show a specific function, although it happens to all functions.
self.obj.Config_Etc_mechanical.clicked.connect(lambda: self.Functions.start_stop_sb_thread(self.obj.Config_Etc_mechanical))
def start_stop_sb_thread(self, button_ui_obj, usb_needed=False, kill_master=False):
self.gm.start_stop_test_thread(lambda: self.run_automation(button_ui_obj, usb_needed), bt_to_change="stop_automation", start_txt="Stop Automation",
stop_txt="Run Automated Tests", kill_master=kill_master)
if self.func_is_running_flag:
self.gm.test_worker.ext_finished_signal_2.emit()
self.gm.test_worker.ext_finished_signal_3.emit()
def start_stop_test_thread(self, function, bt_to_change=None, start_txt=None, stop_txt=None, function_name=None, kill_master=True):
"""
This method enable you to start and stop a thread.
kill_master = if False the button who called the function won't be able to kill the thread.
this is in order to make a master button to kill thread.
"""
if bt_to_change:
self.test_worker.ext_finished_signal.connect(lambda: self.emit_ui_label(bt_to_change, stop_txt))
self.test_worker.toggled_thread = True
if not self.test_worker.running:
if function_name is None:
self.test_worker.start_thread(func=function)
else:
self.test_worker.start_thread(func=function, func_name=function_name)
if bt_to_change:
self.emit_ui_label(bt_to_change, start_txt)
else:
if kill_master:
self.test_worker.ext_finished_signal.emit()
self.test_worker.kill_thread()
if self.iperf:
subprocess.Popen('Taskkill /IM iperf3.exe /F', shell=True)
self.iperf = False
also thought to mention that all QlineEdits and QComboBoxes are connected to change
def ui_default_connect(ui, qtlines_ignore_list=[], qtcombo_ignore_list=[]):
for QC in ui.tabWidget.parentWidget().findChildren(QtWidgets.QLineEdit):
if QC.objectName() not in qtlines_ignore_list:
QC.setStyleSheet(UI_DROPBOX_DEFAULT)
QC.textChanged.connect(partial(ui_default, QC))
for QC in ui.tabWidget.parentWidget().findChildren(QtWidgets.QComboBox):
if QC.objectName() not in qtcombo_ignore_list:
QC.setStyleSheet(UI_DROPBOX_DEFAULT)
QC.currentTextChanged.connect(partial(ui_default, QC))