Hi,

I am trying to find a way to change the text displayed on a button, currently I have created a button:

Qt Code:
  1. QPushButton *uploadButton = new QPushButton(tr("Upload To Unit number one"));
To copy to clipboard, switch view to plain text mode 

and once I have clicked this button, I would like the button label to be changed to something like

Qt Code:
  1. "Upload To Unit number two"
To copy to clipboard, switch view to plain text mode 


I know I can use something like:

Qt Code:
  1. uploadButton->setText("upload to unit number two");
To copy to clipboard, switch view to plain text mode 

But when I put this in a slot that is activated by the signal emitted by the uploadButton, my application just quits,

I think maybe I have to declare the uploadButton as a "Global" widget( if you know what I mean), but I'm not sure how to do this..


Any advice appreciated, Thanks