Plasma::Applet's protected methods hurt the scripting API

Paul Giannaros paul at giannaros.org
Fri Jun 27 19:23:22 CEST 2008


Hello,

I've scratched my own itch and written a script engine for Python
using sip/PyQt/PyKDE; I wanted to write a couple of applets in Python
and the Kross bindings wouldn't work, appeared outdated, and didn't
provide the kind of API that I think Python users would appreciate
(operating on a global applet object isn't the nicest thing in the
world when your applet does something interesting).
I have hit an irritating brick wall, though. My MPD cover art applet
is perfect, except that I don't like its current background -- I'd
much rather it had a translucent background.
Plasma::Applet::setBackgroundHints is a protected method. I cannot
touch it from Python, nor from my AppletScript subclass (class
friendship is not inherited). I'm stuck.
There are plenty of other important things cannot be called:
setIsContainment; setConfigurationRequired; setFailedToLaunch. I also
cannot easily handle resize events at my leisure, mouse presses, mouse
moves, etc. I guess that one could install an event filter and create
an intercepting QObject subclass, but that's not going to make for
nice code at all.

Is it intentional that non-native applets are this crippled, or were
tasks as fundamental as these just not considered?

Please CC me in responses as I am not a member of the list.

Regards,
P.A.G


More information about the Panel-devel mailing list