qt - How to set current value in a QCombobox - Stack Overflow
https://stackoverflow.com:443/questions/68360715/how-to-set-current-value-in-a-qcombobox
WEBJul 13, 2021 · 1 Answer. Sorted by: 1. After filling combobox, set the current index through setCurrentIndex() ui->comboBox_1->setCurrentIndex(3); So your code becomes. ui->comboBox_1->addItem("200ms", QVariant(0.2)); ui->comboBox_1->addItem("500ms", QVariant(0.5)); ui->comboBox_1->addItem("1000ms", QVariant(1)); ui->comboBox_1->addItem("1500ms", QVariant(1.5));
DA: 1 PA: 79 MOZ Rank: 40