PathView + Flickable Issues on the device but works fine on desktop
-
Trying to have a book like implementation using pathview and flickable.
The data is being sourced from sqllite database.
So if there is more data then the flickable is used to go to the bottom. But for the next pages pathview.This is working fine on my laptop when i run in a desktop mode. But when the same code is deployed on to the phone it is very jerky. It takes anywhere between 15-30 swipes to more to the next page.
Please help.
Flickable works fine even with PathView
Pathview works fine if i remove flickable from the text.
But together it doesn'tAndroid OS Version 14.0
SDK(34)
Architecture arm64-v8aimport QtQuick 2.0 import QtQuick.Window 2.2 import QtQuick.Controls import QtQuick.Layouts Window { width: 1000; height: 1000; visible:true Rectangle { id: readingQml width: parent.width; height: parent.height; property int currIndex:0; property int colorNum:1; property string displayString property int totalPages property string pagenumberText property int txtfontSize:14 FontLoader { id: localGurFont; source: "qrc:/gurbaniwebthick.ttf"; } FontLoader { id: localHinFont; source: "qrc:/Gurhindi.ttf"} ListModel { id: model ListElement { baaniStr: "" } ListElement { baaniStr: ""} ListElement { baaniStr: ""} } Component { id: delegate Rectangle { id: wrapper width: readingQml.width height:readingQml.height color:"white" Flickable { id: flickable anchors.fill: parent clip: true flickableDirection: Flickable.VerticalFlick Text { text: "The Qt QML module provides a framework for developing applications and libraries with the QML language. It defines and implements the language and engine infrastructure, and provides an API to enable application developers to extend the QML language with custom types and integrate QML code with JavaScript and C++. The Qt QML module provides both a QML API and a C++ API. Note that while the Qt QML module provides the language and infrastructure for QML applications, the Qt Quick module provides many visual components, model-view support, an animation framework, and much more for building user interfaces. For those new to QML and Qt Quick, please see QML Applications for an introduction to writing QML applications." wrapMode: TextArea.Wrap font.pixelSize: 20 } } } } } PathView { id: view anchors.fill: parent snapMode: PathView.SnapOneItem highlightRangeMode: PathView.StrictlyEnforceRange currentIndex: 0 property int lastIndex: 0 model: model delegate: delegate onCurrentIndexChanged: { var dif = currentIndex - lastIndex; if(dif == 1 || dif == -2) { model.get(currentIndex).baaniStr = db1.getNext(); } else { model.get(currentIndex).baaniStr = db1.getPrev(); } lastIndex = currentIndex ; } path: Path { startX: -view.width / 2 // let the first item in left startY: view.height / 2 // item's vertical center is the same as line's PathLine { relativeX: view.width * view.model.count // all items in lines relativeY: 0 } } } }
Thanks for looking into this.
-
Rather than using Rectangle as a "page", use Page QML https://doc.qt.io/qt-6/qml-qtquick-controls-page.html and build/write your code within that page.
What's the idea behind using PathView?, just use Page.
I couldn't do much with your code, I did try, but there were too many errors and other data missing. A working code snippet often helps.