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