Accessing objects inside form
General and Desktop
2
Posts
2
Posters
837
Views
1
Watching
-
wrote on 10 Sept 2013, 05:35 last edited by
so im a beginner in qt. my question is let's say i created something in the form of the qt gui application. how can i access that inside the c++ code ?
-
wrote on 10 Sept 2013, 06:02 last edited by
when you create a form using the qtcreator, it creates a matching class
have a look at the ui pointer in that classfor example i created a the form called MainWindow, QtCreator made a MainWindow class that contains a
@Ui::MainWindow *ui;@
to access a button that i created on MainWindow i can call:
@ui->pb_myButton.setText("allo allo");@
1/2