I am just starting a Qt tutorial, and I am also a beginner level of C++. In the Qt tutorial, there is an example that use statement to set the button's text:
ui->pushButton->setText("Hello");
I understand that we can use ->
operator to allow an pointer to access member of class. In this case, pushButton->setText("Hello")
, but I just don't understand the meaning of ui->pushButton
, I search some answers explained that the ui
hold the reference of the pushButton
, but how this can be done? pushButton
is a pointer to the object, is not a member of the class, can we use ->
to put the object address to the ui
pointer?
Sorry for my bad English language, I may confused you. I wish someone can give me a clear explanation, thanks in advance.