Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Updated threaded example according to #8
Browse files Browse the repository at this point in the history
  • Loading branch information
White-Oak committed Sep 25, 2016
1 parent f6173bb commit ba2e994
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/threaded.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ ApplicationWindow {
}
Item { Layout.fillWidth: true }
}

// Two ways of using signals' attributes on connection
Connections {
target: logic;
onPageDownloaded: console.log("Page Downloaded");
onPageDownloaded: console.log("Page downloaded " + arguments[0]);
}

Component.onCompleted: {
logic.pageDownloaded.connect(jsPageDownloaded);
}

function jsPageDownloaded(response) {
console.log("Page downloaded " + response);
}
}
}
2 changes: 2 additions & 0 deletions src/qmeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub fn get_dos_qmeta(meta: &QMeta) -> DosQMetaObject {

impl QMeta {
pub fn new_for_qobject(def: QMetaDefinition) -> QMeta {
println!("QMD: {:?}", def);
unsafe {
let meta_obj = dos_qobject_qmetaobject();
let dos_meta = dos_qmetaobject_create(meta_obj,
Expand Down Expand Up @@ -79,6 +80,7 @@ impl QMetaDefinition {
let (signals, slots, props, name) = input;
let signals: Vec<SignalDefinition> = signals.into_iter()
.map(|(s, argc, types)| {
println!("signal '{}' with {} arguments", s, argc);
let def = SignalDefinition {
name: stoptr(s),
parametersCount: argc,
Expand Down

0 comments on commit ba2e994

Please sign in to comment.