Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Lock children inside parent

$
0
0
Hi. I’m trying to make a drop down animation. I face the problem that the child rectangle is showed on top, and hence outside the parent rectangle. Is it not possible to have the children “inside” the parent?? In the below code, the redRect is always visible. The animation works fine (except the fact that the red square is always shown). import QtQuick 2.0   Rectangle {     width: 100     height: 10       Behavior on height { NumberAnimation { easing.type: Easing.OutQuad; duration: 400 } }       function hide()     {         height = 0;     }       function show()     {         height = childrenRect.height       }       Rectangle {         id: redSquare         width: 50; height: 50         color: "red"     } }

Viewing all articles
Browse latest Browse all 4972

Trending Articles