Got VNC platform plugin working on Qt 5
-
Hello,
I took the old VNC plugin code from Qt 4.x and massaged it into a Qt 5 platform plugin. You can
export QT_QPA_PLATFORM=vnc
, have your Qt desktop application run headless, and connect to it using a VNC client.The code is here. It runs on Mac OS Mountain Lion, should work on Linux. Just got it working, so it's not tested very much.
Thinking of adding websocket support, which will let you connect to "headless" Qt apps using a browser-based VNC viewer.
Feedback welcome.
Ganesh
-
Hi and welcome to devnet,
What about contributing that QPA to the Qt project ? That way everybody using Qt would easily have access to it
-
That's great to have a QPA VNC plugin support.
I've just built your plugin on my i.MX6 based platform over Qt5.5.0 and test it but unfortunately running failedVNC Websockets
# /usr/lib/qt/examples/qpa/windows/windows -platform "vnc:size=800x600:addr=0.0.0.0:mode=websocket" QVNCServer created on "0.0.0.0" port 5900 mode websocket QVNCServer: no password configured! Client protocol version RFB 003.003 Want format: 32 24 0 1 8 8 8 16 8 0 QVNCServer::setEncodings: 1 QVNCServer::setEncodings: 7 QVNCServer::setEncodings: -260 QVNCServer::setEncodings: 5 QVNCServer::setEncodings: using hextile QVNCServer::setEncodings: 2 QVNCServer::setEncodings: 0 QVNCServer::setEncodings: -223 QVNCServer::setEncodings: -239 QVNCServer::setEncodings: -26 QVNCServer::setEncodings: -247 QVNCServer::setEncodings: -224 QVNCServer::setEncodings: -309 QVNCServer::setEncodings: -308 Segmentation fault
VNC RAW
# /usr/lib/qt/examples/qpa/windows/windows -platform "vnc:size=800x600:addr=0.0.role = 1 tID = 00.0:mode=raw" QVNCServer created on "0.0.0.0" port 5900 mode raw QVNCServer: no password configured! Client protocol version RFB 003.003 Want format: 8 8 0 1 3 3 2 0 3 6 QVNCServer::setEncodings: 7 QVNCServer::setEncodings: 16 QVNCServer::setEncodings: 9 QVNCServer::setEncodings: -65527 QVNCServer::setEncodings: 1 QVNCServer::setEncodings: 5 QVNCServer::setEncodings: using hextile QVNCServer::setEncodings: 6 QVNCServer::setEncodings: 4 QVNCServer::setEncodings: 2 QVNCServer::setEncodings: 0 QVNCServer::setEncodings: -247 QVNCServer::setEncodings: -32 QVNCServer::setEncodings: -240 QVNCServer::setEncodings: -239 QVNCServer::setEncodings: -232 QVNCServer::setEncodings: -131072 QVNCServer::setEncodings: -223 QVNCServer::setEncodings: -224 QVNCServer::setEncodings: -131071 QVNCServer::setEncodings: -131070 QVNCServer::setEncodings: -131069 Segmentation fault
-
Thats absolutely very good news, that we have vnc plugin for QT5.
Although examples work fine as intended, When I configure and build my Qt Application with this source code, it gives error as:-
"This plugin does not support createPlatformOpenGLContext!
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile 0) "System Details are as below:-
OS: Ubuntu 14.04 LTS 32-bit
Compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
mkspecs :- linux-g++when checked the configure output it reads as :-
opengl-desktop
vnc-yes
egl-yesand even the libgles1-mesa and libgles1-mesa-dev are also installed.
please suggest what could have been the problem. -
-
@Julien-C said in Got VNC platform plugin working on Qt 5:
Hi ganesh,
Do you plan to bump your version of websocket based VNC on top of official Qt VNC plugin? It would be great because it's a great feature to get rid of any specific software to access embedded screenless device.
+++
And the README also states that
display=<num> VNC display number. Server listens to port 5900 + <num> Default: display=0
That's a very useful feature on hosts that also run a VNC server (e.g. any Mac with screen sharing turned on) and thus already have port 5900 in use. Or simply if you want to be able to run multiple applications over VNC.