use crate::QGuiApplication;
use qt_core::QCoreApplicationArgs;
use std::process;
impl QGuiApplication {
pub fn init<F: FnOnce(::cpp_core::Ptr<QGuiApplication>) -> i32>(f: F) -> ! {
let exit_code = {
unsafe {
let mut args = QCoreApplicationArgs::new();
let (argc, argv) = args.get();
let app = QGuiApplication::new_2a(argc, argv);
f(app.as_ptr())
}
}; process::exit(exit_code)
}
}