I'm working on this small KDE plasmoid and I really like the QtQuick/QML, but now I have this requirement. I need to do an action when a window is shown or closed in KDE. KDE API have signals for that: https://techbase.kde.org/Development/Tutorials/KWin/Scripting/API_4.9#Signals_3

windowClosed(KWin::Toplevel *toplevel, KWin::Deleted *deleted)
windowShown(KWin::Toplevel *toplevel)

But, I don't know how to connect the KDE signals with my QML plasmoid.

I guess with a little bit of C++ it might be possible. No problem with mixing C++ and QML, this is documented by Qt quite good.

I think what I need is C++ code, which takes the qml as a layout and setup the signal connection.

Is that even possible?

  • I have at least small progress now. I'm able to create a basic plasmoid with Python and PyKDE and use DeclarativeWidget which is able to load a qml file. – stibi Jul 23 '14 at 7:17
  • I have almost working example now, I'll provide a link to the code here soon. – stibi Jul 24 '14 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.