I think it is BUG in QML element Flow



  • The Flow Element doesn't work properly. I tried to reverse the direction of the layout by changing the flow property like this

    @

    import Qt 4.7

    Rectangle{
    id:main
    width:300; height:300

    Flow{
        flow:"RightToLeft"
    
            spacing:40
            Rectangle{id:one; width:30; height:30; color:"green"}
            Rectangle{id:two; width:30; height:30; color:"red"}
    
    }
    

    }
    @



  • From the "documentation":http://doc.qt.nokia.com/latest/qml-flow.html#flow-prop :

    Possible values are:
    Flow.LeftToRight (default) - Items are positioned next to to each other from left to right until the width of the Flow is exceeded, then wrapped to the next line.
    Flow.TopToBottom - Items are positioned next to each other from top to bottom until the height of the Flow is exceeded, then wrapped to the next column.

    Is this the effect you desired, by the way? (I know this flips the elements too)
    @
    import QtQuick 1.0

    Rectangle {
    width:300; height:300
    x: width; transform: Rotation {axis { x: 0; y: 1; z: 0 } angle: 180} // RightToLeft?
    Flow {
    spacing:40
    Rectangle{id:one; width:30; height:30; color:"green"}
    Rectangle{id:two; width:30; height:30; color:"red"}
    }
    }@



  • thank you xsacha,
    but how about right to left culture , like Arabic language, the layout system doesn't offer that, in QML.

    but the value RightToLeft comes from the autocompletion system in QtCreator!!!



  • Hmm, my QtCreator doesn't offer any RightToLeft auto-completion. I'm using Qt4.7.1/QtQuick 1.0

    They are looking at adding this in future.
    See here: http://bugreports.qt.nokia.com/browse/QTBUG-11042

    Target is QtQuick 1.1



  • *thank you again Mr xsacha

    It might be the flow property in layout Item.... I think so *


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.