Recent

Author Topic: QT Plasmoid for KDE Plasma desktop  (Read 1843 times)

Raskaton

  • New Member
  • *
  • Posts: 12
QT Plasmoid for KDE Plasma desktop
« on: April 15, 2023, 07:00:18 pm »
Hello!

Is any way to create "Plasmoid" for KDE desktop in Lazarus?
https://userbase.kde.org/Plasma/Plasmoids
For example, I want create a weather desktop widget.

When search kde.org, I see that Plasmoids created in some QT-framework.
But in Lazarus we use universal widgetset. How can I use QT-specific functions, like Plasmoids?
What units? Where search from?

MarkMLl

  • Hero Member
  • *****
  • Posts: 6682
Re: QT Plasmoid for KDE Plasma desktop
« Reply #1 on: April 15, 2023, 07:23:20 pm »
Interesting question. I think the obvious first thing is that ones starting point would presumably be with the LCL variant that was implemented by Qt... but the real question is what additional API facilities are demanded by Plasmoids.

However one also has to ask how stable the entire Plasmoid concept is: none of the major desktops are immune to the temptation to tear up existing standards and move onto something they imagine to be better, and it's unreasonable to expect a complex project like the LCL to keep up with them.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

tetrastes

  • Sr. Member
  • ****
  • Posts: 481
Re: QT Plasmoid for KDE Plasma desktop
« Reply #2 on: April 15, 2023, 10:16:17 pm »
Seeing pictures of that link I think that these plasmoids are for old KDE4. This is confirmed also at https://code.google.com/archive/p/gmail-plasmoid/:
Quote
A gmail notifier plasmoid for KDE 4 written in python
and the last download for it is dated Feb 11, 2012. I downloaded sources and saw, that it is not pure qt4 app, it depends on KDE4 libs, which, however, was to be expected.
So I think that you cannot create these in Lazarus, at least unless you create wrappers for KDE libs.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: QT Plasmoid for KDE Plasma desktop
« Reply #3 on: April 15, 2023, 10:28:27 pm »
KDE Plasmoids are built on top of Qt's QML, a declarative style markup language to describe both a user interface as well as the event handlers.

At best what Lazarus can do to get involved is writing plugins to interfact with something unreachable from QML level, but the widget must still be written in QML, that's just how Plasmoids are designed.

The old Plasma 4 Plasmoid model, which opens access to larger language selection, is no longer here, at least not in KDE team maintained areas. Somebody might revive KDE Plasma 4 like how Trinity (KDE 3) was revived and maintained outside of KDE team, but if you're really into the real KDE, Plasmoids with QML is the only way to go.
« Last Edit: April 17, 2023, 03:50:37 am by Leledumbo »

Raskaton

  • New Member
  • *
  • Posts: 12
Re: QT Plasmoid for KDE Plasma desktop
« Reply #4 on: April 16, 2023, 05:36:19 pm »
how stable the entire Plasmoid concept is...
I consider Plasmoids as an addition to my usual application. This will allow the user to display part of the information he needs from the application right on the desktop. In Android, this concept of widgets is the basis. In my Linux "KDE Plasma 5" they look very organic too.

It is very convenient to display the temperature of the air conditioner on the desktop, for example. Or have a button for turning on the light, a table lamp. In the age of the Internet of things, this is a promising concept, IMHO.

I think that these plasmoids are for old KDE4.
I found new Plasmoids on the official KDE website:
https://store.kde.org/browse?cat=105&ord=rating
My standard Linux installation has a lot of Plasmoids out of the box: analog clock, monitoring computer resources (tempo, RAM), network monitoring, sticky notes, bluetooth control, etc.
and they are beautiful :)

KDE Plasmoids are built on top of Qt's QML, a declarative style markup language to describe both a user interface as well as the event handlers.

At best what Lazarus can do to get involved is writing plugins to interfact with something unreachable from QML level, but the widget must still be written in QML, that's just how Plasmoids are designed.
I began to understand how it works.
It looks like Plasmoids written in Python are essentially QML plugins and a QML interface template.
So, ideally, I need a Plasmoids LCLWidgetSet implementation or a QML-plugin library + an interface template.

But how then is QT implemented in Lazarus? Is there already a translator inside that converts pascal code to QML?
These are probably rhetorical questions and I should investigate this myself...

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: QT Plasmoid for KDE Plasma desktop
« Reply #5 on: April 17, 2023, 03:59:29 am »
I began to understand how it works.
It looks like Plasmoids written in Python are essentially QML plugins and a QML interface template.
These days, there should be no more Plasmoids written in Python. QML only exposes C++ interface where the plugins are compiled into libraries, something Python isn't capable of.
But how then is QT implemented in Lazarus? Is there already a translator inside that converts pascal code to QML?
Just like any other widgetset, it adheres to the LCL interface, that's it. No QML is used at all, since lfm + Pascal code is all that Lazarus understands and the underlying widgetset selection is even abstracted through defines and -Fu manipulation. Remember that Qt is a library first, QML is a secondary citizen used to write Qt programs easier than fully through hand coding.

 

TinyPortal © 2005-2018