Some issues with porting KDE4 plasmoid to Plasma5

Marco Martin notmart at gmail.com
Tue Nov 25 09:23:37 UTC 2014


On Sunday 16 November 2014, Evgeniy Alekseev wrote:
> Hello,
> 
> Some time ago I've started a porting of my plasmoids and dataengines to the
> newest Plasma and found some problems with it. I've ported a DataEngine w\o
> any problem, but I have issues about a Plasmoid. I've read API reference
> and look at examples from plasma-next and didn't find solutions.
> 
> First of all I want say that I don't plan to use QML/JS now and plan to
> develop of my plasmoids in pure C++. Firstly it is related to other project

in Plasma5 pure C++ plasmoids are not possible anymore, the c++ api was for 
QGraphicsView (since plasma was based on top of it) plasma5 is based on top of 
scene graph, so the only way to write an UI is trough QML.
You can still use C++ in a dataengine or a private QML import.

> parts which is in C++/Qt and I don't want to use additional languages w\o
> any special necessity. Also as far as I understand the core plasmoid part
> (on which I have issue too) still shoul be written in C++. Also I try to
> avoid using deprecated functions.
> 
> My questions are:
> 
> 1. Is there any alternative to Plasma::PopupApplet? If there is not, is
> there a plan to implement it?

all applets are popupapplets now.
see
http://notmart.org/blog/2014/02/making-plasmoids-qml-api-better/

especially the section "Compact and full representations"

> 2. Is there a possibility to paint complex UI w\o using QML (in C++ code)?
> For example, I didn't find old Applet::setLayout() and
> PopupApplet::setWidget() methods.

no, only QML is allowed, and subclassing Applet doesn't really work anymore.
If you have a complex QWidget ui in theory you could still have it by 
implementing it in a QML import, then making ti show from a slot invoked by 
qml.

> 3. How can I connect DataEngine to my Plasmoid? The old method which I used
> was dataEnigne(), some new applets use this method too, but it doesn't
> exist in the newest Plasma headers. Some new widgets such as nm-applet use
> Plasma::DataEngineManager::self()->engine() constuction, but
> Plasma::DataEngineManager class doesn't exist in the Plasma too =(

see the QML bindings:
https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API#Data_Engines

-- 
Marco Martin


More information about the Plasma-devel mailing list