In 2019, I optimized QStringList::removeDuplicates() by using std::pmp::unordered_set with a std::pmr::monotonic_buffer_resource, when available. The class that I wrote to encapsulate this optimization has since been re-implemented three times. The latest iteration has recently landed in KDToolBox. If you have code that looks a bit like this: then you should read on.
Blog Archives
New Release: KD Reports 2.0.0
Version 2.0.0 of KD Reports has just been released! KD Reports creates all kinds of reports from within Qt applications. These reports are printable and exportable from code and XML descriptions. KD Reports is a developer tool used in source code, but it allows the use of templates that are created by design staff. Reports […]
On the Removal of toSet(), toList() and Others or "How Do I Convert a QList to QSet in Qt 6?"
(Apologies for the clickbait in the post title! But I’d really like people who are searching for solutions to read this.) Between Qt 5.14 and Qt 5.15, my colleague, Marc Mutz, and I submitted a series of patches to Qt that added “range constructors” to the Qt containers. This brought Qt containers one step closer […]
New in Qt 6.1: std::hash Support for QHash
In the previous blog post of this series, we discussed KDToolBox::QtHasher, a helper class that allows us to use unordered associative containers datatypes which have a qHash() overload but not a std::hash specialization. The majority of Qt value classes indeed are lacking such a specialization, even if they do provide a qHash() overload. For our […]
Qt Developer Conference A Conference from Developers for Developers
We at KDAB are pleased to announce an event we’re planning to host in Berlin this fall, September 28-30. Save the dates for KDAB’s Qt Developer Conference — a conference from Qt developers for Qt developers! Qt Desktop Days, May 2021 — Cancelled Before we tell you more about Qt Dev Con, we’d like to […]
Single-Shot Signal/Slot Connections
Sometimes it’s useful to establish a connection between a signal and a slot that should be activated only once. This is not how signal/slot connections normally behave. Remember that, when a connection is established, it will stay active until: the connection is explicitly disconnected; or the sender object is destroyed; or the receiver object is […]
Qt Desktop Days Returns! CFP now open!
The event has been cancelled and will be integrated into our Qt DevCon event in June 2022. KDAB is bringing you another Qt Desktop Days this May! So, if you missed the first one that was held last September, or if you would like to attend a second, please join us May 19th-20th. That’s a […]
Using Qt Datatypes in Standard Library Unordered Containers
In the previous blog post about qHash, we explained: how to declare an overload of qHash for your own datatypes, how to hash Qt datatypes for which Qt does not provide a qHash overload, and why you can’t use a type from the Standard Library (or just another library) as a key in QHash (newsflash: […]
Qt Embedded Days 2021
This brand new online conference hosted by KDAB offers in-depth technical topics from embedded developers for embedded developers – especially, but not exclusively, for those working with Qt on Embedded Devices. The call for papers is now closed and the program will be announced as soon as the committee has made a final selection. We […]
Efficient Custom Shapes in QtQuick : Shaders
A long time ago, I wrote a post about creating custom shapes in Qt Quick, via the scene-graph APIs. That post covered defining suitable geometry to draw a part of a circle, known also as a ‘sector’, efficiently, since such sectors occur commonly in instrument and vehicle interfaces. I started writing the second part, about […]