槽函数
Q_OBJECT
public slots:
void OnCombox1IndexChanged(const QString&);
槽函数定义
void Hydraulicslopedigitaltwin::OnCombox1IndexChanged(const QString& context)
{
cout << "Hello Hydraulicslopedigitaltwin::" << std::endl;
}
connect写法:
connect(ui.comboBox1, SIGNAL(currentIndexChanged(QString)),
this, SLOT(OnCombox1IndexChanged(QString)));
插入数据的时候不发出信号:
ui.comboBox1->blockSignals(true);
//insert or delete items
ui.comboBox1->blockSignals(false);