I ran into the same problem. I use the following approach.
Now here is the data.
genTab is the name of my QTabWidget
tabX is the name of the tab that I want to delete.
(Note that this is the second tab in the widgets of the tab. Therefore, I will use "1" as an index to link to this tab)
The code to remove and add is below.
ui.genTab->removeTab(1);
Note here that this is easy to do if you have a tab added statically during development. Since we will have the name of the object associated with the tab, and therefore we can refer to it using ui.tabX. From what you say, in your case the tab is really added statically at design time.
However, if you add tabs dynamically, then you probably have to keep tabs in the list, and then have another list for the deleted tables.
But the first solution is likely to work for you. Hope this helps.
-Arjun
Amm
source share