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. Re-parent to Flickable area failed

Re-parent to Flickable area failed

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

    Hello! I try to reparent a Rectangle / Item what ever to a flickable list. This works but is not flickable. What I'm doing wrong?

    • Max
      @
      //... code above
      Rectangle {
      id: content
      color: "green"
      anchors.top: controlBar.bottom
      anchors.topMargin: 5
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.bottom: begaLogo.top
      anchors.bottomMargin: 5

        Flickable {
            id: flickArea
            anchors.horizontalCenter: parent.horizontalCenter
            width: 300
            height: 300
            contentWidth: dings.width
            contentHeight: dings.height
            clip: true
        }
        Rectangle {
            id: dings
            color:"white"
            width: 500
            height: 500
            anchors.centerIn: parent
            states: State {
                         name: "reparented"
                         ParentChange { target: dings; parent: flickArea; x: 10; y: 10 }
                     }
            MouseArea { anchors.fill: parent; onClicked: dings.state = "reparented" }
            //parent: flickArea
        }
      

      }@

    1 Reply Last reply
    0
    • B Offline
      B Offline
      beemaster
      wrote on last edited by
      #2

      Try to remove
      @
      anchors.centerIn: parent
      @
      from dings

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Psychomax
        wrote on last edited by
        #3

        Sadly it doesn't work. :( Only if i parent it directly. So anchors.centerIn has no effect on that. :(

        @Rectangle {
        id: content
        color: "green"
        anchors.top: controlBar.bottom
        anchors.topMargin: 5
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.bottom: begaLogo.top
        anchors.bottomMargin: 5

                Flickable {
                    id: flickArea
                    anchors.horizontalCenter: parent.horizontalCenter
                    width: 300
                    height: 300
                    contentWidth: dings.width
                    contentHeight: dings.height
                    clip: true
                    Rectangle {
                        id: dings
                        color:"white"
                        width: 500
                        height: 500
                        anchors.centerIn: parent
                        states: State {
                                     name: "reparented"
                                     ParentChange { target: dings; parent: flickArea; x: 10; y: 10 }
                                 }
                        MouseArea { anchors.fill: parent; onClicked: dings.state = "reparented" }
                        //parent: flickArea
                    }
                }
        

        @

        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