Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ListView and property spacing
Forum Updated to NodeBB v4.3 + New Features

ListView and property spacing

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VlastV
    wrote on last edited by
    #1

    If you move an item to the value of more than half of the "spacing", but less than the "spacing", the element will freeze.

    @import QtQuick 1.1

    Rectangle {
    width: 700
    height: 560
    ListModel {
    id: pictureListModel
    ListElement {
    color: "red"
    }
    ListElement {
    color: "blue"
    }
    ListElement {
    color: "green"
    }
    }

    ListView {
        id: pictureListView
        focus: true
        anchors.fill: parent
        orientation: ListView.Horizontal
        model: pictureListModel
        snapMode: ListView.SnapOneItem
        spacing: 50
        highlightRangeMode: ListView.StrictlyEnforceRange
        highlight: Rectangle {
            color: "yellow"
            opacity: 0.5
        }
    
        delegate: Rectangle {
            width: ListView.view.width
            height: ListView.view.height
            color: model.color
            opacity: 0.5
        }
        onContentXChanged: console.log("onContentXChanged: " + contentX)
    }
    

    }
    @

    Bug or am I doing something wrong?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      This seems to work for me with a custom-built 4.7 HEAD -- I think this was a bug that has since been fixed (but I don't know that the fix has been released yet). I'd suspect the following commits are likely responsible for the fix:

      http://qt.gitorious.org/qt/qt/commit/f85819fe083ae7c6804c884de68e906d153a6d11
      http://qt.gitorious.org/qt/qt/commit/09cd2f818208a83489fae034b80e6497b7cc83af

      Regards,
      Michael

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved