Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[Solved]Combobox index using as input for function

$
0
0
I have different files and i want based on the index/name of the combobox that the file i use changes. i have something like this now, but it does not work: MWidget::MWidget(QWidget *parent) :     QWidget(parent),     ui(new Ui::MWidget) {     ui->setupUi(this);     connect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(on_comboBox_currentIndexChanged(int)));       QStringList List;     List<<"C:\\Airfoils\\a18.dat"<<"C:\\Airfoils\\a18sm.dat"<<"C:\\Airfoils\\a63a108c.dat"<<"C:/Airfoils/ag03.dat";       //read file for drawing     QFile file(List[index]);   void MWidget::on_comboBox_currentIndexChanged(int index) {     switch (index) {     case 0 :       ui->comboBox->currentIndexChanged(0);       break;     case 1 :         ui->comboBox->currentIndexChanged(1);         break;     } I cut out irrelevant code parts, since without the input form the combobox the loading from files works, based on the order of which they are in the list. I also want to do this for about 1500 files..

Viewing all articles
Browse latest Browse all 13965

Trending Articles