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 inside a Flickable causes Flickable to stop working
Forum Updated to NodeBB v4.3 + New Features

StackView inside a Flickable causes Flickable to stop working

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 429 Views
  • 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.
  • P Offline
    P Offline
    pizzalover
    wrote on last edited by
    #1

    My end goal is to replicate the android toolbar function. When the user scrolls down the page it will hide the header first then continue scrolling into the page. When the user scrolls up it will show the header first then continue scrolling to the top of the page. This functionality is already built into ListView as headerPosition.PullBackHeader but I cannot use this because the ApplicationWindow header needs to be hidden not ListView header.

    Now, my current implementation is enable scrolling of any objects pushed into the stackview if they have a height that goes outside applicationwindow. However, flickable scrolling is not working and I am not sure why

    import QtQuick 2.9
    import QtQuick.Controls 2.2
    
    ApplicationWindow {
    visible: true
    Flickable {
    	id:child
    	anchors.fill: parent
    	contentWidth: parent.width
    
    	StackView {
    		id:stack
    		anchors.fill: parent
    		Component.onCompleted: {
    			console.log("s",width, height);
    			stack.push(stuff);
    		}
    
    		onCurrentItemChanged: {
    			child.contentHeight = currentItem.height;
    		}
    	}
    }
    
    Component {
    	id:stuff
    	Rectangle {
    		id:what
    		width: 600
    		height: 1000
    		gradient: Gradient {
    			GradientStop { position: 0.0; color: "lightsteelblue" }
    			GradientStop { position: 1.0; color: "blue" }
    		}
    	}
    }
    }
    
    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