This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to create Plasmoid using QML/C++

Tags: None
(comma "," separated)
teaker
Registered Member
Posts
6
Karma
0

How to create Plasmoid using QML/C++

Mon Aug 29, 2022 10:26 pm
Hello liebe Kde Community,

I wanted to create a plasmoid using QML and c++ because I have to work with lib x11/Wayland. I can barely find documentation or example for this purpose and therefore I am asking for your help. I achieved to configure qml and c++ and compile it to an executable but the problem starts when I want to use KF5 in cmake in order to build the applet and its dependencies . I tried to install extra-cmake-modules from apt as well from source but the cmake still throw this error:

CMake Error at CMakeLists.txt:26 (find_package):
 By not providing "FindKF5.cmake" in CMAKE_MODULE_PATH this project has
 asked CMake to find a package configuration file provided by "KF5", but
 CMake did not find one.

 Could not find a package configuration file provided by "KF5" with any of
 the following names:

   KF5Config.cmake
   kf5-config.cmake

 Add the installation prefix of "KF5" to CMAKE_PREFIX_PATH or set "KF5_DIR"
 to a directory containing one of the above files.  If "KF5" provides a
 separate development package or SDK, be sure it has been installed.

I searched for an alternative and I found that Kdevelop offers ttemplates for plasmoids with QML/C++ However the generated template seems to be broken for kde5 and only valid for kde4 unfortunately. Quick search for kdevelop git and I found out that the repository was updated 2 days ago in the folder template and I thought that my problem is solved and I can finally deploy my application but building kdevelop from source itself wasn't that easy and took a lot of time from me to correct the gcc version compatibility. (Yeah in kdevelop source code some #include <limits> is missing). Finally after getting the last version of kdevelop and creating new project with the C++/QML template I was deceived by the same generated project.
Moreover, Kdevelop usage is very complicated and not documented at all.

Questions:
1) Can someone please help me transforming qml/c++ into a plasmoid with qml/c++ ?
2) How is it possible to execute the plasmoid (in Kdevelop or from cli)
3) Is it possible to use Qt6 with plasma 5 ? that's not important but I am really curious
teaker
Registered Member
Posts
6
Karma
0
I just solved the problem by installing libkf5plasma-dev. but still cannot build the project using cmake :(
Can someone provide a template
tubbadu
Registered Member
Posts
21
Karma
0
you can try kapptemplate, it has some bugs but may help you
ecsuarez
Registered Member
Posts
1
Karma
0
OS
You'll need extra-cmake-tools package to build with cmake, it has a similar name under distributions.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]