"default property alias content" under QML Designer



  • Hello everybody,

    I saw a strange behavior under QML Designer when using "default property alias content"
    I tried to locate an existing issue about this point, but without success, and i'd like to have your feedback if i'm doing right.
    I'm using the "default property alias content" in a QML (see the following example that reproduces the problem):
    Note: It's working correctly under QMLViewer => no error

    Panel.qml:
    @import QtQuick 1.0

    Rectangle {
    id: aPanel

    width:  100
    height: 100
    radius: 5
    color: "darkGray"
    
    default property alias content: aPanelCenter.children
    
    Rectangle {
        id: aPanelCenter
    
        clip: true
        color: "darkBlue"
    
        anchors.fill: parent
        anchors.topMargin: 6
        anchors.bottomMargin: 6
        anchors.leftMargin: 6
        anchors.rightMargin: 6
    }
    

    }@

    MainComponent.qml:
    @import QtQuick 1.0
    import "UI"

    Rectangle {
    width: 300
    height: 300
    color: "black"

    Panel {
        id:mainPanel
        x:50
        y:50
        Rectangle{
            id:aRectangle
            x:36
            y:63
            width: 300
            height: 50
            color: "Green"
        }
    }
    

    }@

    The point is that I don't have the same rendering under QML designer and QML Viewer: The "default property alias content" seems to be ignored under QML Designer.
    The object "aRectangle" should be created as a child of "aPanelCenter", and clipped by it, am i wrong ?
    But it's only the case under QML Viewer, and the state preview on top of QML Designer. But NOT in the central view of QML Designer !

    Do I do something wrong with this "default property alias content", is it a known limitation, or a bug of QML Designer ?

    Hope someone could help...
    ;)



  • This is a bug/missing feature in the Qt Quick Designer.

    We handle these cases (The margins of aPanelCenter should be reflected.), but we do not handle the different clipping setting.

    Since the clipping is done by the form editor itself and the state previews are rendered differently the bug only appears in the form editor.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.