Qtweb issues and problems

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?

Hi,

If you are using qtweb example from master - you also should try to compile it with master.
There are minimal changes to correctly handle qt6. Please try it and see if it works for you.

If you really want to use 6.28 version, I need to backport some changes in GetQt5EmbedQualifier method.

Regards,
Sergey

I backport changes to 6.28 branch that qtweb example also can be compiled.

Hi Thanks the suggestion.

Here is how I built the root from git source

>git clone https://github.com/root-project/root.git root_source
>cd root_source
>git checkout v6-28-00-patches
>cd ..
>mkdir root_build
>cd root_build
>cmake ../root_source
>cmake --build . -j2
>cd bin
>source thisroot.sh

After I built it, I ran root, it shows

   ------------------------------------------------------------------
  | Welcome to ROOT 6.28/05                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jun 03 2023, 02:57:35                 |
  | From heads/v6-28-00-patches@v6-28-04-61-g55513fb518              |
  | With c++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0                   |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

I found that the $ROOTSYS/tutorial/webgui/qt5web but no qtweb.

so, I download the qtweb, have all the issues in my first post, fix it. and compile with no problem.

But when I run qtweb, it said

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 ....
Error in <[ROOT.WebGUI] Error /root_source/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 /root_source/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 !!!!!

I am not sure why it still using ROOTQt5WebDisplay. There is libROOTWebDisplay.so in my $ROOTSYS/lib/.

I made a symbolic link,

ln -s  libROOTWebDisplay.so  libROOTQt5WebDisplay.so

It solved the first problem. But the RWebDisplayhandle.cxx and RWebWindowsManager.cxx are still there.

Am I using the wrong branch?

Best regards,
Ryan

First of all, you should be root with -Dqt6web=ON. After building it should have libROOTQt6WebDisplay.so library

Second, when building qtweb, you should specify qt version -Dqt6web=ON.

Thank for the help.

>cmake ../root_source -Dqt6web=ON
>cmake --build . -j2

build root OK.

Re downaload the qtweb, made a build folder under qtweb folder

>mkdir build
>cd build
>cmake ../ -Dqt6web=ON
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.4.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done
-- Generating done
CMake Warning:
 Manually-specified variables were not used by the project:

   qt6web


-- Build files have been written to: /home/ryan/Downloads/root/tutorials/webgui/qtweb/build
>make
[ 12%] Automatic MOC and UIC for target qtweb
[ 12%] Built target qtweb_autogen
[ 25%] Building CXX object CMakeFiles/qtweb.dir/qtweb_autogen/mocs_compilation.cpp.o
[ 37%] Building CXX object CMakeFiles/qtweb.dir/ExampleWidget.cpp.o
[ 50%] Building CXX object CMakeFiles/qtweb.dir/RCanvasWidget.cpp.o
[ 62%] Building CXX object CMakeFiles/qtweb.dir/RGeomViewerWidget.cpp.o
[ 75%] Building CXX object CMakeFiles/qtweb.dir/TCanvasWidget.cpp.o
[ 87%] Building CXX object CMakeFiles/qtweb.dir/ExampleMain.cpp.o
[100%] Linking CXX executable qtweb
[100%] Built target qtweb
>./qtweb
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ryan'
Could not find QtWebEngineProcess
Aborted

It seems that all root things are OK. but the QtWebEngineProcess is missing.

I will try that on a naive linux machine. probably it is window linux system problem… I am not sure.

Hi,

Strange.

When compiling 6,28 branch I do not have such error message:

CMake Warning:
 Manually-specified variables were not used by the project:

   qt6web

Try to specify more flags:

cmake ../root_source -Dwebgui=ON -Dqt6web=ON -Droot7=ON -DCMAKE_CXX_STANDARD=17

Hi Wile,

tutorials/webgui/qtweb is separate application, which uses either qt5web or qt6web components of ROOT.
When building ROOT, one should enable qt5web and/or qt6web.
When building tutorials/webgui/qtweb, one need to specify which of the component is using.

@goluckyryan I made mistake!
When building tutorials/webgui/qtweb, you need to set -Dwithqt=6.
See:

Sorry.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.