I want to display an image called image1 when a button1 is pressed and image2 when button2 is pressed. In order to do this I want to use ‘if’ statement. I wrote the following code:
if(ui->button1->clicked())
image.load(":/CondScrnIns.png");
else if(ui->button2->clicked())
image.load(":/CondScrnInsCentric.png");
but while executing these statements I’m getting the following error:
void QAbstractButton::clicked(bool) is protected
what function should I use insted of clicked()??
You will have to create slots for each buttons’s clicked signal and the do image.load in there.
Then in button1Clicked() and button2Clicked() slots you can put in the code to load the image or resize the dialog box whatever you want.