Trusted Software Excellence across Desktop and Embedded
Take a glance at the areas of expertise where KDAB excels ranging from swift troubleshooting, ongoing consulting and training to multi-year, large-scale software development projects.
Find out why customers from innovative industries rely on our extensive expertise, including Medical, Biotech, Science, Renewable Energy, Transportation, Mobility, Aviation, Automation, Electronics, Agriculture and Defense.
High-quality Embedded Engineering across the Stack
To successfully develop an embedded device that meets your expectations regarding quality, budget and time to market, all parts of the project need to fit perfectly together.
Learn more about KDAB's expertise in embedded software development.
Where the capabilities of modern mobile devices or web browsers fall short, KDAB engineers help you expertly architect and build high-functioning desktop and workstation applications.
Extensible, Safety-compliant Software for the Medical Sector
Create intelligent, patient-focused medical software and devices and stay ahead with technology that adapts to your needs.
KDAB offers you expertise in developing a broad spectrum of clinical and home-healthcare devices, including but not limited to, internal imaging systems, robotic surgery devices, ventilators and non-invasive monitoring systems.
Building digital dashboards and cockpits with fluid animations and gesture-controlled touchscreens is a big challenge.
In over two decades of developing intricate UI solutions for cars, trucks, tractors, scooters, ships, airplanes and more, the KDAB team has gained market leading expertise in this realm.
Build on Advanced Expertise when creating Modern UIs
KDAB assists you in the creation of user-friendly interfaces designed specifically for industrial process control, manufacturing, and fabrication.
Our specialties encompass the custom design and development of HMIs, enabling product accessibility from embedded systems, remote desktops, and mobile devices on the move.
Legacy software is a growing but often ignored problem across all industries. KDAB helps you elevate your aging code base to meet the dynamic needs of the future.
Whether you want to migrate from an old to a modern GUI toolkit, update to a more recent version, or modernize your code base, you can rely on over 25 years of modernization experience.
KDAB offers a wide range of services to address your software needs including consulting, development, workshops and training tailored to your requirements.
Our expertise spans cross-platform desktop, embedded and 3D application development, using the proven technologies for the job.
When working with KDAB, the first-ever Qt consultancy, you benefit from a deep understanding of Qt internals, that allows us to provide effective solutions, irrespective of the depth or scale of your Qt project.
Qt Services include developing applications, building runtimes, mixing native and web technologies, solving performance issues, and porting problems.
KDAB helps create commercial, scientific or industrial desktop applications from scratch, or update its code or framework to benefit from modern features.
Discover clean, efficient solutions that precisely meet your requirements.
Boost your team's programming skills with in-depth, constantly updated, hands-on training courses delivered by active software engineers who love to teach and share their knowledge.
Our courses cover Modern C++, Qt/QML, Rust, 3D programming, Debugging, Profiling and more.
The collective expertise of KDAB's engineering team is at your disposal to help you choose the software stack for your project or master domain-specific challenges.
Our particular focus is on software technologies you use for cross-platform applications or for embedded devices.
Since 1999, KDAB has been the largest independent Qt consultancy worldwide and today is a Qt Platinum partner. Our experts can help you with any aspect of software development with Qt and QML.
KDAB specializes in Modern C++ development, with a focus on desktop applications, GUI, embedded software, and operating systems.
Our experts are industry-recognized contributors and trainers, leveraging C++'s power and relevance across these domains to deliver high-quality software solutions.
KDAB can guide you incorporating Rust into your project, from as overlapping element to your existing C++ codebase to a complete replacement of your legacy code.
Unique Expertise for Desktop and Embedded Platforms
Whether you are using Linux, Windows, MacOS, Android, iOS or real-time OS, KDAB helps you create performance optimized applications on your preferred platform.
If you are planning to create projects with Slint, a lightweight alternative to standard GUI frameworks especially on low-end hardware, you can rely on the expertise of KDAB being one of the earliest adopters and official service partner of Slint.
KDAB has deep expertise in embedded systems, which coupled with Flutter proficiency, allows us to provide comprehensive support throughout the software development lifecycle.
Our engineers are constantly contributing to the Flutter ecosystem, for example by developing flutter-pi, one of the most used embedders.
KDAB invests significant time in exploring new software technologies to maintain its position as software authority. Benefit from this research and incorporate it eventually into your own project.
Start here to browse infos on the KDAB website(s) and take advantage of useful developer resources like blogs, publications and videos about Qt, C++, Rust, 3D technologies like OpenGL and Vulkan, the KDAB developer tools and more.
The KDAB Youtube channel has become a go-to source for developers looking for high-quality tutorial and information material around software development with Qt/QML, C++, Rust and other technologies.
Click to navigate the all KDAB videos directly on this website.
In over 25 years KDAB has served hundreds of customers from various industries, many of them having become long-term customers who value our unique expertise and dedication.
Learn more about KDAB as a company, understand why we are considered a trusted partner by many and explore project examples in which we have proven to be the right supplier.
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications.
Read more about the history, the values, the team and the founder of the company.
When working with KDAB you can expect quality software and the desired business outcomes thanks to decades of experience gathered in hundreds of projects of different sizes in various industries.
Have a look at selected examples where KDAB has helped customers to succeed with their projects.
KDAB is committed to developing high-quality and high-performance software, and helping other developers deliver to the same high standards.
We create software with pride to improve your engineering and your business, making your products more resilient and maintainable with better performance.
KDAB has been the first certified Qt consulting and software development company in the world, and continues to deliver quality processes that meet or exceed the highest expectations.
In KDAB we value practical software development experience and skills higher than academic degrees. We strive to ensure equal treatment of all our employees regardless of age, ethnicity, gender, sexual orientation, nationality.
Interested? Read more about working at KDAB and how to apply for a job in software engineering or business administration.
In the last post of this series we discussed the usage of trivial relocation in order to optimize move construction followed by the destruction of the source.
To quickly recap:
objects of certain datatypes ("trivially relocatable" types) can be moved in memory by simply moving bytes;
this can be used to optimize certain bulk operations (such as vector reallocation);
if we have a custom datatype which is trivially relocatable, we can mark it using the Q_DECLARE_TYPEINFO macro so that Qt considers it as such.
In this instalment we are going to explore the relationships between trivial relocation and move assignments.
A different example: vector erasure
Last time we started our investigation of trivial relocation by considering an important use-case: reallocating a vector. This happens when a vector reaches its capacity, but more storage is needed.
Let's now consider a different operation: erasing an element from the middle of a QVector.
How do we go about it?
QVector<QString> v{"A","B","C","D"};v.erase(v.begin()+1);// remove B, second element
We can easily come up with a few possible implementation strategies:
1. We could move-assign the "tail" one position to the left, one element at a time, left from right:
Move-assign C over B, move-assign D over (moved-from) C, and so on.
At the end of the sequence of move operations, we would end up with the expected contents in the vector (B has been overwritten), however there is a last moved-from element still around:
After the move assignments, there is a tail of moved-from element(s) that needs to be destroyed.
Since it's at the tail, we can easily destroy it, update our bookkeeping, and that's it:
Almost done: destroy the last element, and reduce size by 1.
2. Alternatively, we could std::rotate the tail of the vector so that B (the element to destroy) ends up at the end:
... it's a rotate!
std::rotate will execute a series of swaps in order to, well, perform a rotation of the tail. After it's done, we're left with an element in the last position that needs to be destroyed (in this case, it's B itself):
We still have a tail of elements to destroy.
Just like the previous example, we can then simply destroy the last element, and update our vector's bookkeeping (its size has decreased by 1):
Destroying the last element.
Of course, there are other possibilities as well.
"At the end of the day", one may think, "aren't these all equivalent?": they all end up removing B from the vector, and they just differ in how to get there. So why do we even bother discussing this? Surely Qt has chosen an efficient strategy, and whatever it is, it's just an implementation detail.
... is it truly? As we'll soon discover, things are way more complicated than this.
Trivial Relocatability for erasure
Let's go back to our discussion about trivial relocability. If you read the last blog post, you should know that QString is trivially relocatable: we can move QString objects in memory by moving their byte representation. (This is not necessarily the case for std::string.)
You shouldn't then be surprised by what comes next: QVector can use trivial relocation to optimize vector erasure for these types!
How, exactly? Let's go back to our QVector<QString> from which we want to erase the second element:
In this case, QVector first destroys the element to be removed:
Then, we need to compact the tail over the destroyed element. Since QString is trivially relocatable, this is done via a memcpy as well! Well, to be pedantic: a memmove, since the source and destination ranges overlap.
After this we're basically done: there's no last element to destroy, all we need to do is update the vector's bookkeeping.
Once more, this optimization constitutes a massive performance gain compared to having to shuffle individual elements around. You can see it in action inside QVector here.
Is this optimization legal? What was relocation again?
In the first instalment we defined relocation as the combination of move construction, followed by the destruction of the source. We also defined trivial relocation as "the same effects, realized by copying bytes" -- in particular, without any calls to a type's move constructor or destructor.
Our motivating example was optimizing the reallocation of a vector, where indeed the vector has move construct elements into the new storage, and destroy elements in the old storage.
However, in order to optimize erasure, we cannot formally use this definition! The point is that erasure does not use move construction at all! It uses move assignments (and destructions). We must therefore carefully reason about what we are doing.
The question we should ask ourselves at this point is: is Qt making an illegal optimization here? Or instead, is it that our definition of relocability needs some refinement?
Sorry for the cliffhanger, but you'll have to wait for the next post to solve this mystery!
Trusted software excellence across embedded and desktop platforms
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Is Q_DECLARE_TYPEINFO going to be superseded by std::is_trivially_relocatable?
16 - May - 2024
Giuseppe D'Angelo
Hi,
Good question: if and when we get trivial relocation in the Standard, and, if it matches Qt semantics, then Qt will use the standard traits -- although of course it also keep its own trait for a very very long time, for compabilitity.
At the moment, trivial relocation is being discussed for C++26, but the proposed semantics do not fit Qt needs at all and therefore Qt will not use it.
16 - May - 2024
Robert
Thanks for the reply.
So, currently no hope that just by waiting a few years, I can save tagging hundreds of classes with Q_DECLARE_TYPEINFO if I want the performance gains...
16 - May - 2024
Giuseppe D'Angelo
I have submitted a paper to show some issues with the currently proposed model, hoping that instead C++ adopts a model that Qt can actually use.
Giuseppe D’Angelo
Senior Software Engineer
Senior Software Engineer at KDAB. Giuseppe is a long-time contributor to Qt, having used Qt and C++ since 2000, and is an Approver in the Qt Project. His contributions in Qt range from containers and regular expressions to GUI, Widgets, and OpenGL. A free software passionate and UNIX specialist, before joining KDAB, he organized conferences on opensource around Italy. He holds a BSc in Computer Science.
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
4 Comments
15 - May - 2024
Robert
Is Q_DECLARE_TYPEINFO going to be superseded by std::is_trivially_relocatable?
16 - May - 2024
Giuseppe D'Angelo
Hi,
Good question: if and when we get trivial relocation in the Standard, and, if it matches Qt semantics, then Qt will use the standard traits -- although of course it also keep its own trait for a very very long time, for compabilitity.
At the moment, trivial relocation is being discussed for C++26, but the proposed semantics do not fit Qt needs at all and therefore Qt will not use it.
16 - May - 2024
Robert
Thanks for the reply. So, currently no hope that just by waiting a few years, I can save tagging hundreds of classes with Q_DECLARE_TYPEINFO if I want the performance gains...
16 - May - 2024
Giuseppe D'Angelo
I have submitted a paper to show some issues with the currently proposed model, hoping that instead C++ adopts a model that Qt can actually use.