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. Why Run QT Widget Application on Raspberry Pi close/minimize button doesn't show and can't adjust window size
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
23 Posts 6 Posters 7.4k Views 3 Watching
  • 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.
  • I Offline
    I Offline
    isan
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • I Offline
        I Offline
        isan
        wrote on last edited by
        #3

        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

        sierdzioS 1 Reply Last reply
        0
        • I isan

          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

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @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
          

          (Z(:^

          1 Reply Last reply
          3
          • I Offline
            I Offline
            isan
            wrote on last edited by isan
            #5

            @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
            
            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              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.

              (Z(:^

              I 1 Reply Last reply
              2
              • sierdzioS sierdzio

                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.

                I Offline
                I Offline
                isan
                wrote on last edited by isan
                #7

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

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

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

                  (Z(:^

                  I 1 Reply Last reply
                  1
                  • sierdzioS sierdzio

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

                    I Offline
                    I Offline
                    isan
                    wrote on last edited by
                    #9

                    @sierdzioI plugged the raspberry into a lcd and run it with ./yourApp -platform Xcb
                    The program runs but does not make a difference(close / minimize button doesn't show and widget cover the entire screen)

                    I set the pushButton to close with this->close();
                    can set pushButton to minimize the widget?

                    mrjjM 1 Reply Last reply
                    0
                    • I isan

                      @sierdzioI plugged the raspberry into a lcd and run it with ./yourApp -platform Xcb
                      The program runs but does not make a difference(close / minimize button doesn't show and widget cover the entire screen)

                      I set the pushButton to close with this->close();
                      can set pushButton to minimize the widget?

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @isan
                      Hi

                      • the program runs but does not make a difference(close / minimize button doesn't show and widget cover the entire screen)

                      Sounds like you are running with no windows manager.
                      Qt do not draw the close button etc. Its the Os/windows manager.

                      Yes, you can also make button minimize the window. just like close there is a call for that.
                      http://doc.qt.io/qt-5/qwidget.html#showMinimized

                      I 1 Reply Last reply
                      2
                      • mrjjM mrjj

                        @isan
                        Hi

                        • the program runs but does not make a difference(close / minimize button doesn't show and widget cover the entire screen)

                        Sounds like you are running with no windows manager.
                        Qt do not draw the close button etc. Its the Os/windows manager.

                        Yes, you can also make button minimize the window. just like close there is a call for that.
                        http://doc.qt.io/qt-5/qwidget.html#showMinimized

                        I Offline
                        I Offline
                        isan
                        wrote on last edited by
                        #11

                        @mrjj I set pushButton and do this

                        connect(ui->pushButton,SIGNAL(clicked(bool)),this,SLOT(showMinimized()));
                        

                        but not work

                        mrjjM jsulmJ 2 Replies Last reply
                        0
                        • I isan

                          @mrjj I set pushButton and do this

                          connect(ui->pushButton,SIGNAL(clicked(bool)),this,SLOT(showMinimized()));
                          

                          but not work

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @isan
                          hi
                          try without the bool
                          connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(showMinimized()));
                          and check return value of connect.

                          1 Reply Last reply
                          0
                          • I isan

                            @mrjj I set pushButton and do this

                            connect(ui->pushButton,SIGNAL(clicked(bool)),this,SLOT(showMinimized()));
                            

                            but not work

                            jsulmJ Online
                            jsulmJ Online
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

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

                            showMinimized()

                            I'm not sure this will work without window manager. Do you use any window manager on your device?

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            I 1 Reply Last reply
                            2
                            • jsulmJ jsulm

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

                              showMinimized()

                              I'm not sure this will work without window manager. Do you use any window manager on your device?

                              I Offline
                              I Offline
                              isan
                              wrote on last edited by
                              #14

                              @jsulm I don’t know ,how can I found?

                              W 1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                Hi,

                                Are you running an Xorg server ?
                                What plugin is your application loading ?

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                1
                                • I isan

                                  @jsulm I don’t know ,how can I found?

                                  W Offline
                                  W Offline
                                  wrosecrans
                                  wrote on last edited by
                                  #16

                                  @isan When you aren't running the app, what does the system look like? Is it a normal GUi desktop with icons and windows? Or is it just a text mode command line interface?

                                  Step 1: Run a normal desktop with windows.

                                  Step 2: Make your app run nicely in that desktop.

                                  I 1 Reply Last reply
                                  2
                                  • W wrosecrans

                                    @isan When you aren't running the app, what does the system look like? Is it a normal GUi desktop with icons and windows? Or is it just a text mode command line interface?

                                    Step 1: Run a normal desktop with windows.

                                    Step 2: Make your app run nicely in that desktop.

                                    I Offline
                                    I Offline
                                    isan
                                    wrote on last edited by
                                    #17

                                    @wrosecrans this is gui on forms QT 0_1526359719104_1.png

                                    this is when run on ubuntu desktop
                                    0_1526359748580_2.png

                                    this is when run on raspberry

                                    0_1526361065826_3.jpg

                                    now what?

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • I isan

                                      @wrosecrans this is gui on forms QT 0_1526359719104_1.png

                                      this is when run on ubuntu desktop
                                      0_1526359748580_2.png

                                      this is when run on raspberry

                                      0_1526361065826_3.jpg

                                      now what?

                                      jsulmJ Online
                                      jsulmJ Online
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      @isan What did you install on your Raspberry?
                                      From the picture I would say you don't have any window manager.
                                      Raspbian usually installs Pixel desktop.

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      I 1 Reply Last reply
                                      2
                                      • jsulmJ jsulm

                                        @isan What did you install on your Raspberry?
                                        From the picture I would say you don't have any window manager.
                                        Raspbian usually installs Pixel desktop.

                                        I Offline
                                        I Offline
                                        isan
                                        wrote on last edited by isan
                                        #19

                                        @jsulm I did no install any window manager
                                        What is the way to find the window manager that is used?
                                        If raspi has pixel desktop can it be changed?
                                        What is the good window manager ?

                                        sierdzioS 1 Reply Last reply
                                        0
                                        • I isan

                                          @jsulm I did no install any window manager
                                          What is the way to find the window manager that is used?
                                          If raspi has pixel desktop can it be changed?
                                          What is the good window manager ?

                                          sierdzioS Offline
                                          sierdzioS Offline
                                          sierdzio
                                          Moderators
                                          wrote on last edited by
                                          #20

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

                                          @jsulm I don't know
                                          How to find out which window manager is being used?

                                          Just answer the questions @wrosecrans that will be enough to know if you're on X11 or without a windowing system.

                                          As @jsulm pointed out, most probably you do not have any window manager running, so the window bezel will just not be there (and no way to minimize/maximize because without window manager such methods do not make sense).

                                          To see if you have X11 installed, log into your raspberry pi and run this command:

                                          startx
                                          

                                          If as a result you get a nice OS GUI, then you have X11 installed and ready. To turn it on permanently, you can then run:

                                          sudo raspi-config
                                          

                                          And set it up to boot to GUI instead of command line.

                                          (Z(:^

                                          I 1 Reply Last reply
                                          3

                                          • Login

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