Is it possible to declare a variable as friend ?
How and where this placement whould be done?
Is it possible to declare a variable as friend ?
How and where this placement whould be done?
Thanks fot eh link... before I posted this question I looked and search for it.
I know it is possible to declare friend funtions. Is it possible to declare friend variables ? How ?
But what would a friend variable do? When a function or class is a friend of class X, it can access private members of X objects. But a variable can't 'access' anything. It's just a variable.
What exactly are you trying to do?
"The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry
I have a QPushButton in a class.
I would like to for example change the text of the button from another class.
I know I can create a function that will allow me to do that, buy I have many buttons, so I do not want to create a function for each of them.
Then maybe your buttons are in a wrong class?
Maybe you could make use of QButtonGroup? Identify all your buttons with an id number, and use the id number as a parameter of the text setting function?
Bookmarks