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.
QtQuick includes basic visual item to construct many common user-interface components, but people often ask how to create different visual appearances, beyond rectangles, round-rectangles and images. There’s various solutions to this problem, and with Qt 5.10, there’s the new Shapes module which makes it easy to define paths, ellipses and other standard SVG drawing elements.
However, if these built-in solutions aren’t quite what is needed, or you need to squeeze some additional performance from limited hardware, it’s always possible to create a custom Item using the Scene-Graph API of Qt Quick, and some knowledge of hardware drawing APIs, such as OpenGL and GLES. This is usually a somewhat complex solution, and it’s important to stick to the design philosophy of Qt Quick: create simple, efficient and re-usable items which can be configured via properties. Here I want to show an example item which was inspired by one of KDAB’s Automotive customers: an angular sector:
When creating a subclass of QQuickItem, you define the standard interface to QML as normal: via Q_PROPERTY macros, slots, and Q_INVOKABLE methods. (Such as the radius and color properties in the QML snippet above). But most importantly you must override the updatePaintNode method, and use this to describe the scene-graph nodes which correspond to your item. The scene-graph system in Qt Quick is an efficient mechanism to describe your visual pieces to the hardware APIs, but it’s very different from imperative drawing APIs such as the venerable QPainter. Your visuals must be defined as a tree of nodes, which can specify opacity, clipping, a transformation or most importantly, geometry. Geometry nodes contain both geometry - triangles, usually - and some mechanism to define how the pixels in those triangles are drawn; that mechanism is called a material in the scene-graph, and is closely related to a shader in OpenGL or other hardware APIs.
The first step in defining our sector item, then, is to compute a set of triangles covering the item, based on the inner and outer radius, and the start and end angles. Why are we restricted to triangles? Well, that’s really the only thing hardware knows how to draw; APIs such as the Shapes module have to ultimately translate everything you provide into triangles. So we split our sector into triangles, but of course a triangle has straight sides. We could accept this and some ‘polygonal’ edges on our shapes (as happened in the first few generations of 3D video games and graphics), but we can do better. One solution is to use more, smaller triangles - so that the straight outer edges become a closer approximation of the curved sector we want. But this has its own problems - more triangles means more geometry data to be updated when the sector changes, and potentially slower rendering. (Although in practice, most modern graphics hardware can draw a lot of triangles).
However, we can be smarter, and enable some additional features by using a different approach - we can use fewer triangles, but ensure they are larger than we need, so the entire sector is covered by triangles. Inside our shader code, we will use the discard GLSL keyword to make those pixels transparent, and this also gives us an easy way to smooth the edges of the sector (anti-aliasing), or even render a border. In this method, we're no longer considering our triangle geometry to mean 'pixels defining our shape' but rather 'pixels where we can potentially decide what happens'. Of course we could simply use two triangles covering the entire shape, but there is a cost to evaluating each pixel, so a coarse fit as shown below, is a tradeoff between complexity of the geometry, and covering unecessary amounts of the screen.
Inside the QSGGeometry API, we need to define how many points (vertices) we have, and the X and Y positions of each, using some trigonometry. Unfortunately it’s hard to get very far in APIs such as OpenGL without some basic knowledge of linear algebra and trigonometry, but fortunately there’s many examples to work from. Inside the main code, we subdivide the sector into triangles, and generate the three vertices for each one. The most important piece of trigonometry is to compute X and Y (cartesian) values from polar (angle + radius) form, and of course we have to translate from degrees to radians.
Here's the code which creates our node and associated geometry:
int vertexCount =.... compute number of unique vertices
int indexCount =... compute number of triangles *3;node =new QSGGeometryNode;geom =newQSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), vertexCount, indexCount);geom->setIndexDataPattern(QSGGeometry::StaticPattern);geom->setDrawingMode(GL_TRIANGLES);node->setGeometry(geom);node->setFlag(QSGNode::OwnsGeometry);
Once this is done, we can ask the geometry to give us a pointer to the storage it allocated internally to hold our vertices and indices. Note that we're using one of the default vertex attribute formats here, TexturedPoint2D. This means each vertex stores four values: X, Y and two other values called S and T we can use. There's other built-in formats, but if you need, you can supply a custom one. Very often, one of the basic three (Point2D, TexturedPoint2D or ColoredPoint2D) will suffice however, and they save some typing! Here's how we retrieve a pointer to the memory we must fill in with our vertices:
Then we need to run some loops, computing the values to insert into the arrays:
// computing s & t not shown here for simplicitypoints[i].set(innerRadius *cos(angleInRad), innerRadius *sin(angleInRad), s, t);
The S and T values, we will actually pass the cartesian values again, but modified slightly, so we can compute the polar position of each pixel accurately in our material (see the next post in this series!). Of course, many triangles in our geometry share the same vertices. Graphics is all about efficiency, so rather than repeating our vertices, we only include each one a single time. Then we use a separate piece of data to indicate which triangles use which vertices. This is called the index data, and it's simply a list of integers, specify vertices by, you guessed, their index. Again the QSGGeomtry will allocate storage for this based on a size we pass in, and can give us a pointer to that memory, to be filled in:
quint16* indices = geom->indexDataAsUShort();// three sequential entries in 'indices' define a// single triangle, here using vertices 4, 6 and 3indices[i]=4;indices[i+1]=6;indices[i+2]=3;
The scene-graph API requires us to perform explicit management of memory and resources - this is because it’s optimised for speed and efficiency, not comfort. And it allows materials and geometry to be shared between nodes or items, so we need to explicitly state if we own our geometry. (You can see in the snippets above, we have to explicitly tell the node, it owns the geometry and hence can delete it) If our item properties change (for example, the radius), we need to recompute our geometry, but then also tell the scene-graph data we made changes, because internally there’s a hardware buffer which needs to be updated; that’s an operation we need to avoid doing if nothing has changed, so we have to explicitly mark the data as changed (‘dirty’) so it will copied to the GPU on the next Qt Quick drawing frame.
If you forget to tell either the geometry or the node, that something has changed, the hardware data won't be updated, and you won't see your changes. Putting this all together, we now have a way to get our geometry object populated with vertices and indices. Each vertex defines an X,Y position, and each group of three index values identify three vertices, and hence one triangle. We can use some basic trigonometry to work out the X,Y values from our angles and radii. Whenever our angles or radii change, we'll need to recompute our geometric data, and tell the scene-graph that the data is dirty (modified). If we wanted to show our shape with a simple color, we could now use QSGFlatColorMaterial and we'd be done. As the name suggests, this built-in material will draw ever pixel in your triangles, in a single color. But we want something prettier, so we need a custom material. We'll see how to do that, in the next part.
how is it possible to print text on shape in cpp from scene graph?
26 - Sept - 2018
James Turner
Hi Zahraee, unfortunately displaying text from the scene-graph means using private APIs.You can include <private/qquicktextnode_p.h> and then create a QQuickTextNode. You then populate the text node using the QTextLayout APIs. This is quite straightforward to code up, but limited to uses where private APIs are permitted. The header file for the text node has good information on how to use it.
29 - Sept - 2018
zahraee
thank you and how is it possible to access private api using qtcreator?
5 - Oct - 2018
James Turner
Hi Zahraee, to use a private API, when using QMake, add the private versions of the Qt modules. For example: QT += quick-private to use the private QtQuick headers needed for this. For CMake, there are variables defined like Qt5Quick_PRIVATE_INCLUDE_DIRS which give the same functionality.
25 - Aug - 2021
Nicolas Fella
For CMake there is the Qt5::QuickPrivate target too
28 - Sept - 2018
Patrick José Pereira
is it possible to use only the sector are as a mouseArea or will it be a rectangle that circumscribes the sector ?
28 - Sept - 2018
James Turner
By default it's the rectangle. To improve that, we override the event handlings (eg, mouseMoveEvent) to do some more precise detection. Often we separate out user-interaction into another item (as Rectangle and MouseArea are separated), but for the sector it likely does make sense to include that.
Maybe I'll do a third post in the series on adding custom mouse handling, it's a nice suggestion indeed.
16 - Aug - 2019
Mousavi
Great 👍🏻
16 - Aug - 2019
Mousavi
Is there any result comparison image/video/source-code?
3 - May - 2020
S.M.Mousavi
Where is 2nd part?
5 - May - 2020
James Turner
Actually I got busy with other projects and never finished writing part two - it's been sitting as a draft. Thank you for the reminder, I'll work on it now.
James Turner
Senior Software Engineer & Teamlead
Senior software engineer and team lead at KDAB, James has been developing with Qt since 2002. He contributes to the current maintenance of Mac platform support as well as the development of OpenGL and 3D support in Qt. James has a background in UI, graphics, and simulation development as well as a long history of development on OS-X and prior versions of Mac OS. He is a lead developer on FlightGear, the open-source flight simulator, and holds a BSc in Computer Science.
11 Comments
26 - Sept - 2018
zahraee
how is it possible to print text on shape in cpp from scene graph?
26 - Sept - 2018
James Turner
Hi Zahraee, unfortunately displaying text from the scene-graph means using private APIs.You can include
<private/qquicktextnode_p.h>
and then create aQQuickTextNode
. You then populate the text node using theQTextLayout
APIs. This is quite straightforward to code up, but limited to uses where private APIs are permitted. The header file for the text node has good information on how to use it.29 - Sept - 2018
zahraee
thank you and how is it possible to access private api using qtcreator?
5 - Oct - 2018
James Turner
Hi Zahraee, to use a private API, when using QMake, add the private versions of the Qt modules. For example:
QT += quick-private
to use the private QtQuick headers needed for this. For CMake, there are variables defined likeQt5Quick_PRIVATE_INCLUDE_DIRS
which give the same functionality.25 - Aug - 2021
Nicolas Fella
For CMake there is the Qt5::QuickPrivate target too
28 - Sept - 2018
Patrick José Pereira
is it possible to use only the sector are as a mouseArea or will it be a rectangle that circumscribes the sector ?
28 - Sept - 2018
James Turner
By default it's the rectangle. To improve that, we override the event handlings (eg, mouseMoveEvent) to do some more precise detection. Often we separate out user-interaction into another item (as Rectangle and MouseArea are separated), but for the sector it likely does make sense to include that. Maybe I'll do a third post in the series on adding custom mouse handling, it's a nice suggestion indeed.
16 - Aug - 2019
Mousavi
Great 👍🏻
16 - Aug - 2019
Mousavi
Is there any result comparison image/video/source-code?
3 - May - 2020
S.M.Mousavi
Where is 2nd part?
5 - May - 2020
James Turner
Actually I got busy with other projects and never finished writing part two - it's been sitting as a draft. Thank you for the reminder, I'll work on it now.