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. No scrolling in scrollview
QtWS25 Last Chance

No scrolling in scrollview

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 282 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.
  • M Offline
    M Offline
    msauer75
    wrote on last edited by
    #1

    Hi,

    in my QML Window I use a ScrollView to display some boxes. If the window is smaller than the content of the ScrollView I can't scrolling.

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    import GC 1.0
    import assets 1.0
    import components 1.0
    
    Item {
        property Cache selectedCache
    
        Rectangle {
            id: windowBox
            anchors.fill: parent
    
            Image {
                width: parent.width
                height: parent.height
                source: Style.imageBackground
            }
    
            ScrollView {
                id: scrollView
                anchors {
                    left: parent.left
                    right: parent.right
                    top: parent.top //headerBox.bottom
                    bottom: parent.bottom //commandBar.top
                    margins: Style.sizeScreenMargin
                }
                clip: true
    
                CacheBox {
                    id: cacheBox
                    cache: selectedCache
                    headerText: "Cache"
                    anchors.top: parent.top
                    anchors.topMargin: 15
                    anchors.left: parent.left
                    anchors.right: parent.right
                }
    
                TextBox_TinyMCE {
                    id: noteBox
                    textBoxContent: selectedCache.ui_note
                    headerText: "Notes"
                    anchors.top: cacheBox.bottom
                    anchors.topMargin: 15
                    anchors.left: parent.left
                    anchors.right: parent.right
                }
    
                AttributeBox {
                    id: attributeBox
                    cache: selectedCache
                    headerText: "Attribute"
                    anchors.top: noteBox.bottom
                    anchors.topMargin: 15
                    anchors.left: parent.left
                    anchors.right: parent.right
                }
            }
        }
    }
    
    

    I can't find any solution in google, so can you help me with my problem?
    Thank you for your help.
    BR
    martin

    1 Reply Last reply
    0
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on last edited by IntruderExcluder
      #2

      When multiple items added into ScrollView content size should be set manually. I'll recommend simply to put Column inside ScrollView with spacing set to 15 and put all elements into column without any anchors.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        msauer75
        wrote on last edited by
        #3

        It works. Thank you

        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