Menus from QMainWindow MenuBar not showing on Qt 6.4.0
-
@davethomaspilot So, I remember from decades ago trying to manage multiple sets of libraries gets tricky... Another thing I don't understand---
When I do ldd on my application on the rpi, I get full qualified .so names frm /usr/local/qt6/lib. What's the mechanism that changed the .so file names from the /home/davethomaspilot/qt-raspi location to /usr/local/qt6/lib?
Or, maybe I give up on trying to understand "the magic".
What do I need to change on the build machine so my application links against the libraries from the RPI repo?
@davethomaspilot Apparently, ldd retuns fully qualified library names even when they are found using LD_LIBRARY_PATH.
So, I was able to install qt6 on the rpi from the repo, then set LD_LIBRARY_PATH to /usr/lib/aarch64-linux-gnu. I then see this:
pi@lighttree:~/LightTree $ ldd LightTree linux-vdso.so.1 (0x0000007f8ce2d000) libpigpio.so.1 => /lib/libpigpio.so.1 (0x0000007f8c9e0000) libQt6OpenGL.so.6 => /usr/lib/aarch64-linux-gnu/libQt6OpenGL.so.6 (0x0000007f8c920000) libQt6PrintSupport.so.6 => /usr/lib/aarch64-linux-gnu/libQt6PrintSupport.so.6 (0x0000007f8c880000) libQt6Widgets.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Widgets.so.6 (0x0000007f8c150000) libQt6Gui.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Gui.so.6 (0x0000007f8ba50000) libQt6Xml.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Xml.so.6 (0x0000007f8ba00000) libQt6Sql.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Sql.so.6 (0x0000007f8b990000) libQt6Core.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Core.so.6 (0x0000007f8b4a0000) libGLESv2.so.2 => /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 (0x0000007f8b450000) libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f8b230000) libm.so.6 => /usr/lib/aarch64-linux-gnu/libm.so.6 (0x0000007f8b190000) libgcc_s.so.1 => /usr/lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f8b150000) libc.so.6 => /usr/lib/aarch64-linux-gnu/libc.so.6 (0x0000007f8afa0000) /lib/ld-linux-aarch64.so.1 (0x0000007f8cdf0000) libOpenGL.so.0 => /usr/lib/aarch64-linux-gnu/libOpenGL.so.0 (0x0000007f8af20000) libEGL.so.1 => /usr/lib/aarch64-linux-gnu/libEGL.so.1 (0x0000007f8aee0000) libfontconfig.so.1 => /usr/lib/aarch64-linux-gnu/libfontconfig.so.1 (0x0000007f8ae70000) libX11.so.6 => /usr/lib/aarch64-linux-gnu/libX11.so.6 (0x0000007f8ad10000) libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007f8abb0000) libQt6DBus.so.6 => /usr/lib/aarch64-linux-gnu/libQt6DBus.so.6 (0x0000007f8aae0000) libxkbcommon.so.0 => /usr/lib/aarch64-linux-gnu/libxkbcommon.so.0 (0x0000007f8aa70000) libGLX.so.0 => /usr/lib/aarch64-linux-gnu/libGLX.so.0 (0x0000007f8aa10000) libpng16.so.16 => /usr/lib/aarch64-linux-gnu/libpng16.so.16 (0x0000007f8a9b0000) libharfbuzz.so.0 => /usr/lib/aarch64-linux-gnu/libharfbuzz.so.0 (0x0000007f8a890000) libmd4c.so.0 => /usr/lib/aarch64-linux-gnu/libmd4c.so.0 (0x0000007f8a870000) libfreetype.so.6 => /usr/lib/aarch64-linux-gnu/libfreetype.so.6 (0x0000007f8a790000) libz.so.1 => /usr/lib/aarch64-linux-gnu/libz.so.1 (0x0000007f8a750000) libicui18n.so.72 => /usr/lib/aarch64-linux-gnu/libicui18n.so.72 (0x0000007f8a410000) libicuuc.so.72 => /usr/lib/aarch64-linux-gnu/libicuuc.so.72 (0x0000007f8a1f0000) libdouble-conversion.so.3 => /usr/lib/aarch64-linux-gnu/libdouble-conversion.so.3 (0x0000007f8a1b0000) libb2.so.1 => /usr/lib/aarch64-linux-gnu/libb2.so.1 (0x0000007f8a190000) libpcre2-16.so.0 => /usr/lib/aarch64-linux-gnu/libpcre2-16.so.0 (0x0000007f8a0f0000) libzstd.so.1 => /usr/lib/aarch64-linux-gnu/libzstd.so.1 (0x0000007f8a030000) libGLdispatch.so.0 => /usr/lib/aarch64-linux-gnu/libGLdispatch.so.0 (0x0000007f89ea0000) libexpat.so.1 => /usr/lib/aarch64-linux-gnu/libexpat.so.1 (0x0000007f89e50000) libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000007f89e00000) libpcre2-8.so.0 => /usr/lib/aarch64-linux-gnu/libpcre2-8.so.0 (0x0000007f89d50000) libdbus-1.so.3 => /usr/lib/aarch64-linux-gnu/libdbus-1.so.3 (0x0000007f89cd0000) libgraphite2.so.3 => /usr/lib/aarch64-linux-gnu/libgraphite2.so.3 (0x0000007f89c90000) libbrotlidec.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlidec.so.1 (0x0000007f89c60000) libicudata.so.72 => /usr/lib/aarch64-linux-gnu/libicudata.so.72 (0x0000007f87e70000) libgomp.so.1 => /usr/lib/aarch64-linux-gnu/libgomp.so.1 (0x0000007f87e00000) libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000007f87de0000) libXdmcp.so.6 => /usr/lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000007f87dc0000) libsystemd.so.0 => /usr/lib/aarch64-linux-gnu/libsystemd.so.0 (0x0000007f87cd0000) libbrotlicommon.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlicommon.so.1 (0x0000007f87c90000) libbsd.so.0 => /usr/lib/aarch64-linux-gnu/libbsd.so.0 (0x0000007f87c50000) libcap.so.2 => /usr/lib/aarch64-linux-gnu/libcap.so.2 (0x0000007f87c20000 ```) Which is what I want to see! But, I still have the same issue--menus from the QMainWindow menubar don't display. So, if it's a problem with Qt6 on bookworm 64 bit, the problem is in the repo libraries too. Any suggestions on how to proceed would be appreciated!!
-
@davethomaspilot Apparently, ldd retuns fully qualified library names even when they are found using LD_LIBRARY_PATH.
So, I was able to install qt6 on the rpi from the repo, then set LD_LIBRARY_PATH to /usr/lib/aarch64-linux-gnu. I then see this:
pi@lighttree:~/LightTree $ ldd LightTree linux-vdso.so.1 (0x0000007f8ce2d000) libpigpio.so.1 => /lib/libpigpio.so.1 (0x0000007f8c9e0000) libQt6OpenGL.so.6 => /usr/lib/aarch64-linux-gnu/libQt6OpenGL.so.6 (0x0000007f8c920000) libQt6PrintSupport.so.6 => /usr/lib/aarch64-linux-gnu/libQt6PrintSupport.so.6 (0x0000007f8c880000) libQt6Widgets.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Widgets.so.6 (0x0000007f8c150000) libQt6Gui.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Gui.so.6 (0x0000007f8ba50000) libQt6Xml.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Xml.so.6 (0x0000007f8ba00000) libQt6Sql.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Sql.so.6 (0x0000007f8b990000) libQt6Core.so.6 => /usr/lib/aarch64-linux-gnu/libQt6Core.so.6 (0x0000007f8b4a0000) libGLESv2.so.2 => /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 (0x0000007f8b450000) libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f8b230000) libm.so.6 => /usr/lib/aarch64-linux-gnu/libm.so.6 (0x0000007f8b190000) libgcc_s.so.1 => /usr/lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f8b150000) libc.so.6 => /usr/lib/aarch64-linux-gnu/libc.so.6 (0x0000007f8afa0000) /lib/ld-linux-aarch64.so.1 (0x0000007f8cdf0000) libOpenGL.so.0 => /usr/lib/aarch64-linux-gnu/libOpenGL.so.0 (0x0000007f8af20000) libEGL.so.1 => /usr/lib/aarch64-linux-gnu/libEGL.so.1 (0x0000007f8aee0000) libfontconfig.so.1 => /usr/lib/aarch64-linux-gnu/libfontconfig.so.1 (0x0000007f8ae70000) libX11.so.6 => /usr/lib/aarch64-linux-gnu/libX11.so.6 (0x0000007f8ad10000) libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007f8abb0000) libQt6DBus.so.6 => /usr/lib/aarch64-linux-gnu/libQt6DBus.so.6 (0x0000007f8aae0000) libxkbcommon.so.0 => /usr/lib/aarch64-linux-gnu/libxkbcommon.so.0 (0x0000007f8aa70000) libGLX.so.0 => /usr/lib/aarch64-linux-gnu/libGLX.so.0 (0x0000007f8aa10000) libpng16.so.16 => /usr/lib/aarch64-linux-gnu/libpng16.so.16 (0x0000007f8a9b0000) libharfbuzz.so.0 => /usr/lib/aarch64-linux-gnu/libharfbuzz.so.0 (0x0000007f8a890000) libmd4c.so.0 => /usr/lib/aarch64-linux-gnu/libmd4c.so.0 (0x0000007f8a870000) libfreetype.so.6 => /usr/lib/aarch64-linux-gnu/libfreetype.so.6 (0x0000007f8a790000) libz.so.1 => /usr/lib/aarch64-linux-gnu/libz.so.1 (0x0000007f8a750000) libicui18n.so.72 => /usr/lib/aarch64-linux-gnu/libicui18n.so.72 (0x0000007f8a410000) libicuuc.so.72 => /usr/lib/aarch64-linux-gnu/libicuuc.so.72 (0x0000007f8a1f0000) libdouble-conversion.so.3 => /usr/lib/aarch64-linux-gnu/libdouble-conversion.so.3 (0x0000007f8a1b0000) libb2.so.1 => /usr/lib/aarch64-linux-gnu/libb2.so.1 (0x0000007f8a190000) libpcre2-16.so.0 => /usr/lib/aarch64-linux-gnu/libpcre2-16.so.0 (0x0000007f8a0f0000) libzstd.so.1 => /usr/lib/aarch64-linux-gnu/libzstd.so.1 (0x0000007f8a030000) libGLdispatch.so.0 => /usr/lib/aarch64-linux-gnu/libGLdispatch.so.0 (0x0000007f89ea0000) libexpat.so.1 => /usr/lib/aarch64-linux-gnu/libexpat.so.1 (0x0000007f89e50000) libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000007f89e00000) libpcre2-8.so.0 => /usr/lib/aarch64-linux-gnu/libpcre2-8.so.0 (0x0000007f89d50000) libdbus-1.so.3 => /usr/lib/aarch64-linux-gnu/libdbus-1.so.3 (0x0000007f89cd0000) libgraphite2.so.3 => /usr/lib/aarch64-linux-gnu/libgraphite2.so.3 (0x0000007f89c90000) libbrotlidec.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlidec.so.1 (0x0000007f89c60000) libicudata.so.72 => /usr/lib/aarch64-linux-gnu/libicudata.so.72 (0x0000007f87e70000) libgomp.so.1 => /usr/lib/aarch64-linux-gnu/libgomp.so.1 (0x0000007f87e00000) libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000007f87de0000) libXdmcp.so.6 => /usr/lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000007f87dc0000) libsystemd.so.0 => /usr/lib/aarch64-linux-gnu/libsystemd.so.0 (0x0000007f87cd0000) libbrotlicommon.so.1 => /usr/lib/aarch64-linux-gnu/libbrotlicommon.so.1 (0x0000007f87c90000) libbsd.so.0 => /usr/lib/aarch64-linux-gnu/libbsd.so.0 (0x0000007f87c50000) libcap.so.2 => /usr/lib/aarch64-linux-gnu/libcap.so.2 (0x0000007f87c20000 ```) Which is what I want to see! But, I still have the same issue--menus from the QMainWindow menubar don't display. So, if it's a problem with Qt6 on bookworm 64 bit, the problem is in the repo libraries too. Any suggestions on how to proceed would be appreciated!!
Beside having Xorg running, do you have a window manager as well ? If so which one is it ?
-
@SGaist LXDE
-
@SGaist LXDE
@davethomaspilot I started down the path of trying to compile my application on the RPI.
I ran out of file space when installing qtcreator. So, I deleted browsers to free up enough space to be able to clone reliably, and cloned to a 64G SD card (versus the 8 GB I was using).
Then I successfully installed qt creator.
I was struggling with configuring qtcreator to just compile a simple "hello world" QMainWindow example so blew it off for the day yesterday.
Today I started by just trying my app again. It now works fine!
Turns out after installing qtcreator, my app now runs fine!
Specifically, the menus display correctly when clicking on the menubar, and tool tips display as expected.
I made no changes to the app and I'd already set up LD_LIBRARY_PATH to use the qt libs from the 64 bit bookworm repo.
All I can figure is that I got some different version of a qt dependency when installing qtcreator and that fixed my issue.
It would be nice to understand better, but I've already spent way too much time. Since I'm now working ok, I'm moving on!
-
@davethomaspilot I started down the path of trying to compile my application on the RPI.
I ran out of file space when installing qtcreator. So, I deleted browsers to free up enough space to be able to clone reliably, and cloned to a 64G SD card (versus the 8 GB I was using).
Then I successfully installed qt creator.
I was struggling with configuring qtcreator to just compile a simple "hello world" QMainWindow example so blew it off for the day yesterday.
Today I started by just trying my app again. It now works fine!
Turns out after installing qtcreator, my app now runs fine!
Specifically, the menus display correctly when clicking on the menubar, and tool tips display as expected.
I made no changes to the app and I'd already set up LD_LIBRARY_PATH to use the qt libs from the 64 bit bookworm repo.
All I can figure is that I got some different version of a qt dependency when installing qtcreator and that fixed my issue.
It would be nice to understand better, but I've already spent way too much time. Since I'm now working ok, I'm moving on!
@davethomaspilot If you just want to build on RPi you don't need QtCreator. Just install needed Qt packages and use qmake or cmake to configure and build.
-
@davethomaspilot I started down the path of trying to compile my application on the RPI.
I ran out of file space when installing qtcreator. So, I deleted browsers to free up enough space to be able to clone reliably, and cloned to a 64G SD card (versus the 8 GB I was using).
Then I successfully installed qt creator.
I was struggling with configuring qtcreator to just compile a simple "hello world" QMainWindow example so blew it off for the day yesterday.
Today I started by just trying my app again. It now works fine!
Turns out after installing qtcreator, my app now runs fine!
Specifically, the menus display correctly when clicking on the menubar, and tool tips display as expected.
I made no changes to the app and I'd already set up LD_LIBRARY_PATH to use the qt libs from the 64 bit bookworm repo.
All I can figure is that I got some different version of a qt dependency when installing qtcreator and that fixed my issue.
It would be nice to understand better, but I've already spent way too much time. Since I'm now working ok, I'm moving on!
@davethomaspilot Actually---
I'm running headless and using x11vnc.
Turns out when I have a display plugged into one of the RPI4 HDMI ports, the menus and tool tips work as expected. It's only when the rpi is booted with no display attached to I have the issue.
I recall a setting in /boot/config.txt that fixed some issue that could occur on a headless setup, but I it seems weird that an unconnected HDMI could cause an issue like I"m seeing. I bet there's a simple workaround though.
I'll do some more research, and if something similar isn't already known, I'll do another post that won't have all the other build stuff cluttering it.
-
@davethomaspilot If you just want to build on RPi you don't need QtCreator. Just install needed Qt packages and use qmake or cmake to configure and build.
@jsulm Thanks--
Compiling on the rpi was just to figure out what's going on. Now that I see the issue only occurs when a display is not plugged into the rpi, I think it's unrelated to the Qt6 libraries used or whether it was cross-compiled or built locally.
100% repeatable--every time I get the strange behavior if a display is not plugged into the HDMI port. Works perfectly if a display is plugged in.
I know it is not impacted by this line in /boot/config.txt:
Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
That is, I have same symptom if I boot without that line in config.txt.
-
@jsulm Thanks--
Compiling on the rpi was just to figure out what's going on. Now that I see the issue only occurs when a display is not plugged into the rpi, I think it's unrelated to the Qt6 libraries used or whether it was cross-compiled or built locally.
100% repeatable--every time I get the strange behavior if a display is not plugged into the HDMI port. Works perfectly if a display is plugged in.
I know it is not impacted by this line in /boot/config.txt:
Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
That is, I have same symptom if I boot without that line in config.txt.
@davethomaspilot QtCreator installed from the repo has the same issue---
I was going to build a trivial example but I found QtCreator installed from the repo has the same issue.
If I boot without a display connected, menus don't display when I click on File, Edit, View ... on the qtcreator menubar.
Everything works fine if a display is connected.
Can someone see if they see the same?
RPI4, bookworm 64 bit.
(Both cases using a vnc session).
So, this really seems like a bug--not sure if it's a Qt bug or something in bookworm. Advice on where to post?
-
@davethomaspilot QtCreator installed from the repo has the same issue---
I was going to build a trivial example but I found QtCreator installed from the repo has the same issue.
If I boot without a display connected, menus don't display when I click on File, Edit, View ... on the qtcreator menubar.
Everything works fine if a display is connected.
Can someone see if they see the same?
RPI4, bookworm 64 bit.
(Both cases using a vnc session).
So, this really seems like a bug--not sure if it's a Qt bug or something in bookworm. Advice on where to post?
@davethomaspilot lximage-qt works fine with nothing plugged into the HDMI port.
But, it's build with qt5 libraries.
ldd /usr/bin/lximage-qt linux-vdso.so.1 (0x0000007fa4c7e000) libfm-qt.so.12 => /lib/aarch64-linux-gnu/libfm-qt.so.12 (0x0000007fa4a20000) libQt5Network.so.5 => /lib/aarch64-linux-gnu/libQt5Network.so.5 (0x0000007fa4840000) libQt5DBus.so.5 => /lib/aarch64-linux-gnu/libQt5DBus.so.5 (0x0000007fa4780000) libQt5PrintSupport.so.5 => /lib/aarch64-linux-gnu/libQt5PrintSupport.so.5 (0x0000007fa46e0000) libQt5X11Extras.so.5 => /lib/aarch64-linux-gnu/libQt5X11Extras.so.5 (0x0000007fa46b0000) libQt5Svg.so.5 => /lib/aarch64-linux-gnu/libQt5Svg.so.5 (0x0000007fa4630000)
-
@davethomaspilot lximage-qt works fine with nothing plugged into the HDMI port.
But, it's build with qt5 libraries.
ldd /usr/bin/lximage-qt linux-vdso.so.1 (0x0000007fa4c7e000) libfm-qt.so.12 => /lib/aarch64-linux-gnu/libfm-qt.so.12 (0x0000007fa4a20000) libQt5Network.so.5 => /lib/aarch64-linux-gnu/libQt5Network.so.5 (0x0000007fa4840000) libQt5DBus.so.5 => /lib/aarch64-linux-gnu/libQt5DBus.so.5 (0x0000007fa4780000) libQt5PrintSupport.so.5 => /lib/aarch64-linux-gnu/libQt5PrintSupport.so.5 (0x0000007fa46e0000) libQt5X11Extras.so.5 => /lib/aarch64-linux-gnu/libQt5X11Extras.so.5 (0x0000007fa46b0000) libQt5Svg.so.5 => /lib/aarch64-linux-gnu/libQt5Svg.so.5 (0x0000007fa4630000)
@davethomaspilot I created a new bookworm, 64 bit image for RPI4 using the raspberry pi imager.
Yes, same behavior using fresh bookworm 64 bit from the Raspberry Pi imager.
Used raspi-config to choose X11, installed x11vnc, and qtcreator
qtcreator works fine if something is plugged into the HDMI connector (even when using vnc connection). When booted with nothing plugged into the HDMI connector, the menus (and tool tips) fail to display from the qtcreator menubar.
Same symptoms I first saw in my application and was blaming on something I had done wrong in the qt build process.
Now, just using the repo QT6 libs, I see same issue in qtcreator
I think there must be an issue in a Qt 6.4.2 .so.
I'll create a new post since this one has gotten so long nobody will read it.
Hopefully there's a work-around hdmi_force_hotplug=1 does not help.
Maybe later versions don't have this issue? Is there a way to try that without building Qt from source?
-
@davethomaspilot I created a new bookworm, 64 bit image for RPI4 using the raspberry pi imager.
Yes, same behavior using fresh bookworm 64 bit from the Raspberry Pi imager.
Used raspi-config to choose X11, installed x11vnc, and qtcreator
qtcreator works fine if something is plugged into the HDMI connector (even when using vnc connection). When booted with nothing plugged into the HDMI connector, the menus (and tool tips) fail to display from the qtcreator menubar.
Same symptoms I first saw in my application and was blaming on something I had done wrong in the qt build process.
Now, just using the repo QT6 libs, I see same issue in qtcreator
I think there must be an issue in a Qt 6.4.2 .so.
I'll create a new post since this one has gotten so long nobody will read it.
Hopefully there's a work-around hdmi_force_hotplug=1 does not help.
Maybe later versions don't have this issue? Is there a way to try that without building Qt from source?
@davethomaspilot I found a post that said the latest version of bookworm doesn't use config.txt, at least not for hdmi_force_hotplug . It suggested using cmdline.txt instead and using:
[code]video=HDMI-A-1:1920x1080M@60D[/code]
at the beginning of the cmdline.txt line.
This fixes the issue!
Apparently, without this change (regardless of what's in config.txt), display resolution is something that's incompatible with qt6 Qmenubar (and tool tips). The display looks very small--I think that means higher resolution that what I normally use (1920x1080).
Anyway, now that I have a workaround, I'm "outta here". But, this will probably will catch others that have depended on config.txt for headless operation.