Jump to content

GSoC/2024/StatusReports/ManuelAlcaraz

From KDE Community Wiki
Revision as of 18:00, 4 September 2024 by Manuelal (talk | contribs) (Update report)

Python bindings for KDE Frameworks

KDE Frameworks is a collection of C++ addon libraries to Qt that provide common functionality for desktop applications built with the Qt framework. While Qt itself provides support for developing applications using other programming languages, such as Python, KDE Frameworks does not.

This project aims to create Python bindings (along with comprehensive developer documentation) for a subset of the KDE Frameworks using the same technologies (Shiboken) that Qt uses for their Python port.

Mentor

Carl Schwan

Work report

Summary

I have added a new module to Extra CMake Modules (ECM) that handles the generation of Python bindings using Shiboken. It's currently waiting to be merged while we figure out some building errors on some distributions.

Using the new module, I wrote Python bindings for the following libraries:

  • KWidgetsAddons
  • KUnitConversion
  • KCoreAddons
  • KGuiAddons
  • KI18n
  • KNotifications
  • KXmlGui

The first two of them have open merge requests, the rest will be upstreamed once the ECM one is merged.

Writing the definitions of the bindings was mostly a repetitive task (that sometimes became boring), although sometimes Shiboken didn't properly handle some functions and required some manual tweaking.

Future work

This project only added Python bindings to a few KDE Frameworks, so writing bindings for the rest of them is an expansion point.

Due to the language differences between Python and C++, some functions can't be ported properly (namely those which have pointers as arguments, e.g. bool*). This wan't addressed on the project.

Merge requests

Links to Blogs and other writing