Why Run QT Widget Application on Raspberry Pi close/minimize button doesn't show and can't adjust window size



  • I run the QT Widget with the kits of the desktop and there is a close / minimize / button and the window size can be adjusted.
    But when it run on the raspberry pi (i cross compile qt for raspberry pi) close / minimize button doesn't show and cover the entire screen.why this happens? and how can fix this?


  • Lifetime Qt Champion

    Hi,

    What backend are you using on the Pi ? Eglfs ? If so then it’s normal, there’s no windowing system with that one. If you need one either use wayland or Xorg.



  • I use raspberrypi2eglfs to cross compile QT for pi
    For use wayland or xorg I should cross compile again?how can use wayland or xrog


  • Moderators

    @isan said in Why Run QT Widget Application on Raspberry Pi close/minimize button doesn't show and can't adjust window size:

    For use wayland or xorg I should cross compile again?how can use wayland or xrog

    Check if you have the plugins in QTDIR/plugins/platforms. If yes, then there is no need to (re)compile.

    All you need to do to run it under X11, for example, is to boot into X11 GUI (like the default Raspbian system) and run your app like this:

    ./yourApp -platform xcb
    


  • @sierdzio I have libqxcb.so on my Ubuntu on QTDIR / qt5pi / plugins / platforms.
    And in Raspi I do not have it
    So I copied it to raspi
    And the permision is rw-r-r--
    I run the program with ./program -platform xcb
    And I'm getting this error: what should I do?

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    
    Reinstalling the application may fix this problem.
    Aborted
    

  • Moderators

    Hm, platform plugin is available but Qt cannot load it. Try setting QT_PLUGIN_PATH on your Pi. Also, maybe setting LD_LIBRARY_PATH would help but I doubt it.

    Lastly, run ldd on libqxcb.so on your raspberry to see which dependencies are missing.

    Also, make sure the libqxcb.so is really compiled for your Pi, and not for your host PC. readelf could probably help here.



  • @sierdzio I re-rsync /raspi/qt5pi/plugins/platforms to raspi/qt5pi/plugins/
    and now when run with this command

    ./yourApp -platform xcb
    

    I get this error:

    QXcbConnection: Could not connect to display 
    Aborted
    

    what should I do now?


  • Moderators

    Do you have an active X11 session (are you logged into GUI on your raspberry pi) when you run that command?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.