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

ScrollView crashes when ListView model is set to another model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.1
    • 5.9.0
    • Quick: Controls 2
    • None
    • db6f1440cbe78018e442c1fb961310a4e619e8fe

    Description

      I have a QStandardItemModel that has text and another QStandardItemModel, both have CPP ownership, besides I have code like: 

      ScrollView {
        ListView {
          model: devices
          delegate: ItemDelegate {
            text; roleText
            onClicked: connectionsView.model = roleModel
          }
        }
      }

      ScrollView {
        ListView {
          id: connectionsView
        }
      }

      The first click works fine, the second crashes the application, removing the surrounding ScrollView of connectionsView, it works as expected,

      The backtrace I got is not of much use, my app is a debug build but it seems Qt is not, I'm using precompiled Qt binaries on Linux.

      Attachments

        1. main.qml
          0.7 kB
        2. qml.qrc
          0.1 kB
        3. qtquickcontrols2.conf
          0.3 kB
        4. scrolltest.pro
          1 kB
        5. main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            dantti Daniel Nicoletti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are 2 open Gerrit changes