Skip to content

Sunday, 30 July 2023

A neat trick to debug the keyboard navigation in your QML application is to put the following code snippet in your main.qml:

Kirigami.ApplicationWindow {
 ...

 title: activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "")

 ...
}

Afterward, then you open your application, you will see the following in your title bar:

Title bar containing the following text: PrivateActionToolButton Sort - Merkuro Calendar
Title bar containing the following text: PrivateActionToolButton Sort - Merkuro Calendar

“PrivateActionToolButton_QMLTYPE_XX(0x00000000)” is the type and address of the actively focused item and “Sort” is the accessible name of this item.

If you tab around your application, you will be able to identify multiple issues quickly:

Missing Accessible.name

You might notice that some elements only display their type and address but accessible name. It is an issue because this means the screen reader user won’t have any clues about what the button does.

If this is the case, ensure that your control has a text property set even if the control itself overrides the contentItem or is an icon only button. If you can’t use the text property, try to set the Accessible.Name property instead.

HTML code in your text

If you see some HTML code appear in your toolbar, it is an issue. Screen readers will be confused by the random XML tags in your text, so make sure to remove them from the Accessible.Name. A simple fix which works in some simple cases is to do the following to clean up your text:

QQC2.Label {
 text: "Hello <b>World</b>"
 Accessible.name: text.replace(/<\/?b>/g, '')
}

Not clear Accessible.Name

By default, your Accessible.name of your controls is bound to their text, which is a good default but you shouldn’t hesitate to add some mode details in your Accessible.Name.

One example, I had in Merkuro (formally known as Kalendar) was in the month view. There each day had as text the month number. In this case, it’s better to expose the whole date to the accessibility API, because without, context a number is not that useful.

Focused but not visible

Some items are focused but are not visible on the screen. This often happens when using a PathView/ListView with only one item visible at the time, since the previous and next item are still loaded. If this is the case, ensure that activeFocusOnTab is set to false, when the item is not visible.

Focused but no visual indicator

Some items are focused but they don’t have a focus indicator. This is an issue since the user won’t able to know which item is currently focused and then pressing space they might trigger a random action.

There is an helpful property in QQC2.Control named visualFocus which should be true when the user uses keyboard navigation to focus on a specific item. So make sure to add for example, a special border when QQC2.Control.visualFocus is true to your custom controls.

// MyButton.qml
QQC2.Button {
 id: root

 background: Rectangle {
 border {
 width: root.visualFocus ? 1 : 0
 color: Kirigami.Theme.highlightColor
 }
 }
}

The type information can gives you a valuable information to find which item is currently selected and has the broken focus.

Focus loop

In some cases, when pressing tab multiple times, you will end up in a focus loop with no way to escape it. This might be caused by broken usage of the KeyNavigation.tab property, dynamic reparenting of elements and other creative ways to break the tab navigation. In case, please fix it!

Unfocusable elements

Make sure all your interactable elements in your application are focusable by default. You can enable or disable this behavior, with the activeFocusOnTab property of Ìtem.

Friday, 28 July 2023

The OpenUK Awards are open for nominations for 2023.

Awards timetable

  • Nominations open 28th July 2023
  • Nominations close midnight UK 19th September 2023 (this will not be extended)
  • Shortlist of up to 3 nominees per category announced 18th October 2023
  • Winners Announced 20th November 2023: Black Tie Awards Ceremony and dinner at House of Lords sponsored by Lord Vaizey, 6-10.30pm, tickets limited 

Self nominations are very welcome. If you know fit into the categories or have a project or company which does or know anyone else who does then fill in the form and say why it’s deserved. You might get fame and glory or at the least a dinner in the house of lords.

Tuesday, 25 July 2023

Quick reminder, that you can include a Mastodon or Matrix link to your AppStream file and that the link will then be displayed in your application page at apps.kde.org.

<custom>
 <value key="KDE::matrix">#merkuro:kde.org</value>
 <value key="KDE::mastodon">https://kde.social/@merkuro</value>
</custom>

Details on apps.kde.org showing the link to the mastodon account and matrix channel
Details on apps.kde.org showing the link to the mastodon account and matrix channel

Monday, 24 July 2023

Akademy 2023 🔗

Carl Schwan CarlSchwan 18:00 +00:00
RSS

Last week, I went to Akademy, the yearly KDE conference, in Thessaloniki. This is now my third in-person Akademy and fifth Akademy in total. As always, this is the occasion to meet old and new friends, learn about what others are hacking on and enjoy good food.

Friday

I arrived Friday afternoon, taking my flight from Nuremberg with a few others. Getting out of the airport, we could immediately feel the heat. After leaving our stuff at the hotel, we went to join the rest of the KDE folks at the welcome event in a frindly and cozy bar.

Saturday

On Saturday, I talked about the current state of the Accessibility (a.k.a KDE For All) goal. In short, we are making progress on that and fixing bugs everywhere in the stack, but we desperately need more community involvement as the task is big. Hopefully, the Selemiun AT-SPI bridge can be helpful, as it makes it possible to write integration tests using the accessibility API which require some accessibility support in your application to work. (Slides)

Me in a pannel with Joseph and Nate
Me in a pannel with Joseph and Nate

I also presented the Fundraising WG report. We had two successful fundraising campaigns this year: Kdenlive and the end of the year campaign. (Slides)

My highlight for the day was the KDE Embedded talk from Andreas. The talk explained the progress in getting the whole KDE software packaged as Yocto layers, which already allows us to build images for RISC-V and ARM devices with Plasma BigScreen. There is definitively a lot of potential there to get KDE technologies in a wide varieties of devices. A recent example is KWin being integrated inside Mercedes cars’ infotainment system, resulting in various upstream improvements. (Slides)

Sunday

On Sunday, I had a talk with Tobias Fella about Matrix and Mastodon and how we can integrate these protocols inside our applications in various ways. First, by providing clients for these protocols: NeoChat (Matrix) and Tokodon (Mastodon), but also with less oblivious ways like using Mastodon as a comment system on your blog or by using Matrix to share your KDE Itinerary live data end-to-end encrypted with your friend without requiring a centralized server. (Slides)

My highlight for Sunday was the Selenium GUI Testing talk from Harald, which is closely related to my Accessibility goal and Automatisation goal from Nate. (Slides)

The lightning talks were also excellent. Kai showed off his integration of AlphaCloud inside Plasma to get his solar pannel stats. (Slides)

KInfoCenter module showing both live and historic photovoltaic information

Jean-Baptiste Kempf (from VLC) presented his cross-platform remote control software stack in Rust, which promises very low latency.

Fabian Kosmale from the Qt Company Group presented the qmllint tool, which should really helps improve the quality of our software and reduces the risk to accidentally create regressions in our QML applications. I’m looking forward to using it on my applications and to building custom plugins for it. (Slides)

Finally, Nate presented the new Plasma Welcome wizard, which is great! (Slides)

Bofs

The rest of the week, we had “Birds of a Feather” (or BoF) which were particularly productive. I (co-)hosted multiple BoFs this year: Plasma Mobile, NeoChat, KDE PIM and Accessibility, but I also enjoyed a few other BoFs: the fundraising BoF where Victoria gave us a lot of advice on how to do fundraising for non-profit and the KDE e.V. board office hour or the Selemiun BoFs from Harald and a few others.

Myself hacking on my computer during a bof
Myself hacking on my computer during a bof

Day trip

We went to Mount Olympus, Dion, and a beach for our day trip. As a ancient Greece nerd, I enjoyed it! Here are some photos from the trip:

Dion archelogical park
Dion archelogical park

Dion Museum of archelogie
Dion Museum of archelogie

Mount Olympus
Mount Olympus

Beach beer
Beach beer

Trainings

We also had training at Akademy. I participated to the one from Nuno (thanks, KDAB for offering it) about Qt Design Studio, a very powerful QML visual editor and with a bridge to Figma. Unfortunately, I couldn’t attempt this training fully because it conflicted with a BoF I was hosting, but the bit I saw there was very interesting. It would be great if we could integrate Kirigami components inside this tool.

Nuno presenting his training
Nuno presenting his training

My conference badge On Friday Akademy 2023 came to a close. This was the second time I attended the conference physically after the online editions of 2020 and 2021 and I want to give short retrospective this blog post.

Talks

Akademy started with two days full of talks on Saturday and Sunday and I have to say sometimes it was hard to choose between the two parallel tracks. Overall it provided a nice mixture between what happens in the community, learning how people solved problems and learning from them (for example Ingo fixing accessibility in Kleopatra) and insight into new technologies (I had never heard of Slint before). Apart from the two standout keynotes about Kdenlive and the Libre Space Foundation I want to highlight Joseph’s talk about Internal Communication at KDE which it turns out also projects outwards for example to new potential contributors. The talk itself was well structured and presented and had engaged with the audience nicely as well.

This year I did not submit a talk myself but stood in for Albert for an update about what’s happening in the KDE Free Qt Foundation and in the KDE e.V. KDE Free Qt Working Group during the KDE e.V. Working Group reports. since he had a talk at the same time in the other room.

I also tried something new and held a panel in the “KDE Wayland Fireside chat” together with Aleix, David Edmundson, Vlad and Xaver which was intended to be an opportunity to interact for people with their favourite KDE Wayland developers. I think it turned out nicely with very good online participation - probably half of the question came from chat! The size of the physically audience was maybe less than what I would expected beforehand but we had very strong opposition with the lighting talks happening at the same time in room 1 while we were the last session in room 2. Speaking of them, I am looking very much forward to watch the recording of them and all the other talks that I missed because I was in another room.

BoFs and all the other things

After the talks come the BoFs, where people meet, discuss, plan, roadmap and workshop together. My personal self-selected schedule consisted among other things of a whole lot of KF6, Plasma 6 and to round it out more KF6. We discussed what is left to do, challenges left, and even potential roadmaps to release. Here the strong presence of people from the Qt Group proved valuable as they could help with some challenges we are facing and were interested in some problems we faced along the way. We even discovered that we share common interest into improving some areas of Qt.

Thursday was dominated by Wayland discussions. It started with a discussion on input methods and virtual keyboards where we recapped what’s happening upstream, how this fits to our needs and vision of Plasma. Afterwards we discussed some challenges of Qt on Wayland with regards to its QInputDevice API. This session showed again how useful it is to have Qt and KDE people in the same room as the discussion switched quickly from outlining missing features to making gestures and scrolling work nicely in Qt and for application developers in a Wayland world using existing infrastructure.

But Akademy is not only the things that are on the official schedule. It’s meeting familiar and new faces at the welcome and social events. It’s going on to the day trip together. It’s having a spontaneous Itinerary almost BoF in hacking room. It’s going to and having dinner together after an exhausting day. And of course it’s sometimes also just hanging out and chilling with cool people. So thanks to the KDE e.V, the Akademy team and all the volunteers who made this awesome event possible.

Akademy, KDE’s annual conference, recently took place in Thessaloniki, Greece. Lots of people were super excited about the prospect of getting GUI Testing off the ground based on the Selenium tech I built last year. Since KDE produces cross-platform applications an obvious question arose though…

What about Windows?

It’s surprisingly easy! Indeed the most time consuming part is probably getting your hands on a Windows Development Virtual Machine. Once you have a Windows installation we need to only spin up our toolchain and off we go. Here’s a handy command list:

\# Download and install WinAppDriver: https://github.com/microsoft/WinAppDriver/releases

winget install openjs.nodejs
winget install python.python.3.11

npm install --location=global appium
# restart terminal to apply PATH change
set-executionpolicy -scope currentuser remotesigned # allow script execution
appium driver install --source=npm appium-windows-driver

pip install appium-python-client
appium # start server, needs firewall exception on first start

Before we go further into the nitty gritty of testing on Windows I suggest you read the earlier blog post Selenium + AT-SPI = GUI Testing, since a lot of the concepts are the same regardless of platform.

First let us get our ducks in a row.

What Accerciser is to Linux is inspect.exe to Windows, namely an inspector tool for applications. You can find it in your Windows SDK folder %ProgramFiles(x86)%\Windows Kits\10\bin\10.0.22000.0\x64\inspect.exe or there abouts. Opening it greets you with this beauty:

Ignoring the verbosity for a moment we’ll note that it contains similar information to Accerciser on Linux, albeit in a more flat overview. Most importantly what is called the AutomationId is constructed from QObject objectNames, similar to the Accessible IDs on Linux. This is insofar interesting as it means we have a couple of avenues for cross-platform element locating - specifically we could match elements by their name (e.g. the text of a Label or Button), or more uniquely by their objectName-based ID (applicable to all QObjects).

For the purposes of this post we’ll do some trivial testing on Filelight and try to make it work for both Linux and Windows by using the element names. Relying on objectNames is more reliable but unfortunately requires some retrofitting in the source code. To avoid having to build Filelight on Windows we’ll work with what we have got: names. Let’s write our test. Don’t forget to install Filelight first :)

First thing, as always, is our setup boilerplate

#!/usr/bin/env python3

# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023 Harald Sitter <sitter@kde.org>

import unittest
import sys
from appium import webdriver
from appium.options.windows import WindowsOptions
from appium.options.common import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected\_conditions as EC

class SimpleFilelightTests(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        options = WindowsOptions()
        options.app('KDEe.V.Filelight\_7vt06qxq7ptv8!KDEe.V.Filelight')
        self.driver = webdriver.Remote(
            command\_executor='http://127.0.0.1:4723',
            options=options)

    @classmethod
    def tearDownClass(self):
        self.driver.quit()

if \_\_name\_\_ == '\_\_main\_\_':
    unittest.main()

The only really interesting bit here is how we specify the application on Windows. Since Filelight is a store application we can start it by the Application User Model ID (AUMID) instead of a path; this is pretty much the same as starting by-desktop-file-id on Linux.

Now then. With the boilerplate out of the way we can write an incredibly simple test that simply switches pages a bit: If we click on ‘Scan Home Folder’ it should take us to the scan page and clicking there on ‘Go to Overview’ should take us back to the overview page.

    def test\_scan(self):
        self.driver.find\_element(by=AppiumBy.NAME, value="Scan Home Folder").click()
        overview = WebDriverWait(self.driver, 120).until(
            EC.element\_to\_be\_clickable((AppiumBy.NAME, "Go to Overview"))
        )
        overview.click()
        WebDriverWait(self.driver, 4).until(
            EC.element\_to\_be\_clickable((AppiumBy.NAME, "Scan Home Folder"))
        )

Cool. We now can test Filelight on Windows. Next we should try to make this test also work for Linux. Thankfully we only need to switch out our app name for a desktop file id.

    def setUpClass(self):
        if sys.platform == 'nt':
            options = WindowsOptions()
            options.app = 'KDEe.V.Filelight\_7vt06qxq7ptv8!KDEe.V.Filelight'
        else:
            options = AppiumOptions()
            options.set\_capability('app', 'org.kde.filelight.desktop')

Putting it all together we get our final test which runs on both Linux and Windows.

\# Windows
# start appium in a terminal
python .\\test.py

# Linux selenium-webdriver-at-spi-run ./test.py


The complete test code:

#!/usr/bin/env python3

SPDX-License-Identifier: MIT

SPDX-FileCopyrightText: 2023 Harald Sitter sitter@kde.org

import unittest import sys from appium import webdriver from appium.options.windows import WindowsOptions from appium.options.common import AppiumOptions from appium.webdriver.common.appiumby import AppiumBy from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC

class SimpleCalculatorTests(unittest.TestCase):

@classmethod
def setUpClass(self):
    if sys.platform == 'nt':
        options = WindowsOptions()
        options.app = 'KDEe.V.Filelight\_7vt06qxq7ptv8!KDEe.V.Filelight'
    else:
        options = AppiumOptions()
        options.set\_capability('app', 'org.kde.filelight.desktop')

    self.driver = webdriver.Remote(
        command\_executor='http://127.0.0.1:4723',
        options=options)

@classmethod
def tearDownClass(self):
    self.driver.quit()

def test\_scan(self):
    self.driver.find\_element(by=AppiumBy.NAME, value="Scan Home Folder").click()
    overview = WebDriverWait(self.driver, 120).until(
        EC.element\_to\_be\_clickable((AppiumBy.NAME, "Go to Overview"))
    )
    overview.click()
    WebDriverWait(self.driver, 4).until(
        EC.element\_to\_be\_clickable((AppiumBy.NAME, "Scan Home Folder"))
    )

if __name__ == ‘__main__’: unittest.main()


Discuss this blog post on [KDE Discuss](https://discuss.kde.org/t/writing-selenium-appium-tests-on-windows/3145).

Saturday, 22 July 2023

Monday, 17 July 2023

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

Dependency freeze is next July 20

The Feature Freeze and Beta is Thursday 27 of July.

More interesting dates  
  August 10: 23.08 RC (23.07.90) Tagging and Release
  August 17: 23.08 Tagging
  August 24: 23.08 Release

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

Sunday, 16 July 2023

During this week Akademy 2023 is going on in Thessaloniki, Greece. It’s always awesome, to see many old friends and getting together with that amazing hacker community which is KDE.

There, me and Niccolò gave a talk about what;s happening in Plasma 6 and what will change, Noccolò on more visual things, about some changes we are cooking on the UI and on the visual themes. Here you can find a recording of the talk (alongside all the others of the day)

I talked more about the work I’ve bein doing in the Plasma shell during the last couple of months: code rafactors and how the API for writing plasmoids will change.

There were many things we were not quite happy about and now with the major release is the occasion for streamlining many things.

Now, It’s very important those changes are are well communicated, and easy to do for developes, because there are *a lot* of 3rd party plasmoids on the KDE store, which people are using and enjoying.

Let’s go trough the most important changes:

Dataengines

Dataengines were an API designed in early KDE 4 times, especially one of for our first offereings of Plasmoid API which was the pure JavaScript API, which existed long before the QML existed.

But now in a QML world, their API doesn’t really fit, instead is a much better fit having a QML extension which offers classes with all the needed properties, data models and signals that provide access to the needed data, such as tasks, notifications etc.

Dataengines are now deprecated and moved into a separed library, called “plasma5support” which will be still available for the time being, but consider porting away from it as we plan to eventually drop it.

Base Plasmoid API

The way plasmoids are declared in QML changed a bit: we used to have a magical “plasmoid” context property available from anywhere. This was an instance of a QQuickItem which was both the item where all the plasmoid contents were *and* a wrapper for some of the api for the central plasmoid object: the C++ class Plasma::Applet.

Now the access to plasmoid is an attahced property, the (uppercase) “Plasmoid”, which is directly the access to the instance of the central Plasma::Applet, without an in-between wrapper anymore.

The central QQuickItem is now called “PlasmoidItem”, and must be the root item of the plasmoid, just alike ApplicationWindow is for applications.

PlasmoidItem will have the purely graphical properties, such as the “compactRepresentation” or “fullRepresentation”

Here is a very minimal example of a plasmoid main file under plasma6:

import org.kde.plasma.plasmoid 2.0
PlasmoidItem {
    Plasmoid.title: i18n("hello")
    fullRepresentation: Item {....}
}

Actions

Plasmoids can export actions to their right mouse button menu, such as “mute” for the mixer plasmoid and so on.

In Plasma 5 we had an imperative API to add those actions, which was again coming from that old pure JS API, which really looked a bit out of tune in QML. In Plasma 6 the API has been replaced with a completely declarative API, in this form:

PlasmoidItem {
    Plasmoid.contextualActions: [
        PlasmaCore.Action {
            text: i18n("Foo")
            icon.name: "back"
            onTriggered: {...}
        },
        PlasmaCore.Action {
             ...
        }
    ]
}

PlasmaCore.Action is actually a binding to QAction (not the internal QML action type), so that it can be shared between C++ and QML easily

SVG theming

Plasma Themes don’t really have changed for now (and you can expect any old theme from the store to keep working), but the C++ and QML API for them has been moved to a standalone framework called KSvg. Plasma Svgs have quite some interesting features over the pure QtSvg API, such as disk caching of the rendered images, stylesheet recoloring to system colors and the 9 patch rectangular stretched images of FrameSvg.

Some applications were interested in using that, but couldn’t due to the long dependency chain of plasma-framework, so now they can be used as a much more manageable compact framework, offering both the usual C++, QPainter based api and QML bindings.

import org.kde.ksvg 1.0 as KSvg
FrameSvg {
    imagePath: "widgets/background"
}

Kirigami all the way down

Designing Kirigami in the beginning we lifted two concept from the Plasma API (which again we couldn’t use directly due to the dependency chain) Theme and Units

Theme gives access to the named system colors, and Units to standard spacing and animation durations.

Over the years the Kirigami version got way more advanced then the Plasma version, and having this code duplication didn’t make much more sense, to in Plasma6 whenever referring to a named color or an unit, the Kirigami version should be used, as the Plasma version is going away.

import org.kde.kirigami 2.20 as Kirigami
RowLayout {
    spacing: Kirigami.Units.smallSpacing
    Rectangle {
        color: Kirigami.Theme.backgroundColor
        bordere.color: Kirigami.Theme.textColor
    }
}

Wednesday, 12 July 2023

Today we are announcing the availability of the minor patch release 2.10.1. This release contains minor improvements and bug fixes only. The fixes are distributed over many different areas of the application and we recommend everybody update to this patch release which is available from our download page.

The full list of fixes included in this patch release are as follows:

  • Support markdown library discount version 3
  • Improve Vector BLF dependency (git download must be enabled if needed)
  • Correctly use system header of system QXlsx (BUG 468651)
  • Fix group separator problem in formulas (BUG 468098)
  • Improve log scales (auto scaling and tick number)
  • Improve auto scale (Issue #536)
  • Fix limits when changing scales (Issue #446)
  • Use system liborigin headers if linking against system liborigin (BUG 469367)
  • Properly import UTF8 encoded data (BUG 470338)
  • Do not clear the undo history when saving the project (BUG 470727)
  • Properly react on orientation changes in the worksheet properties explorer
  • In the collections of example projects, color maps and data sets also allow searching for sub-strings and make the search case-insensitive
  • Properly set the size of the worksheet in the presenter mode if “use view size” is used
  • Properly save and load the property “visible” for box and bar plots in the project file
  • Fix copy&paste and duplication of box and bar plots
  • Fix issues with loading object templates (BUG 470003)
  • Fix crash when loading projects with reference ranges
  • .xlsx import corrections:
    • fix crash importing empty cells
    • support datetime import (Issue #531)
  • Properly set the initial properties of the reference line, like line width, etc. (Issue #580)
  • Properly show the initial value of the property “visible” for the reference range (Issue #582)
  • React to Delete and Backspace keys to delete selected cells in spreadsheet columns (Issue #596)
  • Update the plot legend on column name changes used in box and bar plots (Issue #597)
  • Fix the positioning of values labels for horizontal bar plots (Issue #599)
  • Initialize the parameters for the baseline subtraction with reasonable values on first startup and improve the appearance of the preview plot

We are also working on the new features and improvements that will arrive in the next 2.11 release. This release will become available in the coming months. More on this in the next blog posts. Stay tuned!