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

When TabBar populated from model and tab content has Window - crash on delete from model

    XMLWordPrintable

Details

    • qtdeclarative: 1e3924d8f585dd9099eb74ffbc17950c693d14da & 573b3cdaaf432b9eab2f2bbe35b6b4684d4a7c3d & 43ca477b0afa668f78f9543ef8883873466586b3

    Description

      When I create tab view using components from QtQuick.Controls 2 with tabs created from model an content for this tabs has Window, program crashes on deleting items from model.
      If I remove Window or remove TabBar - no crashes.
      To reproduce, run the following example and press "Delete" button.

      import QtQuick 2.0
      import Qt.labs.controls 1.0
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          ListModel {
              id: tabModel
      
              ListElement {
                  text: "Test 0"
                  source: "TestItem.qml"
              }
              ListElement {
                  text: "Test 1"
                  source: "TestItem.qml"
              }
          }
      
          ColumnLayout {
              anchors.fill: parent
      
              TabBar {
                  id: tabBar
      
                  Layout.fillHeight: false
                  Layout.fillWidth: true
                  currentIndex: 1
      
                  Repeater {
                      model: tabModel
                      delegate: TabButton {
                          text: model.text
                      }
                  }
              }
      
              StackLayout {
                  id: stackLayout
      
                  Layout.fillHeight: true
                  Layout.fillWidth: true
                  currentIndex: tabBar.currentIndex
      
                  Repeater {
                      model: tabModel
                      delegate: Loader {
                          source: model.source
                      }
                  }
              }
      
              Button {
                  Layout.alignment: Qt.AlignHCenter
                  text: "Delete"
                  onClicked: tabModel.remove(0)
              }
          }
      }
      
      TestItem.qml
      import QtQuick 2.0
      import QtQuick.Window 2.0
      
      Item {
          Window { }
      
          Text {
              anchors.centerIn: parent
              text: "Item %1".arg(model.index)
          }
      }
      

      Stack trace:
      0 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::data qscopedpointer.h 135 0x7ffff797d174
      1 qGetPtrHelper<QScopedPointer<QObjectData>> qglobal.h 1025 0x7ffff7a6be3c
      2 QQuickItem::d_func qquickitem.h 443 0x7ffff7a6c82c
      3 QQuickItem::x qquickitem.cpp 6127 0x7ffff7a64cae
      4 FxListItemSG::position qquicklistview.cpp 263 0x7ffff7b3cdb1
      5 QQuickItemViewPrivate::applyModelChanges qquickitemview.cpp 1966 0x7ffff7b93a73
      6 QQuickItemViewPrivate::layout qquickitemview.cpp 1868 0x7ffff7b931a2
      7 QQuickItemView::updatePolish qquickitemview.cpp 1472 0x7ffff7b910e4
      8 QQuickWindowPrivate::polishItems qquickwindow.cpp 263 0x7ffff7a7a737
      9 QSGGuiThreadRenderLoop::renderWindow qsgrenderloop.cpp 379 0x7ffff7a3ecec
      10 QSGGuiThreadRenderLoop::event qsgrenderloop.cpp 490 0x7ffff7a3f477
      11 QCoreApplicationPrivate::notify_helper qcoreapplication.cpp 1136 0x7ffff67dc33f
      12 doNotify qcoreapplication.cpp 1077 0x7ffff67dbfd7
      13 QCoreApplication::notify qcoreapplication.cpp 1063 0x7ffff67dbf4a
      14 QGuiApplication::notify qguiapplication.cpp 1550 0x7ffff7226c1a
      15 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1002 0x7ffff67dbeda
      16 QCoreApplication::sendEvent qcoreapplication.h 227 0x7ffff67dfece
      17 QTimerInfoList::activateTimers qtimerinfo_unix.cpp 637 0x7ffff685317a
      18 timerSourceDispatch qeventdispatcher_glib.cpp 176 0x7ffff6854498
      19 g_main_context_dispatch 0x7ffff3a6c127
      20 g_main_context_iterate.isra 0x7ffff3a6c358
      21 g_main_context_iteration 0x7ffff3a6c3fc
      22 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 417 0x7ffff6854e49
      23 QPAEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 115 0x7fffe8b84f30
      24 QEventLoop::processEvents qeventloop.cpp 128 0x7ffff67d87f8
      25 QEventLoop::exec qeventloop.cpp 204 0x7ffff67d8aec
      26 QCoreApplication::exec qcoreapplication.cpp 1272 0x7ffff67dc60e
      27 QGuiApplication::exec qguiapplication.cpp 1541 0x7ffff7226bca
      28 main main.cpp 11 0x400e35

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes