知道索引,就用 setCurrentIndex(index) 接口。
知道文本,就用 setCurrentText("text") 接口。
一般用 index 较多,因为 text 有可能会重复。
1 comboBox->setCurrentIndex(0);
2 comboBox->setCurrentText("xxx");
知道索引,就用 setCurrentIndex(index) 接口。
知道文本,就用 setCurrentText("text") 接口。
一般用 index 较多,因为 text 有可能会重复。
1 comboBox->setCurrentIndex(0);
2 comboBox->setCurrentText("xxx");
相关文章: