How to disable a tab of tabWidget?
-
Assuming that
setEnabled()
is called on the right object: You are setting the property totrue
, which means the tab is enabledfalse
disables it. -
Assuming that
setEnabled()
is called on the right object: You are setting the property totrue
, which means the tab is enabledfalse
disables it.@Axel-Spoerl Thanks for the correction, but this code does not disable the tab with Index 2
self.ui.tabWidget_4.currentIndex(2).setEnabled(False)
.Butself.ui.tabWidget_4.setEnabled(False)
disables the whole tabWidget -
That’s why I said: Provided that you code points to the right object. Your
setEnabled()
call goes to the index. Do you want to disable anything there? Or do you just want the tab to be greyed out and inaccessible? In that case, pls look what the documentation says.setTabEnabled()
should be your friend.