Important: Please read the Qt Code of Conduct -

Flickable with dynamic content

  • Hi!

    I'm trying to make a small board game to practice my QML skills :). I want to use a Flickable element to display the game area. However the game area expands during play, both in negative axis and positive axis.

    The problem is that I can't the Flickable to show all the game area. The Flickable element behaves correctly when the game area grows in the positive directions, but I can't flick to the negative directions.

    My code looks like this:

    @ Flickable {
    id: flickable
    anchors.left: selectionBar.right
    anchors.right: mainWindow.right
    height: parent.height
    z: 0

        contentHeight: background.height
        contentWidth: background.width
        boundsBehavior: Flickable.StopAtBounds
        Rectangle {
            id: background
            width: 200
            height: 200@

    Does anyone know how to achieve this? Thanks in advance!

Log in to reply