update or repaint() slot in plasmoid and qtimer question

Aaron J. Seigo aseigo at kde.org
Tue Jul 1 00:07:33 CEST 2008


On Monday 30 June 2008, LECONTE Frédéric wrote:
> I'm trying to write a simple plasmoid wich draw a random image with an
> interval of time( every 250 ms).
> i use a qtimer, but I don't find the method to override.

you will need to implement your own slot.

if you are looking for an example, see 
kdebase/workspace/plasma/applets/analog-clock/clock.h and search for "slots". 
also note in the .cpp file how there is a #include "clock.moc" at the bottom of 
the file which makes the slot magic work.

> It's just to see my cpu speed at screen or somethings else.

if you wish to see your cpu speed, then you probably want to use the 
systemmonitor dataengine, something like this in your init():

dataEngine("systemmonitor")->connectSource("cpu/cpu0/clock", this, 1000);

and then create a dataUpdated(const QString &sourceName, const 
Plasma::DataEngine::Data &data) slot in your Applet.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080630/4c90e896/attachment.pgp 


More information about the Panel-devel mailing list