Getting started developing for kde6

Hi,
I’ve been wanting to make a simple plasmoid for auto switching to dark or light theme depending on the time of the day for a while now, but for the life of me I cannot manage to find examples and documentation I can understand…

My Setup

  • OS: Fedora 42
  • Packages Installed: The groups @kde-software-development and
    @kf6-software-development

Resources I’ve already tried

  • https://develop.kde.org/docs/plasma/widget/setup: Seems to be for kde5 plasmoids
  • https://develop.kde.org/docs/plasma/widget/porting_kf6: It assumese that
    you already know how to develop a plasmoid
  • https://medium.com/@dhruv8sh_34505/write-an-applet-for-plasma-6-0b8fd3a0334f:
    This has some examples but some commands it uses they seems to be outdated
    (?) (e.g. plasmapkg2 that by searching online has been surpassed by
    kpackagetool6)

What I’m looking for

The ideal think for me would be to have a roadmap of documents that introduce
me gradually to the concepts (I might been stupid and couldn’t found them):

  • Development setup: the tools you need to start developing for Plasma 6.
    Ideally if a tool has changed for doing a thing from plasma 5 to 6 I would
    like to be aware of that so if I read a old tutorial I can map it mentally to
    the new tool (we used to use ‘x’ for doing ‘y’ but now we use ‘z’).
  • Documentation for plasmoids on KDE 6: what are the options? How do I
    structure this project? What libraries are used?
  • A template project: I would like to understand what is the ‘boilerplate’
    necessary for the application to work
  • Testing and play around with plasmoids: How can I test my plasmoid? How do I
    debug it if something goes wrong? Where do I find resources to debug the
    errors?
1 Like

Is this not up to date?

Also, you can just download an existing plasmoid for Plasma6 and just unzip and play with the code to learn.

I’ve tried this approach but there are several issues with this:

  1. Since I’m a beginner how I’m supposed to now which is a Plasma6 plasmoid using the right thing that aren’t using legacy code?
  2. Usually already existing plasmoids are too complex to me to wrap my head around it. Since I never touched the Qt stack or programmed in qml, it is more valuable to me to understand things from a bottom up approach.
  3. If I was able to understand an existing plasmaoid codebase do you think I would bother posting here?

Usually the plasmoid says. Otherwise it should they should have a “metadata.json” file if they are plasma6 ready.

A good reference are the ones in applets · master · Plasma / Plasma Add-ons · GitLab since they are maintained by the plasma devs.

You have simple relatively simple examples like calculator or binary-clock.

But if you need to learn about QML i can recommend KDAB video serie teaching QML. You can pick the subject you are interested in.

You can check-out some tutorials Getting started | Developer but one for plasmoid is missing :confused:

Our Documentation is not perfect. KDE Devs learn through examples a lot.

Documentation for plasmoids on KDE 6: what are the options? How do I
structure this project? What libraries are used?

Well for plasmoids you Qt Qml libraries and Kirigami (KDE) plus optionally libplasma

  • Testing and play around with plasmoids: How can I test my plasmoid? How do I
    debug it if something goes wrong? Where do I find resources to debug the
    errors?

plasmoidviewer, GammaRay and live testing, with the plasmashell command output .

2 Likes

It is there: Plasma Widget tutorial | Developer

What happens is that it’s Qt5 code that mostly works for Qt6 when you consider the porting page: Porting Plasmoids to KF6 | Developer

I was supposed to work on this 6 months ago, but alas. I’ll see if I can do this in a timely manner next. It actually needs a major overhaul.

2 Likes