A working QML tutorial for plasma5?


(kepszlok) #1

I’m intrested in QML widgets for KDE but the tutorial on KDE techbase are problematic.

See here: https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted

With following the tutorial, i get this error: “org.kde.plasma.plasmoid” is not installed
It’s the same on Mint KDE. I faild to find anything usefull about this error in google.


(Chroot Doot ✝) #2

I do not have experience with Plasma plasmoids, but it seems like org.kde.plasmoid isn’t a package, it’s representing the plasmoid you are writing. For example:

The plasmoid can provide two components: compactRepresentation and FullRepresentation

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

Item {
    Plasmoid.compactRepresentation: CompactRepresentation {}
    Plasmoid.fullRepresentation: FullRepresentation {}
}

where the files CompactRepresentation.qml and FullRepresentation.qml exist in the plasmoid package. They are both optional: if compactRepresentation is not present, a default one will be created (the plasmoid icon) if fullRepresentation is not defined, the root item will be picked instead. If a fullRepresentaion is defined, the root item will not contain any graphical element (they will be never shown) but is only supposed to contain models and data that must be accessible from both the compact and the full representation.

It’s using an example package org.kde.plasma.plasmoid, which has the contents CompactRepresentation.qml and FullRepresentation.qml defined, which modify how the plasmoid is displayed.

I could be completely wrong and org.kde.plasma.plasmoid is, indeed, a package which is required, but I can’t find it in any documentation, and the tutorial is written as if it is a figurative package.

If this is the case, then the tutorial should be updated with org.kde.plasma.plasmoid replaced with something such as my.tutorial.plasmoid.

QML is really nice to work with, so I wish you luck.


(kepszlok) #3

Thanks. I think of there are some problem with qmlscene. It gives the same error also on other plasmoids, and all of them uses org.kde.plasma.plasmoid. It gives back this error even for “factory” plasmoids in /usr/share/plasma/plasmoids/ folder.

I had to ask this in kde forums…


(Chroot Doot ✝) #4

Yes, you are right. org.kde.plasma.plasmoid is an import needed for plasmoids, however, other org.kde.plasma components are loaded fine. I ran qmlscene myself with a stock plasmoid, and recieved the same error, so qmlscene is the issue.

The Plasma desktop probably does extra stuff to a plasmoid when running it, so I do not think you can test a plasmoid through qmlscene.

Try testing your plugin as specified in this section:
https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted#Testing_the_Applet


(system) #5

This topic was automatically closed 170 days after the last reply. New replies are no longer allowed.