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

SpringAnimation crashes when used in ListView's Transition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.2.0 RC1
    • 5.0.2, 5.1.1, 5.2.0 Beta1
    • None
    • I've been able to reproduce this crash with Qt 5.1.1 and Qt 5.2.0 Beta 1 on Arch Linux x86_64 and with Qt 5.0.2 on Windows XP 32-bit. The stacktrace is from Qt 5.1.1 on Arch Linux.

    Description

      SpringAnimation crashes when it completes and is used in ListView's Transition. This happens always when ListView's model has more than one item. It doesn't crash when the model doesn't have multiple items.

      crash.qml
      import QtQuick 2.0
      
      Rectangle {
          width: 250
          height: 250
      
          ListView {
              anchors.fill: parent
              model: ListModel {
                  ListElement { text: "A" }
                  ListElement { text: "B" }
              }
      
              populate: Transition {
                  SpringAnimation { properties: "x"; from: -100; to: 0; spring: 4; damping: 0.3 }
              }
      
              delegate: Text {
                  text: "Test"
              }
          }
      }
      

      The crash happens because in QSpringAnimation::updateCurrentTime at util/qquickspringanimation.cpp:311, animationTemplate is NULL but still dereferenced.

      Attachments

        1. stacktrace.txt
          9 kB
        2. crash.qml
          0.3 kB
        For Gerrit Dashboard: QTBUG-34539
        # Subject Branch Project Status CR V

        Activity

          People

            laknoll Lars Knoll
            rauhala Mika Rauhala
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes