Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Column Layout Height and Implicit Height
Forum Updated to NodeBB v4.3 + New Features

Column Layout Height and Implicit Height

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 739 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • code_guriC Offline
    code_guriC Offline
    code_guri
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved