QT GUI app appears only on connected display to RPI
-
wrote on 22 Jul 2020, 10:21 last edited by
Hi all, i have strange behavior for an app which is running on my raspberry PI(debian 8) with locally compiled QT framework(5.3.2). Mostly I work with RPI remotely via startlxde and when i compile any application with my locally compiled QT, The app appears always on connected monitor to RPI. However when i compile the same project with qt(5.3.2 installed from debian repository) it appears on my remote machine(as i expect). I have checked a system enviroments between QTs for the same project and all they are equal. Since libs almost the same, app should behaves similar. But in my case it is not. So the whole situation leads me to one places that something wrong i did with compilation of my QT.
What i did to compile:
./configure -v -opengl es2 -tslib -force-pkg-config -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5make -j3
make installAddition to the this issue some projects can not be compiled because
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE = <path>May be someone has ideas how to fix it.
-
Hi all, i have strange behavior for an app which is running on my raspberry PI(debian 8) with locally compiled QT framework(5.3.2). Mostly I work with RPI remotely via startlxde and when i compile any application with my locally compiled QT, The app appears always on connected monitor to RPI. However when i compile the same project with qt(5.3.2 installed from debian repository) it appears on my remote machine(as i expect). I have checked a system enviroments between QTs for the same project and all they are equal. Since libs almost the same, app should behaves similar. But in my case it is not. So the whole situation leads me to one places that something wrong i did with compilation of my QT.
What i did to compile:
./configure -v -opengl es2 -tslib -force-pkg-config -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5make -j3
make installAddition to the this issue some projects can not be compiled because
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE = <path>May be someone has ideas how to fix it.
wrote on 22 Jul 2020, 15:01 last edited by@Andeksan said in QT GUI app appears only on connected display to RPI:
, The app appears always on connected monitor to RPI.
Could you please show the command to run your Qt app on the RPi?
My bet is that your cross-compile Qt version is missing support for the xcb plugin (so you cannot X forward the display from RPi device to host)
-
@Andeksan said in QT GUI app appears only on connected display to RPI:
, The app appears always on connected monitor to RPI.
Could you please show the command to run your Qt app on the RPi?
My bet is that your cross-compile Qt version is missing support for the xcb plugin (so you cannot X forward the display from RPi device to host)
wrote on 23 Jul 2020, 13:44 last edited by@Pablo-J-Rogina said in QT GUI app appears only on connected display to RPI:
y bet is that your cross-compile Qt version is missing sup
well.. nothing special without any arguments
root@root: ./theApp -
@Pablo-J-Rogina said in QT GUI app appears only on connected display to RPI:
y bet is that your cross-compile Qt version is missing sup
well.. nothing special without any arguments
root@root: ./theAppwrote on 23 Jul 2020, 15:02 last edited by Pablo J. Rogina@Andeksan said in QT GUI app appears only on connected display to RPI:
root@root: ./theApp
could you please try running your cross-compiled Qt app like this:
$ ./theApp -platform xcb
assuming you access the RPi device with X forwarding enable (i.e. ssh -X user@rpi)
In addition, you are not having both Qt versions (the one from Debian and the one cross-compiled by you) installed at the same time in your device, right?
BTW, using root user directly is not a good security practice...
-
@Andeksan said in QT GUI app appears only on connected display to RPI:
root@root: ./theApp
could you please try running your cross-compiled Qt app like this:
$ ./theApp -platform xcb
assuming you access the RPi device with X forwarding enable (i.e. ssh -X user@rpi)
In addition, you are not having both Qt versions (the one from Debian and the one cross-compiled by you) installed at the same time in your device, right?
BTW, using root user directly is not a good security practice...
wrote on 24 Jul 2020, 08:21 last edited by@Pablo-J-Rogina
BIG thanks for advice. now it works.)
I have both Qt(from debian(5.3.2) and my cross-compiled (5.3.2)) on the device.That is a simple solution and can be valid. But how to force QT framework to do it automatically - pick up correct platform? Like does the qt libs from debian.
-
wrote on 24 Jul 2020, 08:42 last edited by Andeksan
Since my app uses eglfs platform by default. it is mean my qt libs some where uses this platform by default. So i need recompile it with a specific flag. I thing, i found it in qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf(QT_QPA_DEFAULT_PLATFORM = eglfs). If I change it on xcb will it solve my situation? Or exist more right way via configuration arguments. I am asking because it takes the whole day to recompile Qt source(.
qmake.conf# # qmake configuration for Broadcom's Raspberry PI # http://wiki.qt-project.org/Devices/RaspberryPi include(../common/linux_device_pre.conf) QT_QPA_DEFAULT_PLATFORM = wayland QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2 QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/opt/vc/include \ $$[QT_SYSROOT]/opt/vc/include/interface/vcos/vcos \ $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \ $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include $$[QT_SYSROOT]/opt/vc/include/interface/vcos/vcos $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL} QMAKE_LIBS_EGL = -lEGL -lGLESv2 contains(DISTRO, squeeze) { #Debian Squeeze: Legacy everything QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL QT_QPA_DEFAULT_PLATFORM = eglfs } else:contains(DISTRO, arch) { #On principle: no wizardry required } else { #This is not strictly necessary DISTRO_OPTS += deb-multi-arch DISTRO_OPTS += hard-float } QMAKE_CFLAGS += \ -marm \ -mfpu=vfp \ -mtune=arm1176jzf-s \ -march=armv6zk \ -mabi=aapcs-linux QMAKE_CXXFLAGS = $$QMAKE_CFLAGS EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp EGLFS_PLATFORM_HOOKS_LIBS = -lbcm_host include(../common/linux_arm_device_post.conf) load(qt_config)
1/6