Qt6 QPropertyAnimation: "This plugin does not support setting window opacity"
-
I answered a question here at https://forum.qt.io/topic/158580/animation-in-pyqt5. It creates a
QPropertyAnimation
to alterwindowOpacity
. The code works fine under my old Qt5 under Ubuntu 22.04.I tried exactly the same under my new Qt6 on Ubuntu 24.04. Under both PyQt6 and PySide6 it runs but every time Qt tries to change the opacity during the animation I see error message:
This plugin does not support setting window opacity
and opacity is not changed.
The code does
QPropertyAnimation(window, bytes('windowOpacity', 'utf8'))
Although the code is Python I post in this General and Desktop forum as I presume it has nothing to do with Python/PyQt/PySide. If somebody really wants I could rewrite it in C++, but I'm thinking that is not necessary as the error comes from Qt6.
The only similar question I came across Googling is on this forum years ago: https://forum.qt.io/topic/65342/this-plugin-does-not-support-setting-window-opacity. There @SGaist said
You should give more details about the device and Qt backend you are using.
and it was never resolved.
I use the default wayland in GNOME desktop. I don't know whether that is relevant. I also allowed Ubuntu to install NVidia drivers, I don't know whether that is relevant either.
Where/what component does the error message come from? What plugin are we even talking about? Should this work under Qt6?
-
The answer is that it wasn't implemented. The private class
QWaylandWindow
does not overload thesetOpacity
method so the base class implementation is run and does nothing but display that message.The xcb implementation is here but there is no equivalent in wayland
-
@JonB said in Qt6 QPropertyAnimation: "This plugin does not support setting window opacity":
This plugin does not support setting window opacity
What platform plug-in is used on your machine?
-
@jsulm
Thank you for replying! I don't know how to determine/prove which one I am using? I am pretty sure it iswayland
orwayland-egl
. How do I know? I don't seem to have anyQT_QPA...
environment variables.I just tested
export QT_QPA_PLATFORM=xcb
and confirm that does still work. So a wayland thing :( But on my old Ubuntu 22.04 + Qt5 it worked without my doing anything, that uses GNOME + wayland too.But on the old machine whenever I run a Qt program I have always received warning message
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
I always wondered about that. Now in new system I do not get that message. Does that mean, for whatever reason, the old one (Ubuntu 22.04) persisted in using xcb even under wayland but the new one (Ubuntu 24.04) now really uses wayland, and that is where the difference lies?
-
The answer is that it wasn't implemented. The private class
QWaylandWindow
does not overload thesetOpacity
method so the base class implementation is run and does nothing but display that message.The xcb implementation is here but there is no equivalent in wayland
-
@jsulm , @VRonin
Thank you both. wayland seems to give nothing but limitations compared to xcb.Can either of you answer either of these two questions:
-
I don't understand what has changed running GNOME under Ubuntu 22.04 vs 24.04. Like I say above, under 22.04 it seems(?) it ignores wayland and executed my Qt programs using xcb anyway. Is that right? Do you know what has changed now such that I don't get that error message and it apparently really does run under wayland?
-
Could you tell me anyway how I can tell which QPA is being used when I have no
QT_QPA...
environment variables, please? I triedQT_DEBUG_PLUGINS=1
but from the diagnostics it talked about looking at/loading a whole load of available QPAs but I could not see a line which told me which one it actually decided to use?
-
-
@JonB said in Qt6 QPropertyAnimation: "This plugin does not support setting window opacity":
Could you tell me anyway how I can tell which QPA is being used
Set the
QT_LOGGING_RULES
enviromental variable toqt.qpa.plugin=true
(in Qt creator is it's under Project->Run->environment) -
@VRonin
Perfect!export QT_LOGGING_RULES=qt.qpa.plugin=true qt.qpa.plugin: init_platform called with pluginNamesWithArguments "wayland;xcb" platformPluginPath "" platformThemeName "" qt.qpa.plugin: Attempting to load Qt platform plugin "wayland" with arguments QList() qt.qpa.plugin: Successfully loaded Qt platform plugin "wayland"
-