QML listview: Credible as a delegate cannot be scrolled

To make Android ViewPager-like for Qt, I use listview as follows:

ListView {
        id: myListViewArticle
        anchors.fill: parent

        focus: true
        highlightRangeMode: ListView.StrictlyEnforceRange
        orientation: ListView.Horizontal
        snapMode: ListView.SnapOneItem
        model: modelArticles
        delegate: articleDelegate
    }

And Flickable as its delegate:

Component {
        id: articleDelegate
        Item {
            id: item
            width: 480; height: 800

            Flickable {
                id: mainScrollView
                contentHeight: 1500
                contentWidth: parent.width
                anchors.fill: parent
                clip: true

                Text {
                    id: idArticleContent
                    text: articleContent
                    width: parent.width
                    font.pixelSize: 20
                    font.bold: true; color: "black"
                    wrapMode: Text.Wrap
                }
            }

            ScrollDecorator {
                flickableItem: mainScrollView
            }
        }
    }

But after filling in the data for listview, I see that Flickable cannot be scrolled (vertically).

Can someone tell me how to make a scrollable item scrollable inside a list. Many thanks for your help.

+5
source share
1 answer

I know this question is a bit outdated, and the solution can simply be updated to the newer QtQuick 2.5. But I tried to get to what you described - you can take a look at the code on GitHub . You can also see how it works here .

0
source

All Articles