我可以在 RPI 上为 qt 应用程序启用远程 UI 吗?

Can I enable remote UI for qt app on RPI?

尝试为我的 pyside2 应用程序启用远程 ui 时出现以下错误:

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

我在 RPI4 上使用 pyside2 版本 5.11.2

pyside2 是这样安装的:

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

您必须使用为 PySide2 编译的相同版本的 Qt 编译 qtwebglplugin,在这种情况下编译 PySide2 使用了 OS 发行版提供的 Qt:

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