Search code examples
pythonraspberry-pipyside2

Can I enable remote UI for qt app on RPI?


When trying to enable remote ui for my pyside2 app im getting the following error:

python3 app.py -platform webgl

qt.qpa.plugin: Could not find the Qt platform plugin "webgl" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted

Im using pyside2 version 5.11.2 on RPI4

pyside2 was installed like this:

sudo apt install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic

Solution

  • You have to compile the qtwebglplugin with the same version of Qt that was compiled for PySide2, in this case to compile PySide2 the Qt provided by the OS distribution was used:

    sudo apt install qtbase5-private-dev libqt5websockets5-dev
    git clone -b 5.11 https://code.qt.io/qt/qtwebglplugin.git
    cd qtwebglplugin
    qmake .
    make
    sudo make install