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. [Solved] Flickable problem. Children item visible outside flickable area.
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 5.2k 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.
  • podsvirovP Offline
    podsvirovP Offline
    podsvirov
    wrote on last edited by
    #1

    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)!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

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

      Regards,
      Michael

      1 Reply Last reply
      0
      • podsvirovP Offline
        podsvirovP Offline
        podsvirov
        wrote on last edited by
        #3

        Michael, thank you.
        Problem solved!

        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