Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT GUI app appears only on connected display to RPI
Forum Update on Monday, May 27th 2025

QT GUI app appears only on connected display to RPI

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 253 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andeksan
    wrote on 22 Jul 2020, 10:21 last edited by
    #1

    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/qt5

    make -j3
    make install

    Addition 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.

    P 1 Reply Last reply 22 Jul 2020, 15:01
    0
    • A Andeksan
      22 Jul 2020, 10:21

      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/qt5

      make -j3
      make install

      Addition 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.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 22 Jul 2020, 15:01 last edited by
      #2

      @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)

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply 23 Jul 2020, 13:44
      1
      • P Pablo J. Rogina
        22 Jul 2020, 15:01

        @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)

        A Offline
        A Offline
        Andeksan
        wrote on 23 Jul 2020, 13:44 last edited by
        #3

        @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

        P 1 Reply Last reply 23 Jul 2020, 15:02
        0
        • A Andeksan
          23 Jul 2020, 13:44

          @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

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 23 Jul 2020, 15:02 last edited by Pablo J. Rogina
          #4

          @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...

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          A 1 Reply Last reply 24 Jul 2020, 08:21
          0
          • P Pablo J. Rogina
            23 Jul 2020, 15:02

            @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...

            A Offline
            A Offline
            Andeksan
            wrote on 24 Jul 2020, 08:21 last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Andeksan
              wrote on 24 Jul 2020, 08:42 last edited by Andeksan
              #6

              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 Reply Last reply
              0

              1/6

              22 Jul 2020, 10:21

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved