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. What properties does LiveView set to prevent sliding out of the boundary?
QtWS25 Last Chance

What properties does LiveView set to prevent sliding out of the boundary?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 349 Views
  • 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.
  • M Offline
    M Offline
    mirro
    wrote on last edited by mirro
    #1

    Test QT5.12.3. version

    Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work

    aUjkAs.jpg

    import QtQuick.Window 2.2
    import QtQuick.Controls 2.2
    
    Window {
        visible: true
        width: 300
        height: 450
        title: qsTr("Hello World")
    
        ListView{
            id:listView
            anchors.fill: parent
            model: 10
            snapMode: ListView.SnapOneItem
            orientation:ListView.Horizontal
            clip:true
            boundsBehavior:ListView.DragAndOvershootBounds 
            delegate: Rectangle{
                  width: listView.width
                  height: listView.height
                  color: index%2 ? "red":"yellow"
                  Label{
                      anchors.centerIn: parent
                      font.pointSize: 100
                      text: index
                  }
            }
        }
    }
    
    GrecKoG 1 Reply Last reply
    0
    • M mirro

      Test QT5.12.3. version

      Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work

      aUjkAs.jpg

      import QtQuick.Window 2.2
      import QtQuick.Controls 2.2
      
      Window {
          visible: true
          width: 300
          height: 450
          title: qsTr("Hello World")
      
          ListView{
              id:listView
              anchors.fill: parent
              model: 10
              snapMode: ListView.SnapOneItem
              orientation:ListView.Horizontal
              clip:true
              boundsBehavior:ListView.DragAndOvershootBounds 
              delegate: Rectangle{
                    width: listView.width
                    height: listView.height
                    color: index%2 ? "red":"yellow"
                    Label{
                        anchors.centerIn: parent
                        font.pointSize: 100
                        text: index
                    }
              }
          }
      }
      
      GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work

      Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.

      It does what the documentation says.
      I guess you need:

      Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot.

      M 1 Reply Last reply
      1
      • GrecKoG GrecKo

        Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work

        Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.

        It does what the documentation says.
        I guess you need:

        Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot.

        M Offline
        M Offline
        mirro
        wrote on last edited by mirro
        #3

        @GrecKo
        Not found DragAndOvershootBounds in the following address.
        How do I prevent LiveView from sliding out of the boundary?
        https://doc.qt.io/archives/qt-4.8/qml-listview.html

        jsulmJ 1 Reply Last reply
        0
        • M mirro

          @GrecKo
          Not found DragAndOvershootBounds in the following address.
          How do I prevent LiveView from sliding out of the boundary?
          https://doc.qt.io/archives/qt-4.8/qml-listview.html

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @mirro said in What properties does LiveView set to prevent sliding out of the boundary?:

          https://doc.qt.io/archives/qt-4.8/qml-listview.html

          Do you use Qt4?!
          Above you wrote "Test QT5.12.3. version" - so why do you read Qt4 documentation?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • jsulmJ jsulm

            @mirro said in What properties does LiveView set to prevent sliding out of the boundary?:

            https://doc.qt.io/archives/qt-4.8/qml-listview.html

            Do you use Qt4?!
            Above you wrote "Test QT5.12.3. version" - so why do you read Qt4 documentation?

            M Offline
            M Offline
            mirro
            wrote on last edited by
            #5

            @jsulm
            Not found DragAndOvershootBounds in the following address.
            https://doc.qt.io/archives/qt-5.13/qml-qtquick-listview.html

            How do I prevent LiveView from sliding out of the boundary?

            jsulmJ 1 Reply Last reply
            0
            • M mirro

              @jsulm
              Not found DragAndOvershootBounds in the following address.
              https://doc.qt.io/archives/qt-5.13/qml-qtquick-listview.html

              How do I prevent LiveView from sliding out of the boundary?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @mirro Didn't @GrecKo actually suggested to use Flickable.StopAtBounds?
              ListView is a Flickable...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

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