Qt GUI application in docker container

I am trying to run some Qt application in container docker with mount /tmp/.X11-unix. I saw here that can be difficult.

Therefore, when I run kdevelop in the docker of the container, it does not work (I have an empty window). But if I run qtcreator, that's fine.

I think the difference comes from the Qt version (kdevelop is developing in Qt4 and qtcreator in Qt5). All other qt5 applications work fine, but not one in qt4.

Question:

Does anyone know what to do to run a qt4 application without going through vnc or ssh like this:

docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix someQt4AppContainer 

?

+5
source share
1 answer

Qt5 and Qt4 have different rendering subsystems

The Qt4 renderer just needs a hint:

 export QT_GRAPHICSSYSTEM="native" 

It must be work

 QT_GRAPHICSSYSTEM="native" docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix someQt4AppContainer 
+5
source

Source: https://habr.com/ru/post/1241621/


All Articles