[Interest] Second RowLayout not reconize width
Máximo Ramírez
aquiles011 at gmail.com
Thu Aug 4 21:50:36 CEST 2016
Dear Oleg, Thanks. Now is right
I changed like you suggest me.
ColumnLayout {
anchors.fill: parent
nothing for first Row
and for TabBar in second Row
Layout.fillWidth: true
I noted two things:
1. If I add anchors.fill: parent to one or both RowLayout the app not start.
2. Apparentelly RowLayout not inhenrits directly from its parent
(ColumnLayout)
El 04/08/16 a las 14:32, Oleg Evseev escribió:
> Hi, Máximo
>
> Please carefully read documentation, there is all you need.
>
>
> http://doc.qt.io/qt-5/qml-qtquick-layouts-columnlayout.html
> <http://doc.qt.io/qt-5/qml-qtquick-layouts-columnlayout.html>
> http://doc.qt.io/qt-5/qml-qtquick-layouts-rowlayout.html
> <http://doc.qt.io/qt-5/qml-qtquick-layouts-rowlayout.html>
> http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html
> <http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html>
>
> use Layout.fillWidth
>
> > RowLayout {
> > width: headerColumn.width
>
> Never do things like that. Your violate basic principles of layouts.
>
> > *Note: *It is not recommended to have bindings to the x, y, width,
> or height properties of items in a layout, since this would conflict
> with the goals of Layout, and can also cause binding loops.
>
>
> ---
> Regards, Oleg
>
> 2016-08-04 21:23 GMT+03:00 Máximo Ramírez <aquiles011 at gmail.com
> <mailto:aquiles011 at gmail.com>>:
>
> Hello,
>
> I'm trying to do a navigation header for my app. I have
> ColumnLayout and two RowLayout, but only the first RowLayout
> recognize width, the second not. I passed the width directly but
> still is not recognized.
>
>
> This is like is showed: http://imgur.com/a/bSr8H
>
>
> But I want that the two rows occupied the space available from the
> ColumnLayout.
>
>
> How can I apply the width for second RowLayout?
>
>
> Bellow my code
>
>
> width: 640
> height: 480
>
> ...................................................
>
> header: ToolBar {
>
> ColumnLayout {
> id: headerColumn
>
> width: parent.width
>
> RowLayout {
> ToolButton {
>
> }
>
> Label {
>
> }
>
> ToolButton {
>
> }
> }
> }
>
> RowLayout {
>
> width: headerColumn.width
>
> Text {
> text: "h: " + headerColumn.width + "\np: " +
> parent.width
> }
> TabBar {
> id: tabBar
> //currentIndex: swipeView.currentIndex
>
>
> // anchors.left: parent.left
> // anchors.right: parent.right
>
>
>
> currentIndex: 0
>
> TabButton {
> Image {
> source:
> "images/ic_directions_car_black_24dp.png"
> }
> Text {
> text: qsTr("Auto")
> }
> }
> TabButton {
> Image {
> source:
> "images/ic_directions_bus_black_24dp.png"
> }
> Text {
> text: qsTr("Bus")
> }
> }
> TabButton {
> Image {
> source:
> "images/ic_directions_subway_black_24dp.png"
> }
> Text {
> text: qsTr("Tren")
> }
> }
> TabButton {
> Image {
> source: "images/ic_flight_black_24dp.png"
> }
> Text {
> text: qsTr("Avión")
> }
> }
> TabButton {
> Image {
> source:
> "images/ic_directions_walk_black_24dp.png"
> }
> Text {
> text: qsTr("Caminando")
> }
> }
>
> }
>
> }
> }
> }
>
>
>
>
> --
>
> Máximo Ramírez
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org <mailto:Interest at qt-project.org>
> http://lists.qt-project.org/mailman/listinfo/interest
> <http://lists.qt-project.org/mailman/listinfo/interest>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
--
Máximo Ramírez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160804/480a13ef/attachment.html>
More information about the Interest
mailing list