How to set Width/Height using visible



  • Hi,

    I want to set width/height depending upon the page to be visible. So, how can I set it to visible so that they can only be visible on particular page screen. Can you help me on this.

    Thanks.



  • Hi @RG90

    width : id.visible ? 100 : 0;

    Could you give a detailed description about the issue ? A code snippet maybe helpful.



  • @liubbc

    Here is the code snippet

    Component
    {
    id: component_footer

    HeaderFooter
    {
        property alias text: footer_button.text
        width: itemWidth
        height: itemHeight
        visible: view.currentItem === 0 ? true:false
    
        ButtonText
        {
            id: footer_button
            type: "regular"
            disabled: view.count == 0
            onButtonAction: view.buttonAction(-2, action)
    
            anchors
            {
                fill: parent
            }
        }
    }
    

    }

    I want to make width/height to be dependent in visible.



  • @liubbc

    Hey, it worked for me. Thanks for your help. I am marking it as resolved.


Log in to reply
 

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