Why do apps built with PySide6 have a more cramped menu bar than native KDE apps?
-
Screenshotted on the left is the menu bar from Kcalc from Plasma and the right is an app I built using PySide6 without modifying any style.
Why does the left menu bar look more spacious? Is it because there's a toolbar? Thank you so much.
-
Hi,
How did you install PySide6 ?
Which version of KDE are you using ?
Which Linux distribution ? -
@SGaist Sorry for the late response somehow completely missed the reply.
I installed PySide6 through pip. Version:
plasmashell 6.3.4
Fedora KDE spin 42. Thank you!
-
Can you start your application with the QT_DEBUG_PLUGINS environment variable set to one and do the same with kcalc ?
This should show which plugins are loaded and there might be some difference. Kcalc might also be using a KDE specific style. -
@SGaist Thanks for the tip.
Running my own app (with Python) I get results at https://pastebin.com/gAC4kryb -- note I just import from PySide6 without explicit code to use any plugins.
Running kcalc I get https://pastebin.com/5VNhtAL2
Any idea what's going on here? Thanks!
-
Qt uses a set of plugins to do its work (visual interface, database, image, etc).
It seems you have forgotten to set the variable for kcalc. -
@SGaist No I have set it and somehow it does not give me any plugin info. Any other tips? I simply run
kcalc
from terminal... -
@SGaist I want to report some progress. Seems like it's not finding the Breeze style plugin. I'm using pyside6 by pip -- tried system package from fedora which unfortunately for fedora 42 (latest version kde spin) python3-pyside5 seems broken... it seesm that the pip version of pyside6 bundles Qt which doesn't have the plugin also the logs show that it's searching a place that is like /usr/lib or something but doesn't have the plugins. any ideas? thanks.
-
Typo: python3-pyside6 in the last message instead of pyside5, I'm not sure if it's actually broken, even with a simple app (import and print the plugin search paths) I see error on Python initialization.
-
PySide (whether 2 or 6) was always bundled Qt otherwise it means that the package would not be functional on systems without Qt installed beforehand.
Which version of Qt do you have on your system ?
-
@SGaist I've figured it out myself, sorry for distrubing you. Basically I need to install the PySide6 from system dnf instead of pip. It did not work because I didn't completely uninstall from Python -- I only uninstalled PySide6 not the -addons and -essentials stuff or shiboken. After uninstalling all these components and installing from dnf it works correctly. Thanks!
-
-
OK, I'm not sure why but after rebooting my VM after installing python3-PySide6 from dnf somehow it blackscreen so I had to update all packages by hooking into a serial device on UTM and then it'd work... why?
-
I have read somewhere that Qt installed through pip is independent from the Qt installed through your system packages. Duplicate libs+plugins+styles etc ... so your program built against the pip installed Qt won't have access to the Qt installed by your distro vendor.
-
@dextermagnific Yes, I have realized that, but installing python3-pyside6 through dnf in fedora kde spin seem to cause it to not boot, and I'd have to update all packages from a hooked up tty for it to boot.
I'm going to make a reproducer with this issue when I'm less busy and probably talk on the fedora forums to see what they've got to say about this.