// file: poc-qt/poc001/src/main.rs

mod bridge;

use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl};

fn main() {
    let mut app = QGuiApplication::new();
    let mut engine = QQmlApplicationEngine::new();

    if let Some(engine_ref) = engine.as_mut() {
        let url = QUrl::from("qrc:/qt/qml/com/sasedev/hello/qml/main.qml");
        engine_ref.load(&url);
    } else {
        eprintln!("failed to create QQmlApplicationEngine");
        return;
    }

    if let Some(app_ref) = app.as_mut() {
        app_ref.exec();
    } else {
        eprintln!("failed to create QGuiApplication");
    }
}
