Jul-31-2019, 11:21 AM
Hi all,
I am starting with PyQT5 to set-up a GUI.
However, I am new to PyQT5 so therefore the question if there is an instruction to get the name of the active textline or to collect the contents of the textline without addressing the textline directly.
Currently I have the following code:
inputLining_name
inputLining_t
inputLining_rho
inputCoating_name
inputCoating_t
inputCoating_rho
Is there a cleaner/clever way of collecting the results of a textline and add it to a dictionary?
I am starting with PyQT5 to set-up a GUI.
However, I am new to PyQT5 so therefore the question if there is an instruction to get the name of the active textline or to collect the contents of the textline without addressing the textline directly.
Currently I have the following code:
def add_liner(self): self.cntLiner += 1 print(self.cntLiner, self.cntPipe) self.pipeproperty[self.cntPipe][self.cntLiner] = {} lining_name = self.inputLining_name.text() self.pipeproperty[self.cntPipe][self.cntLiner]["Name"] = lining_name lining_t = self.inputLining_t.text() self.pipeproperty[self.cntPipe][self.cntLiner]["t"] = lining_t lining_rho = self.inputLining_Rho.text() self.pipeproperty[self.cntPipe][self.cntLiner]["t"] = lining_rhoThe GUI consists of the following textlines:
inputLining_name
inputLining_t
inputLining_rho
inputCoating_name
inputCoating_t
inputCoating_rho
Is there a cleaner/clever way of collecting the results of a textline and add it to a dictionary?