Solved Why Run QT Widget Application on Raspberry Pi close/minimize button doesn't show and can't adjust window size
-
Do you have an active X11 session (are you logged into GUI on your raspberry pi) when you run that command?
-
@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? -
@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 -
@mrjj I set pushButton and do this
connect(ui->pushButton,SIGNAL(clicked(bool)),this,SLOT(showMinimized()));
but not work
-
@isan
hi
try without the bool
connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(showMinimized()));
and check return value of connect. -
@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?
-
@jsulm I don’t know ,how can I found?
-
Hi,
Are you running an Xorg server ?
What plugin is your application loading ? -
@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.
-
@wrosecrans this is gui on forms QT
this is when run on ubuntu desktop
this is when run on raspberry
now what?
-
@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. -
@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 ? -
@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.
-
@sierdzio when run sudo startx
X.Org X Server 1.18.4 Release Date: 2016-07-19 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian Current Operating System: Linux pi 4.9.28-v7+ #998 SMP Mon May 15 16:55:39 BST 2 017 armv7l Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight= 480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 w c_otg.lpm_enable=0 console=tty3 root=PARTUUID=5229808c-02 rootfstype=ext4 elevat or=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-console s Build Date: 11 November 2016 11:59:59AM xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support) Current version of pixman: 0.33.3 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.1.log", Time: Tue May 15 19:19:36 2018 (==) Using system config directory "/usr/share/X11/xorg.conf.d" modprobe: FATAL: Module g2d_23 not found.
If as a result you get a nice OS GUI, then you have X11 installed and ready. To turn it
And it does not make a difference ,It shows OS GUI that I already saw
I run the program, it still does not have a window manager -
Check the platform plugin that is loaded on application start.
-
@isan said in Why Run QT Widget Application on Raspberry Pi close/minimize button doesn't show and can't adjust window size:
It shows OS GUI that I already saw
You could have mentioned that earlier...
OK so you have X11 running it seems. Looks like it is running on EGLFS plugin. Make sure you run it with
-platform xcb
like I mentioned earlier. Also, see which makespec does qmake pick up when compiling your project, it should be eitherlinux-rasp-pi3-g++
orlinux-rasp-pi3-vc4-g++
if you are using the vc4 GPU driver.