As someone who is collaborating with an international group of nice and smart people every day, it might not come as a surprise that I am opposed to all those parties that keep blaming migration and foreigners for every political failure. Let us try to support the innocent people who are being attacked by terrorist groups or nations. Way too many parties are hostile towards people who try to have a happy, honest life while ignoring or understating the importance of fair taxation and reducing greenhouse gas emissions.
You might say: “But all the parties are corrupt!” – Well, true. In every group there is a share of psychopaths. We even have some in KDE! (Surprisingly few though!) This should not deter you from contributing. Please be the change you want to see in the world and vote for the party that sucks the least! Or don't, it's your life and I am not your mom. Thanks for reading. :^)
A few weeks ago (Time flies!) I attended the KDE Goals Sprint in Berlin. I didn't have concrete plans, but I intended to look into accessibility. Quite some time ago I had improved the accessibility of Kleopatra and at Akademy 2023 in Thessaloniki I gave a talk about it. Back then I had taken the easy route fixing everything directly in Kleopatra and working around several issues in Qt instead of fixing the issues in Qt itself so that all apps could profit. Time to do something about it.
(In-)Accessible icon-only buttons
A common problem for accessibility is icon-only buttons. If a button doesn't have text then screen readers can only tell their user that there's a button. That's not very helpful. Sometimes the developers have at least assigned a tool tip to the button. This can be read out by the screen readers (Qt provides the tool tip as accessible description of the button.), but it's often too verbose. To make a button without text accessible the developer has to set the accessible name property of the widget or, in case of a Qt Quick app, the name property of the Accessible QML Type. Unfortunately, that's often forgotten if the UI isn't designed with accessibility in mind.
At the sprint I discussed several ideas with other participants to help developers remember to set the accessible name:
A helper class to instantiate in your app which inspects the app's windows and prints a report at the end with all inaccessible icon-only buttons it has found. A bit like Qt's QAbstractItemModelTester or the different compiler sanitizers. I implemented a prototype of such a class, but didn't pursue this further. The downside of this approach is that the developer needs to open each window of the app to find all inaccessible buttons. If they are already aware of the problem then it's probably easier to search the code.
Instead of using a helper class to inspect the widget tree from the inside one could inspect the accessibility tree of the app from the outside. This could be built into our Appium-driven UI test framework so that developers don't have to do anything special. Except that they need to write UI tests that open each and every window of their app. I think it's still worth to look into this.
Last but not least, we pondered writing a clazy test. Thinking about the many different ways a text can be set on a button (e.g. with KGuiItem::assign) we doubted that it would be feasible to write such a test.
In the end the easiest approach could be education. If the developers are aware of the problem then there's a good chance that they remember to set an accessible name the next time they add an icon-only button to their app.
Accessible date/time inputs
Volker, Carl, David, Harald and me discussed and explored some ideas to make the date and time inputs in Qt Quick apps like Itinerary accessible. In Kleopatra I resorted to allow the user to enter the date in a simple text input instead of trying to make the complex UI of KDE's date picker accessible. Read Volker's blog and David's blog to find out which solutions they found for Qt Quick apps.
A small automation interlude
One advantage of sitting with other people in the same room is that you may overhear them talking about a mistake (e.g. a faulty commit) and you know exactly how to prevent this kind of mistake in the future. In this case the problem was a missing quote character in some YAML file. And the preventive measure was adding a YAML linter CI job. While I was at it I removed some unnecessary code from the CI job and added the job to a second repository.
List views with underlying multi-column model
In several widgets that show or use a simple list of items Qt allows using a model with multiple columns, e.g. QListView, QComboBox, QCompleter. In general this works well except that Qt has a long-standing bug: When navigating through the list screen readers read the entries of the underlying model column by column instead of reading only the entries in the selected model column (QTBUG-33786). In Kleopatra I worked around this bug with a proxy model which pretended that the model only had one column.
During the sprint I finally sat down and prepared a fix for Qt. For better readability I split my changes in five separate commits which resulted in five separate patches for Qt: 556857, 556858, 556859, 556860, 556861. Being used to multi-commit MRs in GitLab I wondered if I had done something wrong when I submitted my changes, but apparently that's Gerrit's way of handling patch reviews. The first two commits are code clean-ups, the third commit changes one aspect of the accessibility test for list views, the fourth commit is the actual fix, and the fifth commit adds a few more unit tests I find useful. The first three commits have been merged, but the actual fix is still waiting for a review.
After that I looked into the problem that QListView emitted an accessibility focus event when the current item changed even if the list view didn't have focus. I found out that this had been fixed recently by a fellow Qt contributor who ran into the same problem independently of me. This meant that I could remove the workaround in Kleopatra for new enough Qt.
Thanks to MBition for hosting us and to Aleix for making sure we don't starve. And many thanks to those donating to KDE which makes these sprints possible.
The MarkNote team is happy to announce the 1.2 release of MarkNote, KDE’s
WYSIWYG note-taking application. Marknote lets you create rich text notes and
easily organise them into notebooks. You can personalise your notebooks by
choosing an icon and accent color for each one, making it easy to distinguish
between them and keep your notes at your fingertips. Your notes are saved as
Markdown files in your Documents folder, making it easy to use your notes
outside of Marknote as well as inside the app.
Notes management
This releases brings highly wanted features like the ability to choose a custom
folder where to store your notes. Mathis Brüchert also added the ability to
change the sorting of notes from alphabetically to by date.
Mathis made the sidebar collapsable and added a focus mode where everything but
the editing page is displayed.
Finally if you prefer to just use Marknote as a Markdown editor, we made it
possible to just open any markdown files directly from the file browser or the
console. Additionally Marknote supports markdown files with a so called front
matter, which is a common way to inject metadata to markdown in static website
generators like Hugo and Jekyll.
Editing
In term of edition support, the subset of markdown supported increased again.
Now it is possible to add and edit tables.
Additionally we started transforming inline markdown directly to rich text as
you type. Support is limited to a few markdown constructs but is likely to
grow over time.
You can now customize the font used by editor.
Aside from being able to edit text, it’s now possible to also create sketches
directly from MarkNote.
Mobile Support
Mathis took care of ensuring MarkNote was fully usable when used with Plasma Mobile.
Windows and macOS support
Marknote now provides nightly builds for Windows and macOS. While the Windows
builds should be fully usable, the macOS build still has an issue where most
icons are not displayed. This should be fixed as soon as we can make use of
the new KIconTheme version.
As part of the work to improve the macOS support, Marknote also gained global
menu support for Linux.
Others
The command bar will show translated shortcuts. (Laurent Montel)
Unify spelling of MarkNote and fix typos in the README.md (Jonah Brüchert)
Get Involved
Mathis created a Matrix channel for MarkNote:
#marknote:kde.org. There is
also still a lot of small improvements that can be done everywhere and which
don’t require a lot of programming experience. Take a look at these two tasks
!31 and
!27 for some inspiration
on what you could work on.
classAA { public: virtualvoidprint(){ cout << "in class AA" << endl; }; };
classBB :public AA { public: voidprint(){ cout << "in class BB" << endl; }; };
voidtestDynamicCast(){ AA* a1 = new BB; // a1是A类型的指针指向一个B类型的对象 AA* a2 = new AA; // a2是A类型的指针指向一个A类型的对象
BB* b1, * b2, * b3, * b4;
b1 = dynamic_cast<BB*>(a1);// not null,向下转换成功,a1 之前指向的就是 B 类型的对象,所以可以转换成 B 类型的指针。 if (b1 == nullptr) cout << "b1 is null" << endl; else cout << "b1 is not null" << endl;
b2 = dynamic_cast<BB*>(a2);// null,向下转换失败 if (b2 == nullptr) cout << "b2 is null" << endl; else cout << "b2 is not null" << endl;
// 用 static_cast,Resharper C++ 会提示修改为 dynamic_cast b3 = static_cast<BB*>(a1);// not null if (b3 == nullptr) cout << "b3 is null" << endl; else cout << "b3 is not null" << endl;
b4 = static_cast<BB*>(a2);// not null if (b4 == nullptr) cout << "b4 is null" << endl; else cout << "b4 is not null" << endl;
a1->print();// in class BB a2->print();// in class AA
b1->print();// in class BB //b2->print(); // null 引发异常 b3->print();// in class BB b4->print();// in class AA }
So, recently, I shifted some of my workload to kde. And I started my KDE journey with KDE Neon. Even with a 2 year old base and packages, snaps and ppas saved me. Now, one of the important part of my work was to clone the repo using ssh. And here comes the problem.
In gnome, the gnome-keyring and the seahorse would automatically manage my ssh and gpg key passphrases. But, in KDE, that didn’t happen. On the starting I was getting frustrated with the ssh always asking me the passphrase. Then after a lot of reading manuals and internet searching, I found out about ksshaskpass. This can be used to write my passphrase and there I can set it to remember my passphrase, which it would essentially save in kwallet. So, How did I set this up?
I was there as part of the Automation & Systematization sprint given my involvement in the release process, the "not very automatized" weekly emails about the status of CI about KDE Gear and KDE Frameworks, etc. but I think that maybe I was there more as "person that has been around a long time, ask me if you have questions about things that are documented through oral tradition"
I didn't end up doing lots of work on sprint topics themselves (though I participated in various discussions, did a bit of pair-programming with Aleix on QML accessibility issues, inspired DavidR to do the QML-text-missing-i18n check that he describes in his blog); instead I cheated a bit and used the sprint to focus on some of the KDE stuff I had a bit on my backlog, creating the KDE Gear release/24.05 branches and lots of MR reviewing and more!
Thanks KDE e.V. for sponsoring the trip, if you would like such events to continue please we need your continued donations
And remember Akademy talk submission period ends in 10 days, send your talk now!
A new revision of digiKam Recipes is available for your reading pleasure. The new version covers the auto tagging feature introduced in digiKam 8.3 and explains how to run digiKam in a container.
If you bought the book through Gumroad, you’ll find the new revision in the Library section. The book purchased through Google Play should be updated automatically to the latest version. If you have problems getting the latest revision of the book, contact the author at dmpop@cameracode.coffee
In a previous post I talked about using the QML Language Server for KDE development. Since writing that post a few things happened, so it’s time for an update.
I mentioned that when using Kate qmlls should work out of the box when opening a QML file. That’s mostly true, there is one problem though. Depending on your distribution the binary for qmlls has a different name. Sometimes it’s qmlls, sometimes qmlls6 or qmlls-qt6. You may need to adjust the LSP Server settings in Kate to match the name on your system.
In order for qmlls to find types that are defined in your application’s C++ code those must not only be declaratively registered, qmlls also needs to be told where to find the type information. Fortunately Qt 6.7 comes with a handy way to do that. By passing -DQT_QML_GENERATE_QMLLS_INI=ON to CMake you get an appropriate config file generated. This will be placed into the project’s source directory but is specific to your setup, so add that to your gitignore file (PS: You can set up a global gitignore file for your system, so you don’t need to add this to all your projects). Unfortunately the initial implementation produced wrong configurations for some modules, but this is fixed in Qt 6.7.2.
A problem I mentioned is that qmlls doesn’t find modules that are not installed into the same path as Qt. With Qt 6.8 there will be two new options. The -I parameter allows to add custom import paths to qmlls’ search paths. The -E parameter makes qmlls consider the value of the QML_IMPORT_PATH environment variable for its search paths.
In order for qmlls to work properly modules need to be created using the CMake API and use declarative type registration. Since writing the last post some KDE modules have been converted to those, but there’s still more to do.
Thanks to the QML team for those swift improvements!
Kirigami Addons 1.2 is out with some accessibility fixes and one new component:
FloatingToolBar.
Accessibility
During the accessibility sprint, there was an effort to ensure the date and
time pickers were actually accessible. Aside from improving the screen reader
support, this also allow to write Selenium integration tests which uses these
components in Itinerary. Thanks Volker, David Redundo and others for working
on this!
FloatingToolBar
Mathis and I worked on a new addition to Kirigami Addons adding to the existing
FloatingButton and DoubleFloatingButton components. This component is perfect
to add tool to editing and drawing areas and can either contain a simple
RowLayout/ColumnLayout containing ToolButtons or a Kirigami.ActionToolBar.
With the style used by FormCardDialog and MessageDialog merged in
Kirigami and soon in
qqc2-desktop-style
too, I did some changes to the FormCardDialog and MessageDialog to use the
same padding as Kirigami.Dialog.
MessageDialog now works better on mobile with the layout adapting itself to the dialog size.
messagedialog with a mobile layout
Aditionally similar to KMessageBox, MessageDialog has an optional “don’t show again” option
which can be enabled by setting the dontShowAgainName property similar to the KMessageBox api.
I also prepared these two components to work as standalone windows which is likely to
come with this Qt 6.8 change request.
Dialog in Qt 6.8
CategorizedSettings
Jonah fixed a bug where it would be impossible to escape the settings on mobile.
Documentation
I added more screenshot to the API documentation and updated the TableView example app
to use a ‘frameless’ style.
Qt 6.7 support
This release also brings support for Qt 6.7 on Android as this release introduced
an API and ABI change to the Android code. Thanks Joshua for tackling this issue.