I have a QTabWidget called tabWidget. It has three tabs: Basic, Advanced, and Current Structure. Tabs are displayed in widgets in this order.
I want to disable the Advanced tab when 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 if I check it:
tabWidget->tabBar()->isTabEnabled(1);
Why is the tab not disabled? Is there any other way to do this?
I am using Qt 5.4.0.
source share