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

@ -55,7 +55,7 @@ OldCompo := Rectangle {
}
}
component Foo inherits Rectangle {
export component Foo inherits Rectangle {
c1 := OldCompo {
inout2: 42;

View file

@ -69,7 +69,7 @@ component A inherits Compo {
// ^error{Unknown unqualified identifier 'priv1'}
}
component Foo inherits Rectangle {
export component Foo inherits Rectangle {
in property <[int]> input_model;

View file

@ -22,8 +22,8 @@ component Bar {
@children
}
component Baz {
export component Baz {
Bar {
Foo {}
}
}
}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
component Compo inherits Text {
export component Compo inherits Text {
property <string> background: text;
// ^error{Unknown unqualified identifier 'text'. Did you mean 'self.text'?}

View file

@ -293,7 +293,7 @@ component C11 {
}
}
Legacy1 := Rectangle {
export Legacy1 := Rectangle {
b1:= Button {}
in property in1 <=> b1.pressed;
// ^warning{Link to a output property is deprecated}