![]() Registered Member ![]()
|
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 |
![]() Administrator ![]()
|
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] |
![]() Registered Member ![]()
|
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?.. |
![]() Administrator ![]()
|
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] |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]