Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tripolskypetr committed Jul 3, 2019
1 parent d57e635 commit 677a128
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
40 changes: 40 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# QML flex layout

Qt quick layout system is real ugly. It would be much more convenient to use flexbox for positioning elements. This repository contains a set of qt quick bindings to the [Yoga](https://github.com/facebook/yoga) layout engine from React Native for rendering flexbox.

![Screenshot](docs/screenshot.png)

```
import QtQuick 2.5
import QtQuick.Window 2.0
Window {
visible: true
height: 400
width: 675
Rectangle {
anchors.fill: parent
color: "cyan"
Flex {
height: parent.height
width: parent.width
flexDirection: "row"
flexWrap: "wrap"
justifyContent: "spaceAround"
alignItems: "center"
alignSelf: "center"
alignContent: "stretch"
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
}
}
}
```
Binary file added docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion qml/example.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Window {
alignItems: "center"
alignSelf: "center"
alignContent: "stretch"
flexShrink: 10
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Rectangle { color: "green"; height: 150; width: 150 }
Expand Down

0 comments on commit 677a128

Please sign in to comment.