Qt 6.12 LTS is out! See what's new in the release
blog
Qt6.5 QML Layout not working well in Linux
-
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 of how it looks when I resize the window and adjusts automatically:

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