KDAB / KDDockWidgets

KDAB's Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets
Other
754 stars 163 forks source link

Broken on WASM with QtQuick #441

Closed msarehn closed 9 months ago

msarehn commented 9 months ago

On WASM, createDropIndicatorOverlay(Core::DropArea *dropArea) always creates a SegmentedDropIndicatorOverlay:

#ifdef Q_OS_WASM
    // On WASM windows don't support translucency, which is required for the classic indicators.
    return new Core::SegmentedDropIndicatorOverlay(dropArea);
#endif

However, the QtQuick platform has no "View" implementation of this, so the above will always crash ultimately. If the "Classic" indicators don't work, it would be good to return the Null indicators on WASM/QtQuick so that it doesn't crash, at least.

msarehn commented 9 months ago

Having just tried this, the "Classic" Indicators work just fine in WASM/QtQuick.

iamsergio commented 9 months ago

That makes sense. I'd like to test locally as well though, but I'm not getting any *.html file.

I ran:

$ source ~/emsdk/emsdk_env.sh
$ em++ --version # Needs to be 3.1.37 for Qt 6.6.0
$ cd KDDockWidgets/
$ ~/Qt/6.6.0/wasm_multithread/bin/qt-cmake --preset=wasm-release
$ cd build-wasm-release/
$ ninja kddockwidgets
$ ninja qtwidgets_dockwidgets
$ ninja qtquick_dockwidgets

And got files such as qtwidgets_dockwidgets.js , qtwidgets_dockwidgets.wasm but no html file as suggested by the Qt documentation

Did you do something different ?

msarehn commented 9 months ago

And got files such as qtwidgets_dockwidgets.js , qtwidgets_dockwidgets.wasm but no html file as suggested by the Qt documentation

Did you do something different ?

The html files are created by qt_finalize_target() in CMake. In our code, I've just replaced all add_executable() calls with qt_add_executable(); recent CMake (3.19+) then does finalization automatically.