0
I’m using Python 3.7
I have 2 forms (windows) that I made with Pyqt5, in one of them have some Labels that I need to change according to the settings window configuration.
created a modules with the following function:
def calculaTaxas(self):
valorBase = self.ui.lbl_saldoAtual.text()
When I call the function from the main window, the data loads normally.
But when I change the data and try to call the function by the settings window to update the main screen with the new values, the following error appears:
AttributeError: 'Ui_frm_Config' object has no attribute 'lbl_saldoAtual'
I understood that he is passing the form of config to the self of the function, I tried in several ways update the screen and could not, not even trying to call directly:
valorBase = Ui_frm_principal.lbl_saldoAtual.text()
What I would really like is to be able to call the function calculaTaxas() without SELF as parameter so I can update the main screen of any part of the code or window.
I don’t know if it’s relevant, but follow the screen configuration.
Main Screen:
class TelaPrincipal(QMainWindow):
def __init__(self,*args,**argsv):
super(TelaPrincipal,self).__init__(*args,**argsv)
self.ui = Ui_frm_principal()
self.ui.setupUi(self)
Configuration screen:
class TelaConfig(QMainWindow):
def __init__(self,*args,**argsv):
super(TelaConfig,self).__init__(*args,**argsv)
self.ui = Ui_frm_Config()
self.ui.setupUi(self)