Best way is to have a method on your mainwindow that sets a text on whatever label you need with a descriptive name of what it does. That way you do not have other classes depend on implementation details (name of the label and its place in the structure of the UI) of the mainwindow.
Then you pass the mainwindow itself to the aha method, not the UI file.
↧