The next click should be ui->label_2->setPixmap(pix); and so on.
I was trying to this with an array of strings containing the different labels. But the ui wont accept ui actions unless they are called at the right name from the beginning. For example i can't do like this:
Can you make an array of label pointers? And then do something like this? ui->label[0/* or 1 or 2 or 3...*/]->setPixmap(pix);
Edit: Also if you only have three labels and want the counter to go 0, 1, 2, 0, 1, 2, 0, 1, 2,... You can use integer modulus to wrap the counter back around from 3 to 0. counter = (counter+1) % 3; //increment and wrap around if necessary