Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

Qt Quick Controls 1 ScrollView Scrolling Issue



  • Hello all,

    I'm facing an issue in scrolling with Qt Quick Control 1 scrollview. I've 2 touchscreen devices provided by different vendors. Both are running Qt 5.9 on Ubuntu 16.04 64 bit. In one machine I'm able to access the scrollbars (all to scroll up and down), but not able to scroll them in another machine. The following is the sample code I developed to replicate. I would like to understand is there anything specific with the touch driver for the scrolling to work.

    @

    import QtQuick 2.9
    import QtQuick.Controls 1.4
    import QtQuick.Controls.Styles 1.4

    ApplicationWindow {
    id:root
    visible: true
    width: 640
    height: 480
    title: qsTr("Scroll")

    property color scrollBarNormal: "green"
    property color scrollBarPressed: "red"
    
    ScrollView {
        id:view
        anchors.fill: parent
        contentItem: lv
    
        onContentItemChanged:
        {
            console.log("##")
            //contentItem.enabled=false
        }
    
        style: FusionScrollViewStyle {
    
        }
    }
    
    ListView {
        id:lv
        anchors.fill: parent
        model: 200
        delegate: Delegate {
            width: parent.width
        }
    }
    

    }

    import QtQuick 2.9
    import QtQuick.Controls.Styles 1.4

    ScrollViewStyle {
    property real uiScale: 1
    property int scrollBarWidth: 10 * uiScale
    property color scrollBarNormal: "green"
    property color scrollBarPressed: "#ec971f"
    property real contentMargin: 0

    handleOverlap: 0
    
    handle: Item {
        implicitWidth: scrollBarWidth + contentMargin
    
    
        Rectangle {
            anchors.fill: parent
            anchors.leftMargin: contentMargin
            anchors.topMargin: 1
            anchors.bottomMargin: 1
            color: styleData.pressed ? scrollBarPressed : scrollBarNormal
        }
    }
    
    decrementControl: Item {
        implicitWidth: scrollBarWidth + contentMargin
        implicitHeight: scrollBarWidth
    
        Item {
            anchors.fill: parent
            anchors.leftMargin: contentMargin
    
            Rectangle {
                color: styleData.pressed ? scrollBarPressed : scrollBarNormal
                width: parent.width
                height: parent.width / 2
                y: parent.height / 2
            }
    
            Rectangle {
                anchors.fill: parent
                radius: width / 4
                color: styleData.pressed ? scrollBarPressed : scrollBarNormal
            }
    
            Text {
                anchors.centerIn: parent
                text: "\uf106"
                //font.family: fontId.name
                color: "white"
                font.pixelSize: parent.width / 2
            }
        }
    }
    
    incrementControl: Item {
        implicitWidth: scrollBarWidth + contentMargin
        implicitHeight: scrollBarWidth
    
        Item {
            anchors.fill: parent
            anchors.leftMargin: contentMargin
    
            Rectangle {
                color: styleData.pressed ? scrollBarPressed : scrollBarNormal
                width: parent.width
                height: parent.width / 2
            }
    
            Rectangle {
                anchors.fill: parent
                radius: width / 4
                color: styleData.pressed ? scrollBarPressed : scrollBarNormal
            }
    
            Text {
                anchors.centerIn: parent
                text: "\uf107"
                //font.family: fontId.name
                color: "white"
                font.pixelSize: parent.width / 2
            }
        }
    }
    
    scrollBarBackground: Item {
        implicitWidth: scrollBarWidth + contentMargin
    
        Rectangle {
            anchors.fill: parent
            anchors.leftMargin: contentMargin
            color: "#d3d3d3"
        }
    }
    

    }

    Any help is greatly appreciated.

    Thanks & Regards,

    Nara