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

Segfault when assigning to view.currentIndex in a delegate

    XMLWordPrintable

Details

    • d3a0bd5

    Description

      The following code causes qmlviewer to segfault:

      import Qt 4.6

      Rectangle {
      Component {
      id: appDelegate

      Item {
      id : wrapper
      Script {
      function startupFunction()
      {
      if (index < 5)

      { wrapper.opacity = 0 }

      if (index == 5)

      { view.currentIndex = index; }

      }
      }
      Component.onCompleted: startupFunction();
      width: 30; height: 30
      Text

      { text: index - 5 + 1 }

      Keys.onPressed:

      { console.log("In"); }

      }
      }

      Component {
      id: appHighlight

      Rectangle

      { width: 30; height: 30; color: "lightsteelblue" }

      }

      GridView

      { id: view anchors.fill: parent cellWidth: 30; cellHeight: 30 model: 35 delegate: appDelegate highlight: appHighlight focus: true }

      }

      The expected behaviour is that the item at index 5 should be the current index on start.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes