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. StackView & Transitions
Forum Updated to NodeBB v4.3 + New Features

StackView & Transitions

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • K Offline
    K Offline
    kandrey
    wrote on 29 Sept 2014, 11:01 last edited by
    #1

    @
    import QtQuick 2.2
    import QtQuick.Window 2.1
    import QtQuick.Controls 1.1

    Window {
    id: window

    visible: true
    width: 360
    height: 260
    
    
    ListView {
        id: view
        model: 1000
        populate: Transition {
            SpringAnimation { spring: 3; damping: 0.2 }
        }
        delegate: Text {
            text: modelData
        }
    }
    
    StackView {
        id: stackView
        anchors.fill: parent
        initialItem: view
    }
    

    }
    @

    without Transition ListView is filled properly, and with it - the first of items huddling together

    [edit: Added missing coding tags @ SGaist]

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p3c0
      Moderators
      wrote on 30 Sept 2014, 06:56 last edited by
      #2

      Hi,

      Use Item instead of Window as root object. And provide a width and height to ListView or use anchors.fill: parent.
      To load Item based component you will need QQuickView.

      157

      1 Reply Last reply
      0

      1/2

      29 Sept 2014, 11:01

      • Login

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