slint-ui / cargo-ui

GUI for Cargo
Apache License 2.0
270 stars 23 forks source link

Crash - QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw #26

Closed chriswayg closed 4 months ago

chriswayg commented 4 months ago

Cargo UI crashes each time after selecting the dropdown menu to the right of the Run button:

"Memory" (the memory app from the tutorial) is shown. No other apps are shown in the drop-down. Clicking on it, then clicking elsewhere causes the app to crash.

Clicking on the debug/release drop-down menu also causes it to crash every time.

Message in terminal:

QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw

macOS 13.6.7 Slint 1.6.0 Cargo UI 0.3.3

Screenshot 2024-06-18 at 11 24 16 AM

tronical commented 4 months ago

Would it be possible for you to run cargo-ui in lldb to get a backtrace when the crash happens? Thanks in advance :)

chriswayg commented 4 months ago

@tronical based on the latest github clone of cargo-ui, I get the following output after each crash when running it via lldb:

2024-06-18 19:13:42.512236+0800 cargo-ui[58065:11495455] QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw
2024-06-18 19:13:44.983244+0800 cargo-ui[58065:11495472] [client] No error handler for XPC error: Connection invalid
Process 58065 exited with status = 0 (0x00000000) 

This does not look very informative, though. I am not familiar with lldb. Any special lldb settings needed?

ogoffart commented 4 months ago

The fact that is closes the app is this issue: https://github.com/slint-ui/slint/issues/4803

But another problem is that it still uses the Qt backend on mac. I realize it is a default feature and it shouldn't be.

chriswayg commented 4 months ago

Well, when running with SLINT_BACKEND=winit cargo ui, it works smoothly on macOS.

Alternatively, setting default = ["slint-backend-gl-all"] in cargo-ui/Cargo.toml solves it as well.

ogoffart commented 4 months ago

I changed the default in https://github.com/slint-ui/cargo-ui/commit/501faccc4fb08376220b312f6eadca07ba2a90f8 to be aligned with Slint's default

And the "crash" issues is fixed by https://github.com/slint-ui/slint/pull/5427