Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Remove close icon on last QTabWidget
I would provide a simple way to add and remove tabs from
QTabBar. The first thought was to set a "plus" icon to the last tab and set the closeable property to true. When the use click on the last tab I insert a new one in the previous position. To remove one just click on the 'x' icon. It works, but it's not fine to have both plus and close icons on the last tab.
Is there a way to hide the close icon only for the last tab?
It's ok the opposite: add a plus icon (or whatever) on the right of the last tab.
Would the corner widget using a button do the trick ?
Well if you insert new widget, it does hide the close button.
bar->setTabButton(1,QTabBar::ButtonPosition::RightSide,new QPushButton(bar) );
@SGaist yep, it actually does. I had to try it because I didn't understand how it works...
@mrjj This is another good hint. Thanks!