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

QTabWidget::removeTab(int) removes two tabs (in almost all cases)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.12.5
    • None
    • macOS

    Description

      QTabWidget::removeTab removes 2 tabs (instead of 1) in almost all cases. Only when the last tab is removed, the function works correct and only 1 tab is removed.

      For example:

       

      QTabWidget* pTabWidget = new QTabWidget();
      pTabWidget->addTab(new QWidget(), "1");
      pTabWidget->addTab(new QWidget(), "2");
      pTabWidget->addTab(new QWidget(), "3");
      pTabWidget->addTab(new QWidget(), "4");
      
      delete pTabWidget->widget(1);
      pTabWidget->removeTab(1); //This removes tab "2" and "3", which is incorrect
      delete pTabWidget->widget(pTabWidget->count() - 1);
      pTabWidget->removeTab(pTabWidget->count() - 1); //This removes only tab "4", which is correct
      
      

       

       

       

      Attachments

        1. main.cpp
          0.6 kB
        2. newmain.cpp
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mariusvanhorssen Marius van Horssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes