Qt Creator no member named stackedWidget
问题 I've just designed my ui in the QT-Creator and, as the main application is based on two panels, I decided to use the StackedWidget for "change the layout" without opening a new window. So, I added a QTStackedWidget named: stackedWidget (as default). The problem is in mainwindow.cpp, I added a custom SLOT that contain: ui->stackedWidget->setCurrentIndex(1); when I build this the compiler says: mainwindow.cpp:25: error: no member named 'stackedWidget' in 'Ui::MainWindow' ui->stackedWidget-