To get the index from the QComboBox change event of a QComboBox element, use:
connect(ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)));
in mainwindow.h:
private slots: void indexChanged(int index);
in mainwindow.cpp:
void MainWindow::indexChanged(int index) {
source share