[Qt-qml] Advanced layout support
Bo Thorsen
bo at fioniasoftware.dk
Mon Oct 17 09:05:26 CEST 2011
Hi Adriano,
I haven't looked closely at how you do it or the API, but just wanted to
write a note of thanks. This is something that have been missing from
QML. Please keep up the work, I'm very keen on getting access to this.
Thank you,
Bo Thorsen.
Den 17-10-2011 03:09, Adriano Rezende skrev:
> Hi,
>
> I'm moving a layout discussion to this mailing list.
>
> I've pushed an initial version of a linear layout element in the
> following branch:
>
> http://qt.gitorious.org/~arezende/qt-components/arezende-desktop/commits/layouts
>
> It basically provides more powerful layout management than Row/Column
> elements, since it handles item stretching, individual item spacing,
> minimum/preferred/maximum size policies.
>
> These are mandatory features in most of the desktop applications and I
> think they should be addressed in a proper manner. Currently, we end
> up simulating such features using a lot of anchors and property binds
> that increases the code size and impacts in performance.
>
> The current implementation provides a RowLayout and a ColumnLayout element.
>
> Follows an example:
>
> RowLayout {
> spacing: 10
>
> Item {
> Layout.spacing: 6
> Layout.minimumWidth: 100
> }
> Item {
> Layout.maximumWidth: 300
> Layout.stretchFactor: 2.0
> }
> }
>
> There are some features in the TODO list, like accepting different
> size policies and some improvements in the layout behavior.
>
> I would like to get a feedback about this API, suggestions or any
> extra feature that would make sense to add.
>
> 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
> }
> }
>
> 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.
>
>
> Cheers,
> Adriano
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
More information about the Qt-qml
mailing list