Important: Please read the Qt Code of Conduct -

'class Ui::MainWindow' has no member named 'stackedWidgetDigio'

  • Well, I really don't know why this gives me the above error:

    @void MainWindow::on_comboBox_currentTextChanged(const QString &arg1)
    if (arg1 == "SysConfig")
    ui->stackedWidgetDigio->currentIndex == 1;
    else if(arg1 == "Digital I/O")
    ui->stackedWidgetDigio->currentIndex == 0;

    And yea, I've got a StackedWidget called stackedWidgetDigio of course.

  • Moderators

    Rebuild your project (clean, run qmake, rebuild).

    Also, are you aware that the code you wrote does not do a thing, and is actually invalid? If you want to change the index, use setCurrentIndex() method. If you want to read, don't use equality check (==).

  • Okay, thanks.

    And yea, I forgot about that. I've coded for 1 year now in VB.NET and now came back to Qt, kinda hard to switch again.

    /e: No effect. I noticed, that he does not know the widget in ui_mainwindow.h - he does not write it into this file. He simply doesn't write any new widgets in there.

    /e2: My whole UI compiler's broken. I created a new project as a test, and somehow all the stuff which I created in the designer for my normal project is now in the ui_mainwindow.h of the new test project. It's all fucked up. I'm updating Qt now in hope that I won't have to redesign everything.

    /e3: Had to do a full uninstall of all Qt versions, clean the regedit of everything Qt and MinGW related etc. - then reinstalling Qt. Works again.

Log in to reply