Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Re-parent to Flickable area failed

    QML and Qt Quick
    2
    3
    1175
    Loading More Posts
    • 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
      Psychomax last edited by

      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 Reply Quote 0
      • B
        beemaster last edited by

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

        1 Reply Last reply Reply Quote 0
        • P
          Psychomax last edited by

          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 Reply Quote 0
          • First post
            Last post