How do I disable one tab in a QTabWidget?
问题 I have a QTabWidget called tabWidget. It has three tabs: "Basic", "Advanced", and "Current Structure". The tabs are displayed in the widget in that order. I want to disable the "Advanced" tab whenever the Boolean result is false. I thought it would be as simple as this code: bool result = false; if (result == false) { tabWidget->widget(1)->setDisabled(true); } Unfortunately, this code does not disable the tab, it remains enabled even when I check it: tabWidget->tabBar()->isTabEnabled(1); //