【Qt】ComboBox 下拉式選單
1. 建立選單資料
ui->ComboBox->insertItem(0,"ONE")
ui->ComboBox->insertItem(1,"SEC")
2.指定選取
ui->ComboBox->setCurrentIndex(1);
顯示第二筆選項
3.取得當前選擇
int num = ui->ComboBox->CurrentIndex();
QString text = ui->ComboBox->CurrentText);

沒有留言:
張貼留言