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

TabView currentIndex set incorrectly when Tab removed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.3.1
    • 5.3.0
    • Quick: Controls 1
    • None
    • Qt 5.3. All OS environments; tested at least with Windows and Mac
    • 7c7e510b6b4fb84d248059b9c55f58490fccc339

    Description

      Whenever a Tab is removed from a TabView (imagine a browser tab type of implementation), the current index is always removed by one.

      This isn't the right behaviour, when compared against any native tab functionalities. The current index should only be reduced when the current index is already at the last index.

      Looking at the source code for TabView.qml, this is the code I found (which seems incorrect):

      file: C:\Qt\5.3\msvc2012_opengl\qml\QtQuick\Controls\TabView.qml

      /*! Removes and destroys a tab at the given \a index. */
      function removeTab(index)

      { var tab = __tabs.get(index).tab __tabs.remove(index, 1) tab.destroy() if (currentIndex > 0) currentIndex-- __setOpacities() }

      Attachments

        Activity

          People

            jturcott Jocelyn Turcotte
            qt_sur qt_sur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: