Combine Qt/Qml and bevy into one program and it cannot open bevy's App normally. #14112
Unanswered
dezbracaty
asked this question in
Q&A
Replies: 1 comment
-
Like the error suggests, you probably want to run Bevy headless, or otherwise without winit involved. Otherwise Qt and Winit will be fighting for control over the windowing layer. Check the custom_runner example for a starting point. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bevy version
in cargo.toml
[Optional] Relevant system information
Macos 15 beta2
rustc 1.79.0 (129f3b996 2024-06-10)
project address
https://github.com/dezbracaty/BevyQml
What you did
I built a program combine Qt/Qml and bevy , and I can run it normally on ubuntu system , but when run it on macos, it output a error, and I think this is a platform related problem. So I hope to know how to solve it.
What went wrong
After running
App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, animate_cube) .run();
It crash and output :
2024-07-02T05:56:27.686954Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 15.0 ", kernel: "24.0.0", cpu: "Apple M1 Pro", core_count: "10", memory: "16.0 GiB" } thread '<unnamed>' panicked at /Users/allen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.3/src/platform_impl/macos/event_loop.rs:220:13:
winitrequires control over the principal class. You must create the event loop before other parts of your application initialize NSApplication note: run with
RUST_BACKTRACE=1environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 [1] 33997 abort /Users/allen/Projects/RustProjects/BevyQml/build/bevyQml/example_qml_minimal
Additional Information
First photo is qml window,and it will call to rust function
App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, animate_cube) .run();
while clicking "Say HI!" button.
Beta Was this translation helpful? Give feedback.
All reactions