This forum has been archived. All content is frozen. Please use KDE Discuss instead.

QPixmap usage (Javascript)

Tags: None
(comma "," separated)
User avatar
Chiffa
Registered Member
Posts
2
Karma
0
OS

QPixmap usage (Javascript)

Thu Apr 08, 2010 11:30 am
Greetings to all,
i'm now trying to play with simple NowPlaying example widget. want to add album artwork on it, but have no cue how to use that QVariant(QPixmap) which comes from 'nowplaying' dataengine.
what exactly should be done to data['Artwork'] to display it as a picture?.

thanks in advance
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: QPixmap usage (Javascript)

Fri Apr 09, 2010 2:57 am
You should be able to display it in the Plasma equivalent of QLabel, which is it Plasma::Label. Note that you may need to convert it to a QImage first.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Chiffa
Registered Member
Posts
2
Karma
0
OS

Re: QPixmap usage (Javascript)

Fri Apr 09, 2010 8:46 am
bcooksley, thank you for your reply,
the problem is (as i see it) that javascript api is reeeally simplified.
that's all i have with Label http://techbase.kde.org/Development/Tut ... /API#Label
so label.setPixmap(data.Artwork); doesn't work. Nor does QPixmap::convertToImage(). As i can understand there's no QImage in js api at all...

BUT, i'm sure that artwork retrieved from 'nowplaying' dataEngine can be displayed. i saw it!:)
if anyone who's familiar with JS Plasma API, could tell me what the way is?..
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: QPixmap usage (Javascript)

Fri Apr 09, 2010 10:15 pm
The workarounds may have used IconWidget. http://techbase.kde.org/Development/Tut ... IconWidget

In either case, I would consider that a major API limitation, you may wish to ask in #plasma if a method to set QPixmap's can be added in future releases.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]