Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114916

Earlier tabs in QTabWidget don't appear if tab with long name is initially selected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important 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);

        1. qtabwidget-bug.png
          9 kB
          Jason N
        2. qtabwidget-bug-linux.png
          20 kB
          Jason N
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jason-nguyen-monash Jason N
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes