Unsolved How to build a simple Flickable like Component in pure QML?
-
How to build a simple Flickable like Component in pure QML?
im writing an graphical programming language editor, with autolayouting, highlighting feature etc.
that can't be solved proberly with the bouncing and snap behavior of the flickable, i already do every
calculation for focusing, etc. by myself and all the bounce/snap behavior is disabled, but i still found time to time
some auto-behavior (like moving the contentX/y when contentWidth/Height gets small then the view etc.)
that i don't wantall i want is a content space with a viewport (contextX,contentY and contentWidth, contentHeight)
but i have no idea how to clip the invisble content?is the clip properties usable for me?
https://doc.qt.io/qt-5/qml-qtquick-item.html#clip-prop -
You can disable bounce and snap in a Flickable. See https://doc.qt.io/qt-5/qml-qtquick-flickable.html#boundsBehavior-prop and https://doc.qt.io/qt-5/qml-qtquick-flickable.html#boundsMovement-prop
Alternatively, there is ScrollView.
-
Just put an
Item
in anotherItem
, if you don't want the features fromFlickable
:Item { id: root property alias contentItem: contentItem property alias contentX: contentItem.x property alias contentY: contentItem.y property alias contentWidth: contentItem.width property alias contentHeight: contentItem.height default property alias content: contentItem.data Item { id: contentItem } }