trying to find a way for a central tokio::runtime
This commit is contained in:
parent
e9c78e4ea6
commit
ebce1449d6
1 changed files with 13 additions and 2 deletions
|
@ -47,10 +47,21 @@ mod db {
|
||||||
|
|
||||||
#[cxx_qt::bridge]
|
#[cxx_qt::bridge]
|
||||||
mod utilities {
|
mod utilities {
|
||||||
|
use tokio::runtime::Runtime;
|
||||||
|
|
||||||
#[cxx_qt::qobject]
|
#[cxx_qt::qobject]
|
||||||
#[derive(Default, Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Utils {}
|
pub struct Utils {
|
||||||
|
runtime: Runtime,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Utils {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
runtime: tokio::runtime::Runtime::new().unwrap(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl qobject::Utils {
|
impl qobject::Utils {
|
||||||
#[qinvokable]
|
#[qinvokable]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue