Scroll two or more ListViews Using Single ScrollBar
Solved
QML and Qt Quick
-
Hello, I need to scroll two or more list view at once using a single scrollBar. Initially, i used
Column
inside aFlickable
but scroll was not happening as expected. Later, I usedListView
and even that was not scrolling correctly.So,how to scroll a listview/layout content item with a scroll bar? Should I use
ScrollView
orFlickable
or something else? -
With Qt Quick Controls 2:
import QtQuick 2.9 import QtQuick.Controls 2.2 ApplicationWindow { id: window width: 640 height: 480 visible: true Row { anchors.fill: parent anchors.margins: vbar.width ListView { width: parent.width / 2 height: parent.height model: 100 delegate: ItemDelegate { width: parent.width text: "A" + modelData } ScrollBar.vertical: vbar } ListView { width: parent.width / 2 height: parent.height model: 100 delegate: ItemDelegate { width: parent.width text: "B" + modelData } ScrollBar.vertical: vbar } } ScrollBar { id: vbar height: parent.height anchors.right: parent.right policy: ScrollBar.AlwaysOn } }
-
This post is deleted!