I am making a GUI program in Qt.
I have one tab and in that tab there is push button, what I want is when that button is clicked then it should open a tab in the same widget and it should be closable.
How can I do that? A example code will be good.
Thank you
I do not fully understand the question, but here is my best attempt at answering it. I suppose that you use
QTabWidgetfor your tabs. You can add a widget and select it by the following code:You cannot make single tabs closable, but you can intercept the close event:
And handle unwanted close events like this:
EDIT:
You can insert Tabs with:
Here is the documentation for the
QTabWidgetclass.