How do I do this:
For instance, label username = “user”
I click a button and a dialog box appears which asks for an input. I enter “name” in the input box and click ok. Now how do i make it so that the label username will automatically change to “name” when I click on the ok button on the dialog box?
This value goes to the Settings value. I know how to load a value from a setting, but if my label username and the input box in which i entered “name” are in 2 different classes, how do i cause the change? please help.
You need to use signals and slots. In class where you have this QLineEdit you have to declare signal like
After someone click ‘Ok’ button you have to emit this signal:
And in class where you invoke SomeClass you have to connect this signal to slot in which you will change labels value, for example: