I downloaded the precompiled root 6.28.04, untar it, and downloaded the qtweb folder from the git. (the folder in the tar root is still qt5web).
I have qt6 installed using apt qt6-base-dev qt6-webengine-dev qt6-webview-dev
My platform is Ubuntu 22.04 (window linux subsystem)
make a folder for build.
using cmake 3.22.1
encounter cmake error.
CMake Error at CMakeLists.txt:19 (error):
Unknown CMake command "error".
make a new CMakeList.txt as
==================
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(qtweb)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(ROOT REQUIRED)
include(${ROOT_USE_FILE})
find_package(Qt6 COMPONENTS Core WebEngineCore WebEngineWidgets CONFIG)
set(qt_libs Qt6::Core Qt6::Widgets Qt6::WebEngineCore Qt6::WebEngineWidgets)
set(root_qtlib ROOT::ROOTQt6WebDisplay)
add_executable(qtweb
ExampleWidget.ui
ExampleWidget.cpp
RCanvasWidget.cpp
RGeomViewerWidget.cpp
TCanvasWidget.cpp
ExampleMain.cpp
)
target_link_libraries(qtweb
${qt_libs}
${ROOT_LIBRARIES} ROOT::ROOTWebDisplay ${root_qtlib} ROOT::Gpad ROOT::WebGui6 ROOT::ROOTGpadv7 ROOT::ROOTCanvasPainter ROOT::Geom ROOT::ROOTBrowserv7 ROOT::ROOTGeomViewer
)
===============
encounter another problem.
CMake Error at CMakeLists.txt:19 (add_executable):
Target "qtweb" links to target "ROOT::ROOTQt6WebDisplay" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Change the “ROOT::ROOTQt6WebDisplay” to “ROOT::ROOTWebDisplay”
cmake ok. Now make.
encounter another problem:
RCanvasWidget.cpp:33:74: error: no matching function for call to ‘ROOT::Experimental::RWebDisplayArgs::GetQt5EmbedQualifier(RCanvasWidget*, const char [9], int)’
33 | auto where = ROOT::Experimental::RWebDisplayArgs::GetQt5EmbedQualifier(this, "noopenui", QT_VERSION);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /qtweb/RCanvasWidget.cpp:14:
/root/include/ROOT/RWebDisplayArgs.hxx:209:23: note: candidate: ‘static std::string ROOT::Experimental::RWebDisplayArgs::GetQt5EmbedQualifier(const void*, const string&)’
209 | static std::string GetQt5EmbedQualifier(const void *qparent, const std::string &urlopt = "");
| ^~~~~~~~~~~~~~~~~~~~
/root/include/ROOT/RWebDisplayArgs.hxx:209:23: note: candidate expects 2 arguments, 3 provided
make[2]: *** [CMakeFiles/qtweb.dir/build.make:104: CMakeFiles/qtweb.dir/RCanvasWidget.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/qtweb.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Change RCanvasWidget.cpp:33 from
auto where = ROOT::Experimental::RWebDisplayArgs::GetQt5EmbedQualifier(this, “noopenui”, QT_VERSION);
to
auto where = ROOT::Experimental::RWebDisplayArgs::GetQt5EmbedQualifier(this, “noopenui”);
similar thing for TCanvasWidget.cpp and RGeomViewerWidget.cpp
make success.
Run error
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ryan'
Error in <TUnixSystem::FindDynamicLibrary>: libROOTQt5WebDisplay[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /root/lib:.:/root_v6.28.04/lib:/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/glibc-hwcaps/x86-64-v3:/lib/glibc-hwcaps/x86-64-v2:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/glibc-hwcaps/x86-64-v3:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib
Error in <[ROOT.WebGUI] Error /home/sftnight/build/ws/BUILDTYPE/Release/LABEL/ROOT-ubuntu2204/V/6-28/root/gui/webdisplay/src/RWebDisplayHandle.cxx:589 in static std::unique_ptr<ROOT::Experimental::RWebDisplayHandle> ROOT::Experimental::RWebDisplayHandle::Display(const ROOT::Experimental::RWebDisplayArgs&)>: Neither Qt5/6 nor CEF libraries were found to provide local display
Error in <[ROOT.WebGUI] Error /home/sftnight/build/ws/BUILDTYPE/Release/LABEL/ROOT-ubuntu2204/V/6-28/root/gui/webdisplay/src/RWebWindowsManager.cxx:701 in unsigned int ROOT::Experimental::RWebWindowsManager::ShowWindow(ROOT::Experimental::RWebWindow&, const ROOT::Experimental::RWebDisplayArgs&)>: Cannot display window in qt5
FAIL TO FIND QWebEngineView - ROOT Qt5Web plugin does not work properly !!!!!
============================
Help, please… should I download the root source code and compile the root?