Important: Please read the Qt Code of Conduct -

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.


  • 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

    id: component_footer

        property alias text: footer_button.text
        width: itemWidth
        height: itemHeight
        visible: view.currentItem === 0 ? true:false
            id: footer_button
            type: "regular"
            disabled: view.count == 0
            onButtonAction: view.buttonAction(-2, action)
                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