Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从中删除所有小部件QStackedWidget?我只需要从QStackedWidget.
QStackedWidget
您需要遍历所有小部件并删除它们中的每一个:
for(int i = stackedWidget->count(); i >= 0; i--) { QWidget* widget = stackedWidget->widget(i); stackedWidget->removeWidget(widget); widget->deleteLater(); }