Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to build a simple Flickable like Component in pure QML?
Forum Updated to NodeBB v4.3 + New Features

How to build a simple Flickable like Component in pure QML?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 327 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LowLevelM
    wrote on last edited by LowLevelM
    #1

    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 want

    all 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

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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.

      (Z(:^

      1 Reply Last reply
      1
      • GrecKoG Offline
        GrecKoG Offline
        GrecKo
        Qt Champions 2018
        wrote on last edited by
        #3

        Just put an Item in another Item, if you don't want the features from Flickable:

        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
            }
        }
        
        
        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved