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. Flickable above and below others QML types
Forum Updated to NodeBB v4.3 + New Features

Flickable above and below others QML types

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmltypeflickableboundsbehaviorflickable scrol
3 Posts 2 Posters 1.9k Views 2 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.
  • D Offline
    D Offline
    deleted357
    wrote on 28 Jun 2017, 15:57 last edited by deleted357
    #1

    Hi,

    As you can see on the pictures below, the Flickable type pass above the title and below the buttons at the bottom. I don't understand why! Any idea?

    0_1498665098775_menu1.png

    0_1498665105020_menu2.png

    0_1498665108016_menu3.png

    The code:

    import QtQuick 2.9
    import QtQuick.Controls 2.2
    import QtQuick.Layouts 1.3
    
    Page {
    
        Loader {
            id: titre
            anchors {
                top: parent.top
                topMargin: 10
                left: parent.left
                leftMargin: 10
                right: parent.right
                rightMargin: 10
            }
            source: "TitreLabel.qml"
        }
    
        Flickable {
            interactive: true
            anchors {
                top: titre.bottom
                topMargin: 10
                bottom: fButtons.top
                bottomMargin: 10
                left: parent.left
                leftMargin: 10
                right: parent.right
                rightMargin: 10
            }
            boundsBehavior: Flickable.StopAtBounds
            flickableDirection: Flickable.AutoFlickDirection
            contentHeight: column.implicitHeight
    
            ColumnLayout {
                id: column
                anchors.fill: parent
                spacing: 5
                Layout.alignment: Qt.AlignHCenter
    
                Repeater {
                    id: myList
                    model: displayMenu.choixListe
    
                    Button {
                        id: button
                        anchors {
                            left: parent.left
                            leftMargin: 12
                            right: parent.right
                            rightMargin: 12
                        }
    
                        contentItem: Text {
                            text: modelData
                            font.pixelSize: 20
                            horizontalAlignment: Text.AlignHCenter
                            verticalAlignment: Text.AlignVCenter
                            elide: Text.ElideRight
                        }
    
                        background: Rectangle {
                            color: button.pressed ? "#BBBBBB" : "#D0D0D0"
                            border.color: if (index == displayMenu.indexParDefaut) { "#0A5BC4" } else { "#808080" }
                            border.width: if (index == displayMenu.indexParDefaut) { 3 } else { 1 }
                            radius: 2
                        }
    
                        onClicked: window.setButtonClicked(index + 1000, "")
                    }
                }
            }
    
            ScrollBar.vertical: ScrollBar { }
        }
    
        RowLayout {
            id: fButtons
            anchors {
                bottom: parent.bottom
                bottomMargin: 10
                horizontalCenter: parent.horizontalCenter
            }
            spacing: 10
    
            // Bouton "F1"
            Button {
                id: buttonF1
                ...
            }
        }
    }
    

    Thanks.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Trikrista
      wrote on 28 Jun 2017, 22:00 last edited by
      #2

      maybe You need to add clip: true in Flickable

      I'm sorry for my bad English

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deleted357
        wrote on 29 Jun 2017, 08:09 last edited by
        #3

        Yes, it's working now.

        Flickable {
                ...
                clip: true
                boundsBehavior: Flickable.StopAtBounds
                ...
        }
        

        Thanks.

        1 Reply Last reply
        0

        1/3

        28 Jun 2017, 15:57

        • Login

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