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 previous blog post, we talked about the importance of pixels and their indivisible nature, the way we deal with that in the icon area and introduced the concept of PPI dependable UIs - all this to have truly scalable graphics in QML.
We used the BorderImage element to illustrate how an element could scale and retain the same aspect ratio across a range of different screen PPIs and their corresponding screen definitions.
BorderImage is for Scaling!
When I first got into Qt Quick and QML, the one element that made me instantly fall in love with the entire thing was the BorderImage element. It made things that were complicated instantly trivial, plus it saved me, the designer, the tedious trouble of pre-slicing images into 9 rectangular elements, which dramatically helped with the "deliverables" problem and with small adjustments. Even today, with all of the new things we have like the Canvas or Shaders, BorderImage remains my favourite element in QML.
However that might not be enough (and it really is not enough). To expose what goes on when ppi changes, I created a video on a hypothetical screen. Using similar code to that shown in the last post: a BorderImage component that lived inside an element whose pixel count grew, and which then, when scaled back into the original size, mimicked the scaled appearance of a flexible dpi count screen...
Here is the code that generates that central blue element:
(notice it is obviously not pixel perfect as pixels are scaled)
To watch this video on our website please or view it directly on YouTube
So as you can see the results are far from perfect. In spite of the created element retaining the desired overall size, its look radically changes as we grow the pixel count, the corner radius diminishes almost into nothing, and even the overly done drop shadow that is huge in 90dpi becomes almost invisible on an hypothetical 570 dpi screen.
An expected solution
One possible solution, and the most commonly used, gets its inspiration from the way we scale icons, this means using multiple source Image files for ppi ranges.
And the way we generate those source images is again very similar to the way we generate them for icons. Using a vector drawing program, we scale the source image into multiple scale size elements and render those into raster images, png's, jpeg's, etc.
We can also define the sizes of the corners/borders in ppi/inches. As long as the ppi is larger than the number of pixels the corner has, we will be just extending the place where border line cuts the image. You just need to pay attention to leaving enough margin in those areas, so that no gradient/texture scaling problems might become too visible. Just keep in mind that the slicing lines of the border image will not be in a precisely defined position.
Showing the Code
What I will show now is just demo code. There are better ways to do it with components now offered in Qt to facilitate this, but here I am just trying to expose the logic and the problems, so I have opted for this simple method.
.......
propertyvardir:["MDPI","HDPI","XHDPI","XXHDPI","XXXHDPI","XXXXHDPI"]readonly property int ppiRange:{if(ppi>=540)5elseif(ppi>=360)4elseif(ppi>=270)3elseif(ppi>=180)2elseif(ppi>=135)1else0}.......
What you can see here is a simple way to change the source directory, depending on the dpi and the the Border position cuts defined in inches via the ppi number... I generate all the images and place them in conveniently named directories that are mapped in our "dir" variant. This has proven to be a generally good idea in my experience when creating all of the assets; it makes it easy to compare directories and search for missing assets.
Again, here is a video showing how it all looks when we dynamically change the ppi. Remember once more that the real thing will look much better since it will not be scaling pixels - but it should give you an idea of how it works.
To watch this video on our website please or view it directly on YouTube
As you can see the results are much better now and the image retains its global appearance across the ppi range. There are still issues in the corners and shadow size, especially when reaching the 540 ppi area, and if you target a device that is only slightly below 540, you might want to create more assets for that segment. This is true for any case, the values I picked were somewhat arbitrary and a multiple of a 90 ppi theoretical screen. In real life you tend to target a specific set of devices and probably will want to use those as the ones that set your boundaries for the definition of your image assets. Just pay attention to where each range ends and another begins, and make sure you are not discarding important visual information.
In the next post we will discuss more exotic methods of scaling that might be useful, depending on what you want to scale. So, see you soon.
Qt should adjust size by itself in low level. Developers should not write any code to deal with DPI.
1 - Jul - 2014
Nuno Pinheiro
@ M thank your for your comment.
By now it should have become evident enough that its not that simple, some cases it might be as easy as what I state above, and in some cases (depending on the platform) you can simple use components that are some version of what I show above, The problem is that normally it's not that simple and the designer will want a custom component widget that works across platforms and DPI ranges, and for that you need to understand the intricacies of the issues. This is the main focus of this blog posts to expose them so that wen you have to create something that is scalable you understand a bit better the issues, and multitude of strategies you can use to circumvent them...
2 - Jul - 2014
fri13
I dont like at all the PPI scaling. I don't get at all any benefits from using higher resolution display to show more content. Instead I am forced to just get higher pixel density and same content size why doesn't help at all or give a reason to spend money for better display.
2 - Jul - 2014
Nuno Pinheiro
@ fri13
Well over the years we created several computer technologies, just to be able to mitigate the problems created by the rather poor and low PPI densities of screens, Anti-aliasing, font kerning and hinting, gradient post dithering etc etc are all but tricks we created over the yaers to mitigate one form or other of screens limitations.
The current my ppi is bigger than yours fest is, I will agree a bit silly but overall if you look at a mobile screen with say 80 PPI's and compare it to screen with 300 the image quality difference is staggering.
The content volume cant really be changed as its limited by your 1 eyes , 2 the size of your thumb...Its still the same thing its just looks prettier, sharper and more accurate...
18 - Jul - 2014
jeroen
hello Nuno, great series, thanks. Will you be talking about scaling-strategies in general UI development (i.e. text, widgets, editors and there relative positioning) in these posts as well?
18 - Jul - 2014
Nuno Pinheiro
Hey jeroen, thank you for the comment.
I will try to talk about that in the end of the series, right now I'm focusing more on the technical side and the implementation possibilities, By the end i will try to venture a bit on dynamically positioned UI's, that adjust to form factor changes dynamically. and to do that we need to talk about the issues you rise... Next blog post will be about my favourite format SVG and how come its the wrong format so many times.
24 - Jul - 2014
Akash
Hello Nuno,
Great work!!! I was looking for detail implementation of such things and you explained it in a perfect way . Thanks a lot. I am looking forward for your next blog.
19 - Nov - 2014
Sergey
Hi Nuno. Thank you for your postings here, very interesting insight directly from an icon artist. I have a question though, which I think wasn't covered explicitly:
What behavior is assumed when application has icon assets prepared for, say, 120 and 160 dpi screens, but for some reason is being run on a system with 140 dpi screen? Imagine, application has an area measured in device independent pixels where some icon should be displayed. Should it display smaller 120 dpi icon as is? Or scale it up? Or, oppositely, scale larger 160 dpi icon down?
Thank you!
21 - Nov - 2014
Nuno Pinheiro
Hey Sergey, thank you for the kind words.
There is no one fits all answer for this sort of questions so depending on the specific UI the answer might be slightly different. Things like style shape of icon etc can sometimes provide fuel for different strategies.
But generally the common answer to your problem would be to use the 120 dpi one all the way up to 159 never scaling it, the result of witch is that its physical size would decrease as you increase the dpi.
Now the goals of the specif UI need to be taken in to account and you should evaluate if this side effect is something you can live with, if not you can try to downscale the 160 one and see if the resulting blurriness of the icon is tolerable or not...#note that scaling icons is usually a bad idea specially in this dpi area were pixels are still very visible.
Hope this helped.
20 - Mar - 2018
Daniel d'Andrada
Hi there,
I know I'm a bit late to the party, but I would like to point out there's a simpler solution for this. One that doesn't require coming up with multiple versions of your image file. You just have to leverage Item.scale, applying it to your BorderImage to compensate for DPI changes while keeping its original size (width and height properties) as they would be in the reference DPI (ie, the DPI intended for the source image).
Thank you for your question/comment
But you will no longer have it pixel perfect. Depending on your source original raster file size you might
1 Be Showing of upscale visible pixels if low res
2 Or wasting gpu/cpu memory if high res than needs be. (usually low res monitors have also low memory hardware alongside)
Think, if it was that easy I would not talk about it ;).
option 2 I use it sometimes if I'm feeling lasy and dont want to spend to much time on a component and its fairly decorative without much need of pixel perfection.
Nuno Pinheiro
Senior UI/UX Designer
Senior UX/UI designer at KDAB, Nuno did the first QML training for designers and actively uses the QML language for fast UX/UI prototyping and UI solutions deployment. His works include general illustrations, UI design, corporate design, interactive mock-ups, animation examples and much more. Known for his contribution to the award winning Oxygen Project where he is the current coordinator, his computer art is used on KDE computer platforms worldwide. Nuno has an MSc in Civil Engineering.
11 Comments
1 - Jul - 2014
M
Qt should adjust size by itself in low level. Developers should not write any code to deal with DPI.
1 - Jul - 2014
Nuno Pinheiro
@ M thank your for your comment. By now it should have become evident enough that its not that simple, some cases it might be as easy as what I state above, and in some cases (depending on the platform) you can simple use components that are some version of what I show above, The problem is that normally it's not that simple and the designer will want a custom component widget that works across platforms and DPI ranges, and for that you need to understand the intricacies of the issues. This is the main focus of this blog posts to expose them so that wen you have to create something that is scalable you understand a bit better the issues, and multitude of strategies you can use to circumvent them...
2 - Jul - 2014
fri13
I dont like at all the PPI scaling. I don't get at all any benefits from using higher resolution display to show more content. Instead I am forced to just get higher pixel density and same content size why doesn't help at all or give a reason to spend money for better display.
2 - Jul - 2014
Nuno Pinheiro
@ fri13 Well over the years we created several computer technologies, just to be able to mitigate the problems created by the rather poor and low PPI densities of screens, Anti-aliasing, font kerning and hinting, gradient post dithering etc etc are all but tricks we created over the yaers to mitigate one form or other of screens limitations.
The current my ppi is bigger than yours fest is, I will agree a bit silly but overall if you look at a mobile screen with say 80 PPI's and compare it to screen with 300 the image quality difference is staggering.
The content volume cant really be changed as its limited by your 1 eyes , 2 the size of your thumb...Its still the same thing its just looks prettier, sharper and more accurate...
18 - Jul - 2014
jeroen
hello Nuno, great series, thanks. Will you be talking about scaling-strategies in general UI development (i.e. text, widgets, editors and there relative positioning) in these posts as well?
18 - Jul - 2014
Nuno Pinheiro
Hey jeroen, thank you for the comment. I will try to talk about that in the end of the series, right now I'm focusing more on the technical side and the implementation possibilities, By the end i will try to venture a bit on dynamically positioned UI's, that adjust to form factor changes dynamically. and to do that we need to talk about the issues you rise... Next blog post will be about my favourite format SVG and how come its the wrong format so many times.
24 - Jul - 2014
Akash
Hello Nuno, Great work!!! I was looking for detail implementation of such things and you explained it in a perfect way . Thanks a lot. I am looking forward for your next blog.
19 - Nov - 2014
Sergey
Hi Nuno. Thank you for your postings here, very interesting insight directly from an icon artist. I have a question though, which I think wasn't covered explicitly:
What behavior is assumed when application has icon assets prepared for, say, 120 and 160 dpi screens, but for some reason is being run on a system with 140 dpi screen? Imagine, application has an area measured in device independent pixels where some icon should be displayed. Should it display smaller 120 dpi icon as is? Or scale it up? Or, oppositely, scale larger 160 dpi icon down?
Thank you!
21 - Nov - 2014
Nuno Pinheiro
Hey Sergey, thank you for the kind words. There is no one fits all answer for this sort of questions so depending on the specific UI the answer might be slightly different. Things like style shape of icon etc can sometimes provide fuel for different strategies. But generally the common answer to your problem would be to use the 120 dpi one all the way up to 159 never scaling it, the result of witch is that its physical size would decrease as you increase the dpi. Now the goals of the specif UI need to be taken in to account and you should evaluate if this side effect is something you can live with, if not you can try to downscale the 160 one and see if the resulting blurriness of the icon is tolerable or not...#note that scaling icons is usually a bad idea specially in this dpi area were pixels are still very visible. Hope this helped.
20 - Mar - 2018
Daniel d'Andrada
Hi there,
I know I'm a bit late to the party, but I would like to point out there's a simpler solution for this. One that doesn't require coming up with multiple versions of your image file. You just have to leverage Item.scale, applying it to your BorderImage to compensate for DPI changes while keeping its original size (width and height properties) as they would be in the reference DPI (ie, the DPI intended for the source image).
This was done here: http://code.qt.io/cgit/qt-apps/neptune3-ui.git/tree/imports/shared/controls/ScalableBorderImage.qml
20 - Mar - 2018
Nuno Pinheiro
Thank you for your question/comment But you will no longer have it pixel perfect. Depending on your source original raster file size you might 1 Be Showing of upscale visible pixels if low res 2 Or wasting gpu/cpu memory if high res than needs be. (usually low res monitors have also low memory hardware alongside)
Think, if it was that easy I would not talk about it ;).
option 2 I use it sometimes if I'm feeling lasy and dont want to spend to much time on a component and its fairly decorative without much need of pixel perfection.