First stage of cleaning up the export handling of the slint root component (#2095)

We implicitly export the last component of a .slint file to the generator.
Issue a warning when that happens and suggest to export it explicitly.
This commit is contained in:
Simon Hausmann 2023-01-23 15:19:49 +01:00 committed by GitHub
parent 33d68687c2
commit 24dcef5fed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 175 additions and 143 deletions

View file

@ -14,7 +14,7 @@ WithStates := Rectangle {
]
}
Test := Rectangle {
export Test := Rectangle {
property <int> a: 45 + root.b;
// ^error{The binding for the property 'a' is part of a binding loop}

View file

@ -35,7 +35,7 @@ T4 := Rectangle {
property <length> my_property <=> x;
}
App := Rectangle {
export App := Rectangle {
VerticalLayout {

View file

@ -18,7 +18,7 @@ Compo1 := Rectangle {
// ^error{The binding for the property 'bb' is part of a binding loop}
}
App := Rectangle {
export App := Rectangle {
cc := Compo1 {
aa() => { return self.a; }
// ^error{The binding for the property 'aa' is part of a binding loop}
@ -29,4 +29,4 @@ App := Rectangle {
}
}

View file

@ -6,7 +6,7 @@ Alias := Rectangle {
property <int> ps_width <=> viewport_width;
}
Foo := Rectangle {
export Foo := Rectangle {
property <int> base-prop: alias.viewport_width;
// ^error{The binding for the property 'base-prop' is part of a binding loop}

View file

@ -19,7 +19,7 @@ TC := Rectangle {
}
Test := Rectangle {
export Test := Rectangle {
VerticalLayout {
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop} // FIXME: That's an internal property, but people might understand
// ^^error{The binding for the property 'min-width' is part of a binding loop}

View file

@ -26,7 +26,7 @@ Wrap := Rectangle {
property <bool> test: square.width == square.height;
}
Test := Rectangle {
export Test := Rectangle {
property <image> source;
GridLayout {
// ^error{The binding for the property 'layout-cache-h' is part of a binding loop}

View file

@ -22,7 +22,7 @@ Compo := Rectangle {
}
Foo := Rectangle {
export Foo := Rectangle {
Compo {
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
the_text: self.preferred-width / 1px;

View file

@ -5,7 +5,7 @@
Key := Rectangle { property <int> pos; property <int> num_elements; }
Test := Rectangle {
export Test := Rectangle {
Rectangle {
property <int> num_elements;
num-elements: 4;