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

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

XMLWordPrintable

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

      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
      
      

       

       

       

        1. main.cpp
          0.6 kB
          Christian Ehrlicher
        2. newmain.cpp
          0.6 kB
          Marius van Horssen
        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
            mariusvanhorssen Marius van Horssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes