initial port to cxx_qt 6.0
This commit is contained in:
parent
62daf316a3
commit
744481587f
31 changed files with 1992 additions and 1860 deletions
|
@ -1,4 +1,7 @@
|
|||
use std::pin::Pin;
|
||||
|
||||
use time::macros::format_description;
|
||||
use tokio::runtime::Runtime;
|
||||
use tracing_subscriber::{
|
||||
fmt::{self, time::LocalTime},
|
||||
EnvFilter,
|
||||
|
@ -47,30 +50,35 @@ mod db {
|
|||
|
||||
#[cxx_qt::bridge]
|
||||
mod utilities {
|
||||
use tokio::runtime::Runtime;
|
||||
unsafe extern "RustQt" {
|
||||
#[qobject]
|
||||
#[qml_element]
|
||||
type Utils = super::UtilsRust;
|
||||
|
||||
#[cxx_qt::qobject]
|
||||
#[derive(Debug)]
|
||||
pub struct Utils {
|
||||
runtime: Runtime,
|
||||
}
|
||||
|
||||
impl Default for Utils {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
runtime: tokio::runtime::Runtime::new().unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl qobject::Utils {
|
||||
#[qinvokable]
|
||||
pub fn setup(&self) {
|
||||
crate::utils::setup();
|
||||
fn setup(self: Pin<&mut Utils>);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UtilsRust {
|
||||
runtime: Runtime,
|
||||
}
|
||||
|
||||
impl Default for UtilsRust {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
runtime: tokio::runtime::Runtime::new().unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl utilities::Utils {
|
||||
pub fn setup(mut self: Pin<&mut Self>) {
|
||||
crate::utils::setup();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn setup() {
|
||||
tracing_subscriber::FmtSubscriber::builder()
|
||||
.pretty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue