How do I get my classes to communicate with each other?
Solved
General and Desktop
-
Let's say I have a custom QWidget object in my MainWindow class. I can call the public function A of my object from MainWindow... But how can I call the public function B of MainWindow from my object? I suppose this can be done with signals and slots, but I'm not sure how.
-
@Forfunckle said in How do I get my classes to communicate with each other?:
I suppose this can be done with signals and slots
Yes, this is the prefered way as such a class should not know anything about main window.
To make it work simply create a signal in your custom widget and emit it each time you want to notify main window. In main window connect this signal to a slot.