I'm on KDE Plasma 6.0.2 + Wayland. I need to create a widget that inherits from QWidget with the Qt::Popup window flag set and has a natural shadow (i.e., the shadow is drawn by the window manager). Actually, I could inherit my widget from QMenu (which inherits from QWidget with the Qt::Popup window flag set), but there are a lot of methods I don't need. The problem is that my custom widget (which, once again, is inherited from QWidget with the Qt::Popup window flag set) doesn't have a natural shadow, while QMenu does. And I can't understand why, because they are essentially two similar classes.
Create a popup widget with a native shadow
26 views Asked by popov895 At
1
Got it. In Plasma 6, the presence of a shadow under the popup widget depends on the current style. For the Breeze style (which is default for Plasma 6), you need to add a dynamic property
_KDE_NET_WM_FORCE_SHADOWand set it totrue:See here for details.