The code depends on what method you used to integrate the .ui file in C++ code, there are many ways to achieve that (i personally prefer to use a private pointer to the ui class, that is because the code is better encapsulated that way, and disadvantage is that you most likely will need to code more signals and slots to keep that pointer private
)
So the code can be:
void MainWindow:: on_button_clicked()
{
// this depends on how you integrate the .ui file
// example if ui is a pointer
ui->YourButtonName->setText("Hello World!");
}
void MainWindow:: on_button_clicked()
{
// this depends on how you integrate the .ui file
// example if ui is a pointer
ui->YourButtonName->setText("Hello World!");
}
To copy to clipboard, switch view to plain text mode
And one more thing, i really advise you ignore the feature called auto-connect (the one based on naming the slots like this on_ObjectName_SignalName() ) at least at the beginning learn how and when to do the connections and when you are comfortable with signal/slots "mechanism", decide if you will use auto-connect or not.
LE: The thing with the signal is that you will not implement the signal, you just declare the signals something like this signals: void mySignal(int x); and you don't write something like void signal(int x) {//... code; }
You just "call" the signal using: emit mySignal(10);
Bookmarks