hlayout & vlayout change to flex
This commit is contained in:
parent
06f47e31cc
commit
257f3f0dab
@ -25,7 +25,7 @@ Item {
|
|||||||
property string alignItems: "auto"
|
property string alignItems: "auto"
|
||||||
property string alignSelf: "auto"
|
property string alignSelf: "auto"
|
||||||
|
|
||||||
property string justifyContent: "spaceBetween"
|
property string justifyContent: "flexStart"
|
||||||
|
|
||||||
property string display: "flex"
|
property string display: "flex"
|
||||||
|
|
||||||
|
@ -2,21 +2,5 @@ import QtQuick 2.12
|
|||||||
import QtQuick.Controls 2.5
|
import QtQuick.Controls 2.5
|
||||||
|
|
||||||
Flex {
|
Flex {
|
||||||
height: 400
|
|
||||||
width: 675
|
|
||||||
|
|
||||||
flexDirection: "row"
|
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 }
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
import QtQuick.Controls 2.5
|
import QtQuick.Controls 2.5
|
||||||
|
|
||||||
Column {
|
Flex {
|
||||||
|
flexDirection: "column"
|
||||||
|
alignItems: "center"
|
||||||
|
alignSelf: "center"
|
||||||
|
justifyContent: "spaceAround"
|
||||||
|
alignContent: "stretch"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
FlexLayout::FlexLayout(FlexLayoutConfig *config, QObject *parent)
|
FlexLayout::FlexLayout(FlexLayoutConfig *config, QObject *parent)
|
||||||
: QObject(parent) {
|
: QObject(parent) {
|
||||||
|
qCritical() << "create flex";
|
||||||
node = YGNodeNewWithConfig(config->getConfig());
|
node = YGNodeNewWithConfig(config->getConfig());
|
||||||
this->config = config;
|
this->config = config;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user