qskinny/examples/layouts/layouts.qml
Uwe Rathmann 57c25294c4 replace qmlRegister methods by setting the registration info manually.
Hopefully this allows better finetuning and validating of what is possible in QML
for the various Qt versions.

In the long run we might want to qualify the class definitions with
QML_ELEMENT and friends to have better tool support ( qmlcachegen ??? )
See https://www.qt.io/blog/qml-type-registration-in-qt-5.15
2022-11-29 17:24:40 +01:00

57 lines
1.0 KiB
QML

import QtQuick 2.0
import Skinny 1.0
import Test 1.0
GridBox
{
//margins: 10 // only possible with Qt <= 6.1 || Qt >= 6.5
margins { left: 10; top: 10; right: 10; bottom: 10 }
background
{
linear: [ 0.0, 0.0, 1.0, 0.0 ]
stops: [
{ position: 0.0, color: "Red" },
{ position: 1.0, color: "Yellow" },
]
}
TestRectangle
{
id: paleVioletRed
color: "PaleVioletRed"
}
TestRectangle
{
id: darkSeaGreen
color: "DarkSeaGreen"
}
TestRectangle
{
id: skyBlue
color: "SkyBlue"
}
TestRectangle
{
id: navajoWhite
color: "NavajoWhite"
}
Component.onCompleted:
{
addItem( paleVioletRed, 0, 0, 1, 2 );
addItem( darkSeaGreen, 1, 0, 2, 1 );
addItem( skyBlue, 2, 1, 1, 1 );
addItem( navajoWhite, 0, 2, -1, 1 );
setRowStretchFactor( 0, 1 );
setRowStretchFactor( 1, 2 );
setRowStretchFactor( 2, 1 );
}
}