Q:

How can I initialize a default value of QComboBox without to click it?

How can I initialize a default value of QComboBox without to click it?  I tried with
ui->combBox->setCurrentIndex(1);

but when I read the value at first I get unfortunately a -1 and only after the QComboBox was clicked its value become 1.

A:

Are you sure there's at least two values in the QComboBox? Counting begins from 0, not 1. If you want to select the first value, you need to:
ui->combBox->setCurrentIndex(0);

If that's not the problem, and you indeed have two values in the combo box, then make sure that the ui has been set up first. This call needs to execute first:
ui->setupUi(this);

It's what actually fills the combo box with the values specified in the .ui file.

A:

I solved the problem. The ui->combBox->setCurrentIndex(1); was in constructor before 
connect(ui->combBox,SIGNAL(currentIndexChanged(int)).... 
@Nikos C. thank you very much for a good tip.

