-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.1
-
None
If QTabWidget::setCurrentIndex() is used to select a tab with a long name before the widget is shown, then tabs before that tab do not appear (see top-left screenshot). Clicking on another tab (if there is another visible tab) fixes the problem and the other tabs appear (top right screen shot).
Changing the tab to have a shorter name also fixes the issue (bottom screenshots).
To reproduce, create a new Qt project and add this to the MainWindow constructor (and #include <QTabWidget>):
auto* tw = new QTabWidget(this);
tw->addTab(new QWidget, "First");
tw->addTab(new QWidget, "Name is long");
tw->addTab(new QWidget, "Last");
tw->setCurrentIndex(1);
setCentralWidget(tw);