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. Scollbar not interactive with Listview
Forum Updated to NodeBB v4.3 + New Features

Scollbar not interactive with Listview

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 144 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
    MattC24
    wrote on last edited by
    #1

    Hello,
    I have a listview full of settings and I am trying to have the scrollbar be interactive meaning you can touch and scroll with it. Right now, the scroll bar is visible and moves properly when swiping down and up the listview. Any ideas why it isn't letting me press and scroll with the scrollbar?

    import QtQuick 2.7
    import QtQuick.Controls 2.3
    import "../variables.js" as Variables
    
    
    Item {
        id: root
    
        property string name
        property var settingBrowserModel
        property int parent_popupheight: parent
        property int parent_popupwidth: parent
     
    
        //property bool saveEnabled: isettingpresenter.settingSaved
    
    
        FontLoader{id: opensansregular; source: "qrc:/fonts/OpenSans-Regular.ttf";}
        FontLoader{id: opensanssemibold; source: "qrc:/fonts/OpenSans-SemiBold.ttf";}
    
    
    
        Rectangle
        {
           
            id: title
            height: parent.height/6
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.right: parent.right
            color: backgroundcolor
    
            Text
            {
                id: titletext1
                anchors.left: parent.left
                width: parent.width
                height: parent.height
                fontSizeMode: Text.Fit;
                text: name
                font.pixelSize: 20
                color: textcolor
                verticalAlignment: Text.AlignVCenter
                //horizontalAlignment: Text.AlignHCenter
                anchors.leftMargin: parent.width/64
                font.family: opensanssemibold.name
                textFormat : Text.AutoText
            }
        }
    
    
    
    
    
        ListView {
            id: settinglistView
            width: parent.width
            z:-1
            anchors.top: title.bottom
            anchors.bottom: parent.bottom
            anchors.horizontalCenter: parent.horizontalCenter
            boundsBehavior: Flickable.StopAtBounds
            ScrollBar.vertical: ScrollBar {
                policy: ScrollBar.AlwaysOn
                active: true
                interactive: true
    
            }
    
            cacheBuffer: 150
            model: settingBrowserModel
    
    
            delegate: Component {
                Rectangle{
                    id: settingDelegate
                    //z: -index
                    width: settinglistView.width
                    height: settinglistView.height/3
                    color: backgroundcolor
    
    
                    Text {
                        id: settingname
                        anchors.left: parent.left
                        anchors.leftMargin: parent.width/32
                        text: model.label
                        wrapMode: Text.WordWrap
                        color: textcolor
                        minimumPixelSize: 12
                        font.pixelSize: 20
                        font.family: opensansregular.name
                        height: parent.height
                        width: settingLabelWidth
                        verticalAlignment: TextInput.AlignVCenter
                        textFormat : Text.AutoText
                        fontSizeMode: Text.Fit
                    }
                    Rectangle{
                        id:horzSeperator
                        height: 2
                        anchors.left: parent.left
                        anchors.right: parent.right
                        anchors.bottom: parent.bottom
                        visible: seperator
                        color: Variables.ultraLightGrey2
                    }
                    Loader {
                        id: mainLoader
                        width: parent.width * .6
                        height:  parent.height
                        anchors.right: parent.right
                        anchors.verticalCenter: parent.verticalCenter
                        anchors.rightMargin: parent.width / 16
                        source: switch(model.type) {
                                case "combo": return "ComboPopUp.qml"
                                case "int": return "CustomSpinBox.qml"
                                case "switch": return "ToggleSwitch.qml"
                                case "save": return "SaveButton.qml"
                                }
                        asynchronous: true
                    }
                }
    
            }
    
    
    
        }
    
    
    
    
    
    
    
    }
    
    
    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