Skip to content

Sunday, 21 April 2024

Make sure you commit anything you want to end up in the KDE Gear 24.05
releases to them

Next Dates
  • April 25 2024: 24.05 Freeze and Beta (24.04.80) tag & release
  • May 9, 2024: 24.05 RC (24.04.90) Tagging and Release
  • May 16, 2024: 24.05 Tagging
  • May 23, 2024: 24.05 Release

https://community.kde.org/Schedules/KDE_Gear_24.05_Schedule

Saturday, 20 April 2024

<!-- # Season Of KDE - Blog 2 -->

Overview

If you've been following my previous blog posts, you may recall that I've been working on adding multi-format rendering support to Kdenlive. This feature allows users to export their videos in different aspect ratios, such as horizontal (16:9), vertical (9:16), and square (1:1), catering to the requirements of various platforms and use cases.

In the previous blog, I talked about the core implementation of the aspect ratio conversion logic, which calculates the necessary cropping parameters to achieve the desired format.

My Progess so far…

> Temporary File Handling and Refactoring

I initially implemented QTemporaryFile for cross-platform handling of temporary files, replacing hardcoded temp paths. However, this approach involved creating a new temporary file each time the method was called, which was inefficient. Based on the mentor's feedback, I refactored the code to create an empty QTemporaryFile object and only set it up with a specific file template when an aspect ratio change is required. This improved the efficiency of the temporary file handling.1

> User Interface

My next goal was to create user interface elements where the user can select the desired aspect ratio, and then connect them to the backend logic, which I discussed in my first blog.

First, I added a setAspectRatio method in the RenderRequest class to store the selected aspect ratio.

void RenderRequest::setAspectRatio(const QString &aspectRatio)
{
    m_aspectRatio = aspectRatio;
}

This aspect ratio would then be passed to the projectSceneList method in the ProjectManager class:

QString ProjectManager::projectSceneList(const QString &outputFolder, const QString &overlayData, const QString &aspectRatio)
{
    // ...
}

In the render widget's file, I added a new row with a label and a combo box for selecting the aspect ratio. In the rendering widget's constructor.
Then, in the rendering widget's constructor, I created the combo box with the available options:

m_view.aspect_ratio_type->addItem(i18n("Default"));
m_view.aspect_ratio_type->addItem(i18n("Horizontal (16:9)"), QStringLiteral("horizontal"));
m_view.aspect_ratio_type->addItem(i18n("Vertical (9:16)"), QStringLiteral("vertical"));
m_view.aspect_ratio_type->addItem(i18n("Square (1:1)"), QStringLiteral("square"));
m_view.aspect_ratio_type->setCurrentIndex(0);

Profiles with width or height that are not a multiple of 2 cause crashes. I've fixed the issue by ensuring that the video profile width and height are multiples of 2.

[libx264 @ 0x733910204380] width not divisible by 2 (607x1080)

I tried to find the reason behind why we need width and height as divisible of 2 in the first place.

As required by x264, the “divisible by 2 for width and height” is needed for YUV 4:2:0 chroma subsampled outputs. 4:2:2 would need “divisible by 2 for width”, and 4:4:4 does not have these restrictions. However, most non-FFmpeg based players can only properly decode 4:2:0, so that is why you often see ffmpeg commands with the -pix_fmt yuv420p option when outputting H.264 video. --source

Adding Multi-format Rendering

Finally, the selected aspect ratio is retrieved from the combo box and passed to the setAspectRatio method of the RenderRequest object:

request->setAspectRatio(m_view.aspect_ratio_type->currentData().toString());

With these changes, users can now select the desired aspect ratio from the combo box in the rendering widget before exporting their video.

> What I learned:

It was a learning experience; I've gained confidence to work on a large codebase and navigate through it, a better understanding of object-oriented programming (OOP) concepts, and the realization that I needed to get better at it. I learned the importance of efficient resource management, such as handling temporary files and much more. Beyond code, I learned how to better communicate with the mentors.

I'm grateful to the mentors who provided guidance and support throughout the project, helping me overcome the challenges I faced.

Monday, 15 April 2024

We’re a few weeks after the KDE 6 Megarelease and while many people have it working well there were too many problems in KDE neon’s rollout.

We’ll be hosting two Open Door Chats on KDE meet tomorrow (Tue 16 April) where users can talk to the developers to talk about any problems you had.

https://meet.kde.org/b/jon-0yw-xqi-sk6 The access code will be posted on the KDE neon Telegram group and Matrix room or e-mail jr@jriddell.org for it

Chats at 09:00 UTC (10:00 BST, 11:00 CEST) and 19:00 UTC (20:00 BST, 21:00 CEST) Tue 16 April 2024

Sunday, 14 April 2024

Marknote uses QTextDocument for its WYSIWYG text editor. This is surpringly quite powerful and thanks to some code borrowed from KMail rich text editor, it wasn’t hard to implement huge part of the markdown specification.

But while QTextDocument is great, I hit quickly some limits. This is why I started fixing some of them and I already have some patches up for review in Qt.

Default table style

By default the style of the tables looks straight from the 90s, I submitted a patch to use something a bit nicer: https://codereview.qt-project.org/c/qt/qtbase/+/554132 (merged!)

Old style
Old style

New style
New style

This is easy to change in the app itself and this is already the case in Marknote and NeoChat table rendering, but by default I believe Qt should provides a nice style so that apps don’t need to figure out how to overwrite the default style.

While working on this, I also noticed that the border-collapse property was not supported by the layout engine in QtQuick and only in QtWidget. This resulted in the border of the tables to be twice as thick as they should be. This was fortunately fixed by a simple patch: https://codereview.qt-project.org/c/qt/qtdeclarative/+/554151 (merged!)

Responsive images

A width and an height can be assigned to an image in a QTextDocument by using the respectives html attributes <img height="500" width="500" \>.This works correctly when the window size is known and static but less so then the window can be resized as will be the user. A common technique in web design is to add the following styles to the website:

img {
 max-width: 100%;
}

And while QTextDocument support some CSS properties, max-width wasn’t implemented. Adding the support for more properties in the HTML and CSS parser is quite simple as it was just forwarding the value of the max-width attribute to the QTextImageHandler, and a bit complicated was the handling of the % unit as previously only px and em was supported by Qt.

This resulted in two more patches, one for QtTextDocument and QtWidget and one for QtQuick.

Future

Hopefully these patches will be reviewed and merged soon. Afterward I want to add support for a few more CSS properties like: border-radius for images and some other elements, as well the border-{width, style, color} properties for paragraphs to better support <blockquote /> (important when displaying emails).

Unix like systems with X11 or Wayland

All Unix like systems with either X11 or Wayland are well supported since ever.

Linux with X11 and now Wayland is for a long time the primary system on that Kate work happens.

Over the years it was, like most of the KDE applications, ported to various BSD variants.

Be it some mainstream Linux distribution like Fedora or a niche one like NixOS, Kate is available as binary package. You love BSD? From FreeBSD to OpenBSD, you can get a Kate package via your normal package system.

And in the normal case, you can just build it from source on your own, all needed patches should be in our repositories upstream. If that is not the case for your system, please help to upstream them.

Below the current state of the master branch compiled on NixOS unstable with Wayland.

Unix like systems with X11 or Wayland

How to compile Kate on your own on a Unix like system and start to help to develop it can be found out here.

Windows

Since several years there are activities in the KDE community to provide our libraries and applications for Windows.

Even if that is a non-free platform, we can reach out to new users and developers that might later be then even interested to switch a full open platform.

Progress is slow, but steady. We have Kate and some other applications in the official Windows Store and nightly build for more of them. With reasonable effort you can develop Kate on Windows with Craft.

Below the current state of the master branch running on Windows 11 inside VirtualBox.

Windows

If you like to try that, use the nighly installer linked on the Kate website.

macOS

Beside Windows, the major other non-free platform Kate tries to support is macOS.

We have nighly build available for that and you can, like on Windows, develop Kate with the help of Craft.

Below the current state of the master branch running native on my M2 ARM Mac Mini.

macOS

Same as for Windows, if you like to try that, use the nighly installer for either ARM or Intel Macs linked on the Kate website.

Other Platforms

Naturally there are more than the above mentioned operating systems around.

Beside the mobile ones like Android and iOS that are not that interesting for Kate, many other desktop operating systems exist.

Even if the Kate team itself doesn’t put active work it them, that doesn’t mean Kate can’t run there.

Without any active work on our side, for example a Kate port for Haiku was done. Some one-liner patches for that got even upstreamed.

If you work on some port of our stuff and need to upstream stuff, please contact us. Even if you work on a non-mainstream system, as long as the patches are not too intrusive, we are interested to have them.

Help us!

Naturally the most of our developers are working on the Linux or some BSD.

That means the other systems are always in need of more people to help out, both on the programming and testing side.

For Kate, testing should be easy, grab a nighly build for Windows or macOS on the Kate website. Or even better, get Craft running, that will make it easier to contribute, too.

One recent topic that needs love is the removal of DBus for Windows/macOS/Android and other systems that don’t use it normally.

If you are up to help with that, here that is coordinated. The current state is already sufficient that the nightly builds of Kate no longer hang on e.g. macOS, but still some frameworks like KIO will need more work.

Just don’t get that wrong, DBus is great on the Linux or BSD systems that use it natively, but it is a pain on systems that have no notion of DBus and leads there to hangs or the spawning of unwanted processes. Beside that, the usefulness is low there, as there are no services on the bus to communicate with anyways.

Feedback

You can provide feedback on the matching KDE Social, reddit or Hacker News post.

Saturday, 13 April 2024

Hindi Translation of Cantor and KDE connect - Season of KDE 2024 This is the second and last blog for SoK 2024. During the second half of Season of KDE, I translated Cantor and KDE connect in hindi. Cantor and KDE connect had about 1000 and 500 lines respectively. In order to translate these softwares, I took reference from google translate and AI models to improve on my translation. Translation memory did a great job in finding duplicates and helped me to avoid translating the same words again.

Friday, 12 April 2024

tldr; save the date for our QtCS24 Sep 5-6 in Würzburg.
Stay tuned for more information.

This is my final blog about my experience participating in season of KDE 2024. As part of my final term, I translated Tellico to hindi. Tellico contains 2070 statements with messages containing 1340 and docmessage containing 730 statements. I used Lokalize application for the translation. Here are some screenshots: Lokalize also has a glossary but its very limited for Hindi language. Commission for Scientific and Technical Terminology (https://cstt.education.gov.in/glossary-hindi-engineering-and-technology) and Fuel provides glossaries which can be used to expand Lokalize.

Wednesday, 10 April 2024

So this person, let's call them Jo, was hungry and had no money. Walking the streets, they come across a square where a group of people are working in a communal open kitchen, serving delicious hot meals free of charge.

So, 2023 was a successful year for Qt - and we highlight the Qt 6.5 and Qt 6.6 releases, Qt World Summit, and Qt Contributor Summit.

Our community stays vibrant and engaged with the Qt Project through our forums, mailings lists, asking and answering questions, offering technical advice, reporting bugs, contributing patches, and in many other forms helping Qt flourish.