probine
14th December 2006, 15:54
I have a class that creates a window and a text browser. The text browser is displayed in the window.
I want other classes to be able to print something in that text browser, therefore I have decided to declare it "friend". With this idea, any class can just "include" the window class an be able to print something.
The window class has this function:
friend void displayMessage(QString message){
textBrowser->append(message);
}
Note that textBrowser is public in the window class.
How can I make something like this work ?
I want other classes to be able to print something in that text browser, therefore I have decided to declare it "friend". With this idea, any class can just "include" the window class an be able to print something.
The window class has this function:
friend void displayMessage(QString message){
textBrowser->append(message);
}
Note that textBrowser is public in the window class.
How can I make something like this work ?