Skip to content

Tuesday, 23 July 2024

Dear fans of music & open source music players,
in preparation of the upcoming Amarok 3.1 release, a beta release (3.0.81) has been prepared.

As is observable from the ChangeLog, in addition to various bugfixes, there will be some, but not that many, new features included in the upcoming version. However, there has been a lot of Qt6 compatibility preparation work done under the hood, so version number 3.1 reflects the amount of changed code better than 3.0.2 would. 3.1.0 is likely to be released in early August, and all help catching any regressions during this period is highly appreciated. (n.b. one won't be able to compile a Qt6 Amarok with 3.1 yet, but perhaps with the eventual 3.2)

The source tarball is available on download.kde.org and it has been signed with Tuomas Nurmi's GPG key. There doesn't appear to be many binary packages of the beta available, at least at the moment, but the various nightly git builds provided by various splendid packagers are also based on corresponding source code, so using them and reporting findings is also a valid way to participate in the beta test effort.

Happy listening!

Kirigami Addons 1.4 is out! This release introduce a new module to manage actions similar to that we can find in the QtWidgets world with KXmlGui. This was not written from scratch but upstream the existing infrastructure from Merkuro (ex-Kalendar) and Marknote. These two applications have already been ported to this new module and more like Tokodon or KDE Keychain will follow soon.

This includes a shortcut editor to assign and modify the shortcuts of an application and a command bar to quickly search and trigger actions

Shortcut editor
Shortcut editor

Command bar
Command bar

Similar to KXmlGui, the actions are defined in C++, which allows to make use KStandardActions and get consistent shortcuts accross all your applications.

class MyApplication : public AbstractKirigamiApplication
{
 Q_OBJECT
 QML_ELEMENT

public:
 explicit MyApplication(QObject *parent = nullptr);

 void setupActions() override;

Q_SIGNALS:
 void addNotebook();
};

MyApplication::MyApplication(QObject *parent)
 : AbstractKirigamiApplication(parent)
{
 setupActions();
}

void MyApplication::setupActions()
{
 AbstractKirigamiApplication::setupActions();

 auto actionName = QLatin1String("add_notebook");
 if (KAuthorized::authorizeAction(actionName)) {
 auto action = mainCollection()->addAction(actionName, this, &MyApplication::addNotebook);
 action->setText(i18nc("@action:inmenu", "New Notebook"));
 action->setIcon(QIcon::fromTheme(QStringLiteral("list-add-symbolic")));
 mainCollection()->addAction(action->objectName(), action);
 mainCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_N));
 }
}

These new actions can then be used from QML thanks to the new Kirigami.Action::fromQAction property.

import org.kde.kirigamiaddons.statefulapp as StatefulApp
import org.kde.kirigamiaddons.settings as Settings

StatefulApp.StatefulWindow {
 id: root

 windowName: 'Main'
 application: MyApplication {
 configurationView: Settings.ConfigurationView { ... }
 }

 Kirigami.Action {
 fromQAction: MyApplication.action('add_notebook')
 }

 Connections {
 target: MyApplication

 function onAddNotebook(): void {
 ...
 }
 }
}

There is a new template available in KAppTemplate, which allows you to kickstart your new Kirigami application with the basic skeleton with this new module and other “Kirigami Addons” modules.

Other Changes

The FormCard design was tweaked a bit more when using a dark theme, thanks to James and Joshua for their feedback.

Speaking of FormCard, with the development of KeyChain, I ended up adding a new component to the FormCard collection: FormTextAreaDelegate. This component is the equivalent of FormTextFieldDelegate but with a TextArea instead. FormComboBoxDelegate and FormTextFieldDelegate also received a bunch of new properties and functions to proxy the underlying QtQuick.Controls component.

Evgeniy Harchenko tweaked a bit the headers of the TableView component.

Finally, a new contributor Andreas Gattringer fixed a crash in the video maximizing component which was affecting NeoChat.

Packager Section

You can find the package on download.kde.org and it has been signed with my GPG key.

Building QML Android Applications

Qt Creator uses Gradle for project building. Once your project code is ready, select the Android kit for building in Qt Creator. Click build, and Qt Creator will generate Gradle configuration files for you. However, you may encounter errors such as:

Execution failed for task ':processDebugResources'. A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction Android resource linking failed aapt2 E 07-23 15:59:44 51907 51907 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2 E 07-23 15:59:44 51907 51907 ApkAssets.cpp:149] Failed to load resources table in APK '/home/zhy/Android/Sdk/platforms/android-35/android.jar'.

This is because the current Gradle plugin version does not support android-35. See How to fix "Execution failed for task ':app:processDebugResources'. > Android resource linking failed"[Android/Flutter] - Stack Overflow

To resolve this issue, you need to modify the Gradle configuration.

Navigate to the /build/Qt_6_7_2_Clang_arm64_v8a-Debug/android-build folder in your project.

Open the build.gradle file and locate the dependencies block:

dependencies {
        classpath 'com.android.tools.build:gradle:7.4.1'
    }

com.android.tools.build:gradle:7.4.1 refers to the Android Gradle Plugin (AGP). This default version is from 2022 and is quite outdated.

You can find the latest version here: Maven Repository: com.android.tools.build » gradle

Update the plugin version to a newer one, for example:

    dependencies {
        classpath 'com.android.tools.build:gradle:8.4.1'
    }

Additionally, when upgrading the plugin version, ensure compatibility with the Gradle version.

Check the relationship between the Gradle and AGP versions here: Android Gradle plugin 8.5 release notes | Android Studio | Android Developers

Reference: Could not find com.android.tools.build:gradle:7.3.3. error found in build.gradle file - Stack Overflow

Therefore, you should use at least Gradle version 8.6 to support this plugin.

Navigate to the ./gradle/wrapper folder and open the gradle-wrapper.properties file. This file defines the Gradle version used by the project.

Find the line: distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

Change it to:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip

This update specifies that the project will use Gradle version 8.6.

After making these changes, click on build. It will automatically download the specified version of Gradle and then download the necessary Gradle plugins.

If successful, you can find the built APK at ./build/outputs/apk/debug.

Running and Installing APK

In a Linux environment, you can use the adb command to install the APK on your Android device. Alternatively, you can use Qt Creator for one-click deployment.

After connecting your Android device via USB, use the adb command to install the APK:

adb install android-build-debug.apk

Make sure that your Android device has Developer Mode enabled. You can find specific instructions on how to enable Developer Mode based on your device model through an online search.

If you want to share the screen on your phone on PC, you can use scrcpy: Genymobile/scrcpy: Display and control your Android device

Monday, 22 July 2024

Not everything made by KDE uses C++. This is probably obvious to some people, but it’s worth mentioning nevertheless.

And I don’t mean this as just “well duh, KDE uses QtQuick which is written with C++ and QML”. I also don’t mean this as “well duh, Qt has a lot of bindings to other languages”. I mean explicitly “KDE has tools written primarily in certain languages and specialized formats”.

Note that I said “specialized formats”. I don’t want to restrict this blog post to only programming languages.

Sunday, 21 July 2024

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

Next Dates  
  • July 25, 2024: 24.08 Freeze and Beta (24.07.80) tag & release
  • August  8, 2024: 24.08 RC (24.07.90) Tagging and Release
  • August 15, 2024: 24.08 Tagging
  • August 22, 2024: 24.08 Release

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

It has been three weeks since the start of the OSPP project, during which my project has made some progress.

Week 1, July 1st to July 7th

In the first week of the project, with the help of my mentor, I first set up a suitable development environment and identified Blinken as the first application to be migrated for the project. In addition to this, I also set up this project's blog, which has now been included in KDE Planet.

Currently, I am using a development environment on a VirtualBox virtual machine running Fedora Workstation 40. With this setup, I can compile and build KDE applications and perform Qt development.

For building the KDE development environment, it is recommended to use kdesrc-build provided by KDE official, and it is also recommended to develop under KDE Neon system, which can be done using docker or virtual machines

A straightforward method for setting up Qt Android development environment is to use [Qt Online Installer]((https://doc.qt.io/qt-6/get-and-install-qt.html#using-qt-maintenance-tool) and Qt Creator. After installing Qt Creator, navigate to Editing -> Preferences -> Devices -> Android to select the necessary development kit. Qt Creator will automatically download the required SDK and NDK.

Week 2, July 8th to July 14th

Upon my mentor's suggestion, I developed a simple Tic-Tac-Toe QML game as a practice exercise. This game uses QML to create a simple interface and employs a C++ class to handle game logic, which will also be the architecture for the upcoming game migration.

The current features implemented in the game are:

  1. Multilingual localization support
  2. Unit testing capability
  3. Cross-platform compatibility

The Tic-Tac-Toe game is openly developed on KDE Invent: hanyang zhang / TicTacToe · GitLab

Supporting localization for QML applications requires the use of Qt's localization tools such as lupdate and lrelease. However, since the project is built with CMake, Qt also provides corresponding CMake methods: qt_add_translations | Qt Linguist Manual

Additionally, I encountered some difficulties while building QML Android applications, as described here: Building and Running QML Android Applications | Blog

Week 3, July 15th to July 21st

During this week, I officially began the migration work for Blinken.

After studying Blinken's source code, I found that the interface of Blinken is drawn by a class named Blinken, which spans over 1000 lines. The drawing logic involves manipulating elements from Blinken.svg and using QPainter for direct drawing.

Unfortunately, QML does not provide built-in support for manipulating SVG images like QtWidgets. Therefore, I split the SVG images into separate files and assembled these elements using QML with Adobe Illustrator and Inkscape.

Modifying the UI took longer than I anticipated. However, after a week, I have nearly completed the interface drawing for Blinken. Next steps involve refining some page details and migrating Blinken's logic over.

It's worth mentioning that QML does not provide a non-rectangular MouseArea for use, requiring the creation of a custom class to achieve this functionality. Fortunately, an example for this existed in earlier versions of the documentation: maskedmousearea example. Although this example seems to have been removed in the latest version, it should still be feasible to implement based on reference.

Saturday, 20 July 2024

Yes, that’s right. The title just goes perfectly, with these long weeks! From Week 3 to Week 7!

So, first a small back story on the title. On 25th June, my semester exam ended. I was returning to my hometown, and on my way, I got into a bike accident. My right hand got bruised onto the road. Luckily, it didn’t break. But, the sheer pain was enough to make me cry. It was feeling, as if, someone is constantly burning my hand. I also got injuries in my leg and chest. Went to the doctor, a day after, because I wasn’t able to get up at all! And a complete bed rest for 2 weeks! And guess what, everything good after that? No!!!! My mentor, Scarlett mam, faced a road accident. And this time, she got her arm broken. She had her surgery yesterday. To every readers of this blog, please pray for her speedy recovery.

Tuesday, 16 July 2024

Say hello to LabPlot 2.11!

This brand new release comes with many new features, improvements and performance enhancements in several areas, as well as support for more data formats and visualisation types.

The main new features are outlined below. For a more detailed overview of the changes in this release, please refer to the ChangeLog file.

The source code of LabPlot, the Flatpak and Snap packages for Linux, as well as the installer for Windows and the image for MacOS are available from our download page.

What’s new in 2.11?

Worksheet

This release includes more visualisations, usability improvements and a new worksheet preview panel:

  • You can now use Lollipop, Q-Q and KDE plots
  • We have implemented error bars for bar plots
  • There is a new preview panel for all available worksheets in the project
  • You can use the navigation panel in the presenter widget to select, zoom and navigate in the presenter mode
  • You can lock worksheet elements to prevent accidental changes
  • LabPlot 2.11 allows you to show or hide the entry in the legend for all supported plot types and not just xy-curve
  • You can give your worksheets a fresh new look with the Dracula theme

Spreadsheet

Spreadsheets gain more functions and operations to modify, generate and understand the data:

  • We have extended the search and replace features
  • You can check statistical properties of the parent in a new child spreadsheet
  • We have added sparklines in the header of a spreadsheet
  • LabPlot 2.11 comes with spreadsheet linking to synchronize the number of rows across multiple spreadsheets
  • We have implemented triangular distributions for PDF, CDF, and pseudorandom number generation
  • Equidistant value generation has been extended

Analysis

Analysis tools added to LabPlot 2.11 include:

  • Note showing the fit results
  • Faster computation of the baseline removal (we switched to Eigen3 internally)

Import/Export

LabPlot 2.11 adds support for new file formats and multiple optimizations to improve the handling of edge-case scenarios:

  • You can now import Open Document Spreadsheet (ODS) files.
  • Templates for ASCII and Binary import filters allow you to save and load current filter settings
  • There is a new feature that allows you to to specify the data range to be read (start/end values for columns and records) when importing from SQL databases
  • LabpPlot can now gracefully handle out-of-memory situations when importing large amounts of data
  • LabPlot 2.11 displays better error messages during the import
  • We provide additional information about BLF files (application name with which the file was created with, etc.)
  • We have made several fixes and improvements to the import of Origin’s OPJ files

Notebook

The 2.11 release adds a number of usability enhancements to the Notebook interface:

  • You can now export the notebook to PDF
  • We provide statistics and a “plot data” action from the context menu in the project explorer for variables created in the Notebook
  • There is a new option in the application settings to run a selected CAS engine on startup

Monday, 15 July 2024

Profiling displays is already not a super simple thing on its own, but things get more complicated when you try to profile your display in Wayland - profiling applications don’t support Wayland yet, some APIs on the compositor side to make it work well are still missing, and there’s a general lack of information on the topic. So today I’ll show you how to profile your display in the Plasma Wayland session.

I did this in Fedora 40, but you can follow these steps in other distributions as well.

Step 1: Install DisplayCal and start it

This sounds easy, but

  • it’s not packaged for Fedora. That’s being worked on, but right now it’s not an option | edit: turns out there is a COPR for it
  • installing it with pip just gave me a bunch of compilation errors, and I haven’t figured out how to fix them
  • the package on Flathub is really old and broken

To work around that, I used distrobox to install the Arch Linux package for DisplayCAL:

sudo dnf install distrobox
distrobox create --name archinabox --image archlinux:latest
distrobox enter archinabox
sudo pacman -S displaycal
distrobox-export --app displaycal
exit

After running these commands, DisplayCAL can be started from any app launcher, like Kickoff or KRunner.

Step 2: Setup

To get correct measurement results, the compositor needs to pass the pixel data from the profiling app directly to the display, and not do any color management itself. This will be automated at some point, but for now you need to manually ensure that

  • HDR is disabled
  • the color profile of the display is set to “None” in the display settings
  • night light is off, or at least suspended in the system tray
  • all KWin effects that modify colors, like the color blindness correction effect, are disabled
  • if you’re on a new-ish AMD laptop and want to profile the internal display, that you’re either plugged in to a power source, or have the power profile set to performance, to disable a power saving feature that changes the colors

display settings

Now start DisplayCal and head to the Calibration tab. Here it’s important to set the tone curve to “as measured”, and untick interactive display adjustment, as those don’t work correctly right now and will mess up the profile.

DisplayCAL profiling tab

You’ve done everything correctly if the button on the bottom of the application shows “Profile only”.

Last but not least, you also need to adjust the display settings to what you want to use with the profile later, as the profile is only correct for one specific set of display settings. This includes the brightness of the display!

Step 3: Profile

In the profiling tab of DisplayCAL, select your desired settings - in most cases the default will be sufficient - and click “Profile only”. When it asks if you want to continue with the current calibration curves, select “use linear calibration instead” and de-select “embed calibration curves in profile”. Then put the colorimeter in the center of the screen, and let it do its thing.

DisplayCAL warning

Once it’s done, it’ll ask you to install the profile. Installing it will not automatically enable that profile to be used, but it’ll save the profile in ~/.config/color/icc/devices/display/ and you can select that file in the display settings.

Step 4: Verification (optional)

If you’d like to make sure the profile is correct or accurate enough, you can use DisplayCAL to verify the result. Make sure you’ve set the profile in the display settings, switch to the verification tab in DisplayCAL and select your newly created profile in the “settings”

Here again, because DisplayCAL doesn’t support Wayland yet, you need to adjust a few settings for everything to work correctly. You need to select the simulation profile “Rec.709 ITU-R BT.709”, select “Use simulation profile as display profile” and set the tone curve to “Gamma 2.2”. Afterwards, click on “Measurement report”, choose a location to save it in, put the colorimeter in the center of the screen again and wait for it to complete.

DisplayCAL verification tab

Don’t be alarmed if the result says the whitepoint is wrong, this is simply caused by DisplayCAL assuming we want to target the whitepoint of the simulation profile, which doesn’t necessarily match the whitepoint of your display.

What about calibration though?

To calibrate the display, that is, to adjust brightness, tone curves for non color managed applications and the whitepoint of the display, DisplayCAL uses an X11 API to set the gamma lookup tables of the GPU. That API doesn’t work in the Wayland session and the profiling process doesn’t handle that situation properly, which is why all calibration needs to be disabled for the created profile to be correct.

DisplayCAL (or ArgyllCMS, which does the actual profiling) could add support for applying a lookup table in the application instead of having the compositor do it, but we can also handle calibration entirely on the compositor side instead, which offers a bit more flexibility.

Changing the tone curves for non color managed applications doesn’t make sense in the Plasma Wayland session, as all windows are always color managed, so that part is already dealt with. Adjusting the brightness on screens that don’t have any native means of brightness control is already implemented for Plasma 6.2, and I have a working proof of concept for changing the whitepoint of the display without needing a new ICC profile too, so we should be at feature parity soon. I’ll talk more about these adjustments in a future post.

Week 7 of my 14-week GSoC project has finished, which means that it’s time for a midterm update! Many things have happened since the last update.

I added support for KI18n, KGuiAddons, KNotifications, KUnitConversion and KXMLGui. That was faster than expected. I also created a small unit conversion demo using KUnitConversion (it’s written in Python):

Unit Converter Demo

We have decided to move on to upstream the bindings to their corresponding repositories. For that, I set up a development environment and I’m now adding the code to each library.