[Qt-qml] Advanced layout support
jens.bache-wiig at nokia.com
jens.bache-wiig at nokia.com
Mon Oct 17 11:01:54 CEST 2011
> I would like to get a feedback about this API, suggestions or any
> extra feature that would make sense to add.
Just repeating some points from the private discussions we had. I think it makes sense to center items at their baseline by default. (by setting the y-coordinate, so that anchoring still works) Basically by adding a VerticalAlignment property to RowLayout etc. I regularly find myself annoyed by having to explicitly centering every item in a row or column.
> Regarding QtQuick2, I would like to bring to discussion if such
> support should be added for the Row, Column and Grid elements. That
> would provide a better integration with QtCreator.
>
> As a suggestion, we could handle more complex use cases like the following:
>
> Row {
> spacing: 10
>
> Item {
> Row.spacing: 5
> Row.sizePolicy: Row.Fixed
> }
> Item {
> Row.maximumWidth: 300
> Row.stretchFactor: 2.0
> Row.sizePolicy: Row.Expanding
> }
> }
>
I think you should post that question on the qt-qml mailing list. I am not sure how many of the core developers that follow the components list and this can affect generic Qt Quick in general. In any case, I think we could provide a standard Layout attached property that we can use on any item that has layout management. Including Splitters as well. So Row in that example, it would still have Layout.sizePolicy as an attached property.
> If one wants to use the default Row/Column features, no attached
> properties would be needed. The same would be applied for Grid, like
> span support.
The Grid we have in Qt Quick is very different from GridLayout actually. The problem is that the current wrapping behavior cannot be unified.But I think something like this would make sense to have as part of the desktop components:
GridLayout {
Item {
Layout.rowSpan: 2
Layout.column: 1
Layout.row: 0
}
Item {
Layout.rowSpan: 2
Layout.column: 0
Layout.row: 2
} ...
}
Regards,
Jens
More information about the Qt-qml
mailing list