From 677a1287df8c1a5d6c35f33705be251828daf901 Mon Sep 17 00:00:00 2001 From: tripolskypetr Date: Wed, 3 Jul 2019 21:04:15 +0300 Subject: [PATCH] docs --- Readme.md | 40 ++++++++++++++++++++++++++++++++++++++++ docs/screenshot.png | Bin 0 -> 6515 bytes qml/example.qml | 1 - 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Readme.md create mode 100644 docs/screenshot.png diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..f25f209 --- /dev/null +++ b/Readme.md @@ -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 } + } + } +} + +``` diff --git a/docs/screenshot.png b/docs/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..d4734eeee3f751e41775ac79b7f341a431ffaeb4 GIT binary patch literal 6515 zcmeHMYgAKL77j6yYY+$!ib9c>6s#!H&Qg%(MI#7lfi-l5c0s_$NF9y9IPwZ`AwWT+ zWdWlwAcTbvtRfVn5d=agP}Gs80#1}PAxK4e_?$| z%X7uu#;c!{zf0etnfzMJbS~u33)#nfaK7U8hCFYtoa2U= z*egrrE(bJ;M}ORJQM1MsCz zY8=T(L)*JU)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