Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt6.5 QML Layout not working well in Linux
Qt 6.12 LTS is out! See what's new in the release blog

Qt6.5 QML Layout not working well in Linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 475 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    dmendizabal
    wrote on last edited by
    #1

    Hi,

    When I moved from Qt5 to Qt6 I found an issue with the Layout in QML.

    One of the items in the RowLayout needs to fill the available space, so it has Layout.fillWidth: true
    But, instead of respecting the other items, it resized on top of the others. Strangely, when I manually resize the window (draging one of the borders) the layout is adjusted and it shows as it should be.

    It seems that the triggering of Layout adjustment is missing in Qt6.

    Snipet of the code:

    RowLayout {
                        Button {
                            id: id_buttonBrowseFrom
                            Layout.preferredWidth: id_labelRef.width*8
                           ...
                        }
                        Button {
                            id: id_buttonSshFrom
                            Layout.preferredWidth: id_labelRef.width*8
                           ...
                        }
                        Rectangle {
                            id: id_rectFrom
                            Layout.preferredWidth: id_labelRef.width*10
                           ...
                        }
                        TextField {
                            id: id_fieldFrom
                            Layout.fillWidth: true
                            ...
                        }
                    }
    

    Screenshot of how it looks when the application starts:

    Screenshot from 2023-04-06 14-47-38.png

    Screenshot of how it looks when I resize the window and adjusts automatically:

    Screenshot from 2023-04-06 14-47-49.png

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Maybe related to https://bugreports.qt.io/browse/QTBUG-93631?

      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
      • Unsolved