Column Layout Height and Implicit Height



  • I trying to build a small window using column layout. It has rectangles with conditional visibility.

    ColumnLayout{
            id : mainLayout
            anchors.margins: 5
            anchors.fill: parent        
    		
            Rectangle{
                Layout.preferredHeight: 160
                Layout.preferredWidth: 230
                visible: (imageListView.count == 0)           
            }
            Rectangle{
                Layout.preferredHeight: 160
                Layout.preferredWidth: 230
                visible: (docListView.count != 0)
            }
    		
            Rectangle{
                Layout.preferredHeight: 160
                Layout.preferredWidth: 230
    			visible: (urlListView.count != 0)
            }
         
        }
    

    I am loading it using qml Loader. The first time a load it, its height and implicit height are different and position of this window on screen is not what I intend. When I close the window and load it again, All seems perfect. It's Position on window is right and implicit height and height are same.

    There is no such issue if i don't use layout. Am I missing something ? Height and implicit height are not coming same.


Log in to reply
 

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