Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/cxx-qt-gen/src/generator/rust/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ pub fn generate_rust_signal(
#[doc = "Connect the given function pointer to the signal "]
#[doc = #signal_name_cpp]
#[doc = ", so that when the signal is emitted the function pointer is executed."]
#[allow(dead_code)]
pub fn #connect_ident_rust<F: FnMut(#self_type_qualified, #(#parameters_qualified_type),*) + 'static + Send>(self: #self_type_qualified, closure: F, conn_type: cxx_qt::ConnectionType) -> cxx_qt::QMetaObjectConnectionGuard
{
cxx_qt::QMetaObjectConnectionGuard::from(#module_ident::#free_connect_ident_rust(
Expand All @@ -192,6 +193,7 @@ pub fn generate_rust_signal(
#[doc = ", so that when the signal is emitted the function pointer is executed."]
#[doc = "\n"]
#[doc = "Note that this method uses a AutoConnection connection type."]
#[allow(dead_code)]
pub fn #on_ident_rust<F: FnMut(#self_type_qualified, #(#parameters_qualified_type),*) + 'static + Send>(self: #self_type_qualified, closure: F) -> cxx_qt::QMetaObjectConnectionGuard
{
cxx_qt::QMetaObjectConnectionGuard::from(#module_ident::#free_connect_ident_rust(
Expand Down
5 changes: 1 addition & 4 deletions examples/qml_features/rust/src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ impl qobject::RustProperties {
let previous_url = self.as_ref().connected_url.clone();
self.as_mut().rust_mut().previous_connected_url = previous_url;

std::mem::swap(
&mut self.as_mut().rust_mut().connected_url,
&mut QUrl::default(),
);
self.as_mut().rust_mut().connected_url = QUrl::default();
self.as_mut().connected_state_changed();
}
}
Expand Down
Loading