Jason S. Stevenson
I want to ask
How do i close the previous tab , the moment i add new one ??
What do you mean by "close"? You don't "close" the tabs on the bar or the page widgets, you just click between them.
If you mean to remove the Tab from the TabWidget, you can use
However, if you are in need of some sort of Show one "page" of many and flip between them, then
is a much better fit that TabWidget.
Most of the functionality in
QTabWidgetis provided by a
QTabBar(at the top, providing the tabs) and a
QStackedWidget(most of the area, organizing the individual pages).
So how do you mean that a
QStackedWidgetis a better fit than a
QTabWidget, if it's already composed of one?
@JonB Because if the OP always want's to delete the previous tab before opening a new one, there's not much sense to have tabs at all.
I don't quite get it, but maybe I never will. If you have a bunch of "pages" in a
QStackedWidget, and you want to use a tab like in a
QTabBarto select which one to show, why would you want to "delete the previous tab [on the tabbar]"? And if you don't have a bunch of pages, why would you then want a
QStackedWidgetat all? If it's not a one-word answer I may not get it, so don't worry if it's too hard to explain!
I don't quite get it, but maybe I never will. If you have a bunch of "pages" in a QStackedWidget, and you want to use a tab like in a QTabBar to select which one to show, why would you want to "delete the previous tab [on the tabbar]"?
Good question that is left to the OP to answer as I don't know what he wants to do.