I've done a lot of research, but could not find anyone with this specific problem so far. Very sorry if there is already a topic, but couldnt find it.
What im trying to do is to find a QLabel in a QGridLayout, by importing a .txt file and reading out names and values.
For example:
power 5
Now i need to find the QLabel named "power_fw" to set the text of this Label to "5"
set_value("power 5")
def set_value(talent):
list_value = talent.split(" ") # Now i have a list with talent[0] = "power" and its value at talent[1] = "5"
talent_now = talent[0] + "_fw" # I already have the exact name of the QLabel i am trying to find, which would be "power_fw" at this moment
ui.talent_now.setText(talent[1]) # So the idea is that "talent_now" is a string whichs value is the name of the QLabel i am trying to set a new text. Obviously it does not work, because talent_now is not a QLabel but just its name.
I hope someone can help me with this specific problem and again, sorry if this topic already exists in some way. I could not find anything that worked out yet.
topics i found interesting in context of this problem:
get widgets by name from layout
findChild on object created within pyqt designer
None of the solutions provided in these topics made me able to get this right.