Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved] Flickable problem. Children item visible outside flickable area.



  • Simple example:
    @
    import QtQuick 1.1

    Rectangle {
    id: page
    width: 300
    height: 400

    Rectangle {
        anchors.fill: parent
        anchors.margins: 100
        color: "green"
    
        Flickable {
            id: flickable
            anchors.fill: parent
            contentHeight: content.height
            contentWidth: content.width
    
            Rectangle {
                id: content
                width: flickable.width + 50
                height: flickable.height + 50
                color: "blue"
                opacity: 0.5
            }
        }
    }
    

    }
    @
    How i can hide content item outside flickable area?

    Visual illustration:

    !http://s2.postimage.org/kbnthpaeh/Flickable.png(Flickable example)!



  • Hi,

    You should be able to solve this by setting clip: true on the Flickable (clipping is off by default).

    Regards,
    Michael



  • Michael, thank you.
    Problem solved!


Log in to reply