File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
crates/cxx-qt-gen/src/generator/rust Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,18 @@ impl GeneratedRustFragment {
83
83
#upcast_fn_qualified( this)
84
84
}
85
85
86
- unsafe fn from_base_ptr( base: * const #base_qualified) -> * const Self {
87
- #downcast_fn_qualified( base)
86
+ unsafe fn from_base_ptr( base: * const #base_qualified) -> * const Self {
87
+ #downcast_fn_qualified( base)
88
+ }
88
89
}
89
- }
90
- } ] ,
90
+ } ,
91
+ // Add back once we figure out the bug with QObject, for automatic transitive casts
92
+ // parse_quote! {
93
+ // unsafe impl ::cxx_qt::MainCast for #struct_name {
94
+ // type Base = #base_qualified;
95
+ // }
96
+ // }
97
+ ] ,
91
98
} )
92
99
}
93
100
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ ApplicationWindow {
28
28
string: qsTr (" My String with my number: %1" ).arg (myObject .number )
29
29
}
30
30
31
+ A {
32
+ id: a
33
+ number: 10
34
+ }
35
+
31
36
Column {
32
37
anchors .fill : parent
33
38
anchors .margins : 10
@@ -55,6 +60,12 @@ ApplicationWindow {
55
60
onClicked: myObject .sayHi (myObject .string , myObject .number )
56
61
}
57
62
63
+ Button {
64
+ text: qsTr (" Test A" )
65
+
66
+ onClicked: a .test ()
67
+ }
68
+
58
69
Button {
59
70
text: qsTr (" Quit" )
60
71
You can’t perform that action at this time.
0 commit comments