0

В QML был создан объект типа ListView, проблема заключается в том, что при пролистывании списка он "залазит" на верхний тулбар. Как исправить?

Вот код:

ListView {
    id: bookmarks

    x: 5
    y: 5

    width: parent.width - 10
    height: parent.height - 50
    spacing: 2

    model: ListModel {
        id: bookmarkList
    }

    delegate: BookmarkServer {
                thisName: inName
                thisHost: inHost
                thisPort: inPort
                thisUser: inUser
                thisPass: inPass
                thisEmb:  inEmb
            }

}

ToolBar {
    id: tbDown
    anchors {
             left: parent.left
             right: parent.right
             bottom: parent.bottom
         }

    height: 40


    Image {
        anchors.fill: parent

        id: tbImg
        source: "Res/iPad/KeyboardToolbar.png"
    }

    Row{
        width:  parent.width
        height: parent.height

        ToolButton {
            id: addBookmark
            height: parent.height
            width:  parent.width / 3

            Image {
                anchors.centerIn: parent
                id: add
                source: "Res/images/ui_elements/icon_add.png"
            }

            onClicked: {

                stackView.push("AddingBookmark.qml")

                console.log("AddingBookmark")
            }
        }

        /***************************************************************************************************/
        ToolButton {
            id: monitoring
            height: parent.height
            width:  parent.width / 3

            Image {
                anchors.centerIn: parent
                id: monitor
                source: "Res/images/ui_elements/monitor.png"
            }

            onClicked: {
                stackView.push("Monitoring.qml")



                console.log("MONITORING")
            }
        }

        /***************************************************************************************************/
        ToolButton {
            id: info
            height: parent.height
            width: parent.width / 3

            Image {
                anchors.centerIn: parent
                id: information
                source: "Res/images/ui_elements/icon_information.png"
            }

            onClicked: {
                stackView.push("Help.qml")
                console.log("INFO")
            }
        }
    }
}

Верхний тулбар объявлен в другом файле, он в StackView под данным.

Вот видео проблемы: https://youtu.be/Qb4ITabivFI

1 ответ 1

0
ListView {
    id: bookmarks

    x: 5
    y: 5

    clip: true

    width: parent.width - 10
    height: parent.height - 50
    spacing: 2

    model: ListModel {
        id: bookmarkList
    }


    ...
}

Необходимо добавить clip: true

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.