File tree 3 files changed +17
-1
lines changed 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,17 @@ fn generate_qobject_definitions(
127
127
128
128
let base_upcast = if let Some ( base) = base {
129
129
let base_name = type_names. lookup ( & base) ?. rust_qualified ( ) ;
130
- vec ! [ quote! { impl cxx_qt:: Upcast <#base_name> for #cpp_struct_qualified { } } ]
130
+ vec ! [
131
+ quote! { impl cxx_qt:: Upcast <#base_name> for #cpp_struct_qualified { } } ,
132
+ // Until we can actually implement the Upcast trait properly, we just need to silence
133
+ // the warning that the base class is otherwise unused.
134
+ // This can be done with an unnamed import and the right attributes
135
+ quote! {
136
+ #[ allow( unused_imports) ]
137
+ #[ allow( dead_code) ]
138
+ use #base_name as _;
139
+ } ,
140
+ ]
131
141
} else {
132
142
vec ! [ ]
133
143
} ;
Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ mod inheritance {
77
77
}
78
78
}
79
79
impl cxx_qt:: Upcast < inheritance:: QAbstractItemModel > for inheritance:: MyObject { }
80
+ #[ allow( unused_imports) ]
81
+ #[ allow( dead_code) ]
82
+ use inheritance:: QAbstractItemModel as _;
80
83
#[ doc( hidden) ]
81
84
pub fn create_rs_my_object_rust ( ) -> std:: boxed:: Box < MyObjectRust > {
82
85
std:: boxed:: Box :: new ( core:: default:: Default :: default ( ) )
Original file line number Diff line number Diff line change @@ -430,6 +430,9 @@ pub mod ffi {
430
430
}
431
431
}
432
432
impl cxx_qt:: Upcast < ffi:: QStringListModel > for ffi:: MyObject { }
433
+ #[ allow( unused_imports) ]
434
+ #[ allow( dead_code) ]
435
+ use ffi:: QStringListModel as _;
433
436
impl ffi:: MyObject {
434
437
#[ doc = "Getter for the Q_PROPERTY " ]
435
438
#[ doc = "property_name" ]
You can’t perform that action at this time.
0 commit comments