QT组合框QComboBox选择
步骤
1. 在qt设计器中加入控件:QComboBox
2. 在.h中加入槽函数
private slots:
void on_modulation_clicked(int item); //QComboBox选择索引
3.在.cpp加入信号槽连接
QObject::connect(ui->ComBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_modulation_clicked(int)));
4. 在cpp中编写槽函数实现
void SignalGeneratorUi::on_modulation_clicked(int item)
{
ui->ComBox->setCurrentIndex(item);
}