QML.jl icon indicating copy to clipboard operation
QML.jl copied to clipboard

Support for QtCharts 6

Open ronisbr opened this issue 1 year ago • 22 comments

Hi!

I am trying to migrate an application that uses a julia back end and a QML front end to QML.jl. However, I really need the QtCharts 6, which does not seem to be supported. Is there any blocking issues preventing this feature? It seems that we had the possibility in Qt 5 by installing Qt5Charts_jll but I did not find the package for Qt 6.

ronisbr avatar Dec 05 '24 13:12 ronisbr

QtCharts was not supported in 6.0 but it is supported in 6.1

ufechner7 avatar Dec 05 '24 14:12 ufechner7

Yes! Which Qt version QML uses right now? 6.7?

ronisbr avatar Dec 05 '24 14:12 ronisbr

Yes, we use Qt 6.7. The problem is that there is no JLL for QtCharts for Qt 6, it needs to be added in Yggdrasil.

barche avatar Dec 05 '24 16:12 barche

I see. Do you think it is a difficult task? I can try to make a PR but I have never worked with Yggdrasil before. Any tips?

ronisbr avatar Dec 05 '24 16:12 ronisbr

If Charts only depends on Qt6Base it should be easy, using Qt6Svg as a template: https://github.com/JuliaPackaging/Yggdrasil/blob/master/Q/Qt6Svg/build_tarballs.jl

barche avatar Dec 05 '24 16:12 barche

Thanks! I will try

ronisbr avatar Dec 05 '24 16:12 ronisbr

Looking here:

https://www.freshports.org/x11-toolkits/qt6-charts/

It seems it only depends on Qt6Base indeed.

ronisbr avatar Dec 05 '24 17:12 ronisbr

Also Qt6Declarative, it seems. Just adding this as normal and host build dep should work, so not much more complicated.

barche avatar Dec 05 '24 18:12 barche

Unfortunately I just could not use BinaryBuilder in macOS for some problem with Docker. I am trying to debug it, but even Qt6Svg could not be built here.

ronisbr avatar Dec 05 '24 18:12 ronisbr

Here is the error:

[ Info: Docker base image already exists, skipping import...
[14:32:12]  ---> cd $WORKSPACE/srcdir
[14:32:12]  ---> mkdir build
[14:32:12]  ---> cd build/
[14:32:12]  ---> qtsrcdir=`ls -d ../qtsvg-*`
[14:32:12]  ---> case "$bb_full_target" in
[14:32:12]  ---> apple_sdk_root=$WORKSPACE/srcdir/MacOSX13.3.sdk
[14:32:12]  ---> sed -i "s!/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root!$apple_sdk_root!" $CMAKE_TARGET_TOOLCHAIN
[14:32:12]  ---> cmake -G Ninja -DQT_HOST_PATH=$host_prefix -DPython_ROOT_DIR=/usr -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_PREFIX_PATH=$host_prefix -DCMAKE_FIND_ROOT_PATH=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_SYSROOT=$apple_sdk_root -DCMAKE_FRAMEWORK_PATH=$apple_sdk_root/System/Library/Frameworks -DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DQT_NO_APPLE_SDK_AND_XCODE_CHECK=ON -DCMAKE_BUILD_TYPE=Release $qtsrcdir
[14:32:12] Re-run cmake no build system arguments
[14:32:12] CMake Error at /usr/share/cmake/Modules/Compiler/._ADSP-DetermineCompiler.cmake:1:
[14:32:12]   Parse error.  Expected a command name, got bad character with text "".
[14:32:12] Call Stack (most recent call first):
[14:32:12]   /usr/share/cmake/Modules/CMakeCompilerIdDetection.cmake:6 (include)
[14:32:12]   /usr/share/cmake/Modules/CMakeCompilerIdDetection.cmake:33 (_readFile)
[14:32:12]   /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:282 (compiler_id_detection)
[14:32:12]   /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:301 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
[14:32:12]   /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
[14:32:12]   /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:59 (__determine_compiler_id_test)
[14:32:12]   /usr/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:120 (CMAKE_DETERMINE_COMPILER_ID)
[14:32:12]   CMakeLists.txt:7 (project)

ronisbr avatar Dec 05 '24 18:12 ronisbr

https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/1348

I will come back to this issue when I can fix this problem.

ronisbr avatar Dec 05 '24 18:12 ronisbr

No worries, I created the PR at https://github.com/JuliaPackaging/Yggdrasil/pull/9932

barche avatar Dec 06 '24 15:12 barche

Awesome! Thanks!

ronisbr avatar Dec 06 '24 15:12 ronisbr

Hi @barche !

I tried to load Qt6Charts_jll and I got this error:

julia> using Qt6Charts_jll
ERROR: InitError: could not load library "/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/QtCharts"
dlopen(/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/QtCharts, 0x0001): Library not loaded: @rpath/QtOpenGLWidgets
  Referenced from: <4C4C4478-5555-3144-A19A-05F2F5C03C5B> /Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/QtCharts
  Reason: tried: '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtGui.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGL.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGLWidgets.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtCore.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtWidgets.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtGui.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGL.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtOpenGLWidgets.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtCore.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/artifacts/d4c9fb68913b5cf7a801654a2a46f8e7d6e9a52e/lib/QtCharts.framework/Versions/A/../../../QtWidgets.framework/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/lib/julia/QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/lib/julia/../QtOpenGLWidgets' (no such file), '/Users/ronan.arraes/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/lib/QtOpenGLWidgets' (no such file), '/usr/local/lib/QtOpenGLWidgets' (no such file), '/usr/lib/QtOpenGLWidgets' (no such file, not in dyld cache)

Maybe there is a missing dependency?

ronisbr avatar Dec 07 '24 23:12 ronisbr

Yeah... I think Qt6 introduced a new module called QtOpenGLWidgets and it is a dependency to QtCharts now.

ronisbr avatar Dec 07 '24 23:12 ronisbr

See https://github.com/JuliaRegistries/General/pull/120890#issuecomment-2527100690, I'll investigate.

barche avatar Dec 09 '24 17:12 barche

Hi @barche !

Can I do something to help you fixing this problem?

ronisbr avatar Jan 01 '25 19:01 ronisbr

Sorry, I waited too long. I wanted to make sure QtOpenGLWidgets was the only missing lib, and as it turns out it is, but in the meantime we need to also update the version if we want to change the JLL, so now all the Qt JLLs need to be updated to the new Qt, preferably to 6.8.1.

barche avatar Jan 02 '25 20:01 barche

I started upgrading Qt, currently hitting different errors here: https://github.com/JuliaPackaging/Yggdrasil/pull/10202

barche avatar Jan 03 '25 17:01 barche

Hi @barche !

I am trying to build those packages locally here to check if I can help, but I am still getting a lot of errors. Unfortunately, I only have macOS machines to test and we have that bug with docker.

ronisbr avatar Jan 10 '25 16:01 ronisbr

I started upgrading Qt, currently hitting different errors here: JuliaPackaging/Yggdrasil#10202

But that one is merged now. Any further issues?

ufechner7 avatar Mar 02 '25 11:03 ufechner7

Qt 6.8.2 is indeed complete now in Yggdrasil, small updates to jlqml are needed for the build, then a new jlqml and QML.jl need to be released.

barche avatar Mar 03 '25 21:03 barche

As it turns out, QtCharts is deprecated in favour of QtGraphs. Furthermore, it is incompatible with the way we launch applications in QML.jl and all the examples segfault, even when using the qml program shipped with Qt itself. So I will implement this by adding support for QtGraphs instead.

barche avatar Jun 10 '25 05:06 barche

Hi @barche !

I think we can close this issue right? After installing and loading Qt6Graphs_jll, I can finally plot graphs using QML in Julia:

Image

ronisbr avatar Nov 10 '25 16:11 ronisbr

Yes, glad it works for you too :)

barche avatar Nov 10 '25 17:11 barche