I have a QTabWidget with only 3 tabs and I would like that those tabs take the space of the lenght of the widget: Now I have :
And I would like
I know that I could do this with stylesheets for a given qtabwidget size but I dont know how I could do that it fits automatically if the qtabwidget size changes.
after the tabwidget's stylesheet is loaded and applied you need to resize the tabbar in your code: I think you could do this in two ways, either by subclassing the QTabWidget and manipulate the tab bar inside(recommended) or as following:
@ QTabBar tabBar = ui->tabWidget->findChild<QTabBar >(QLatin1String("qt_tabwidget_tabbar"));
QPushButton button = new QPushButton();
getting the tabbar in such way looks "unorthodox" but it works :)
I wil try this out, thanks :)