Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Ui can only be referenced in mainwindow.c
houmingc last edited by
Currently, ui can be referenced in mainwindow.c but not in other files.
How to eliminate this shortcoming.
ui->m_label_>setText("Good Morning"); //not possible.
andreyc last edited by
ui is a privet pointer in a MainWindow class.
If you want to update a content of ui from another class then you
need to add a signal to a ticker class and emit that signal each time when you need to update a content of MainWindow::ui or you need to pass ui to that class. In the later case you will have to maintain ui from two classes which is not very good idea.