use crate::platform::qt::qt_wrapper::QApplication;
use std::marker::PhantomData;
pub struct Dispatcher {
_marker: PhantomData<*const ()>,
}
impl Dispatcher {
pub(crate) fn new() -> Self {
Self {
_marker: PhantomData,
}
}
pub fn post_func_any_thread<F>(&self, func: F)
where
F: FnOnce() + Send + 'static,
{
QApplication::post_func_any_thread(func);
}
pub fn post_func_same_thread<F>(&self, func: F)
where
F: FnOnce() + 'static,
{
unsafe {
QApplication::post_func_same_thread(func);
}
}
}