Quantcast
Channel: Planet Qt
Viewing all 15410 articles
Browse latest View live

KDAB on Qt: A Speed-Up for Charting on Embedded

$
0
0

I’d like to talk about a common problem that we have seen come up in several projects, namely how to plot large datasets over time in an efficient manner using Qt. This seems to be a general issue, especially in embedded situations and is affecting many people. Because of this, I thought we’d share one approach that we have found to work well in some situations, maybe it helps you out in your project.

Problem: Waveform Graphs of Large Data Sets

We have a situation where we are accumulating more than 500.000 samples of sensor data. The data is appended over time to a huge array.

We want to visualize this growing amount of sensor information as a waveform graph:

To intelligently render this on low-profile hardware, we cannot visit all the data points in a single render pass, but we need to cheat. Instead of drawing lines between all the hundreds of thousands of data points, we draw each vertical pixel column as one line reaching from the minimum sample to the maximum sample.

With this method, we only need to render a few hundred lines instead of hundreds of thousands to reach the same visual result.

To pull off this trick, however, we need to query minmax(beginIndex, endIndex) to obtain the range of values for which to draw a line very efficiently and very often. For this, I developed a MinMaxTree data structure which can offer high speeds for this query. The effective API of such a data structure can look like this:

template  class MinMaxTree
{
public:
    explicit MinMaxTree();
 
    void append(T value);
    MinMax getMinMaxInRange(size_t rangeBegin, size_t rangeEnd) const;
// ...
};

This API allows you to insert a single data sample to store new sensor data. It also lets you retrieve the minimum and maximum given begin and end indices, which we can then use to render a line in our waveform.

Crafting an Append-Only Min–Max Tree as a Search Index

Remembering computer science classes, I figured that reusing prior calculations can save a lot of work (dynamic programming). In addition, given very large data sets, trees can cut your query times tremendously by intelligently arranging data or—to put it differently—by allowing us to skip a vast amount of data quickly.

The solution I explain in this blog post uses both approaches at their best.

Here is the tree I modeled on top of the data:

The tree summarizes ranges of data points in the underlying array. I designed the tree nodes to contain the minimum and maximum values of their range. Since parent nodes represent the data of their left and right children, they contain the minimum and maximum of their combined ranges. Finally, the root node contains the minimum and maximum values of the entire data set.

Because I want to keep the tree small and profit from caching effects, each node represents a sub-range or “bucket” of the array. The bucket size can be adjusted to match the cache sizes of the hardware best. This keeps the tree flat while still enabling fast linear scans inside the bucket.

Appending a Value, Updating the tree

There are two tasks that come with insertion: updating the tree and, optionally, extending the tree.

When appending a value, it needs to update the overlying tree structure. When inserted, the value needs to find and update its respective tree leaf, which, in turn, must inform its parent node and so on. I hope that it’s easy to see that if a node’s minimum or maximum do not change, it does not need to inform its parent node. Using this optimization, the average-case complexity of insertion is very low. The code snippet below illustrates this recursive “bubbling up” of a value trough the tree:

template;
void MinMaxTree::bubbleUpMinMax(T value, size_t treeIndex)
{
    //updates and returns true, if we altered minmax in the node
    auto minmax = [&](T value) -> bool
    {
        auto &node = m_treeOntopOfBuckets.at(treeIndex);
        const auto oldmin = node.min;
        const auto oldmax = node.max;
        node.min = std::min(value, node.min);
        node.max = std::max(value, node.max);
        return (value < oldmin || value > oldmax);
    };
 
    //we are at the root, break recursion
    if (treeIndex == m_treeCapacity/2)
    {
        minmax(value);
        return;
    }
    //update node and optionally bubble up further
    else
    {
        if (minmax(value))
            bubbleUpMinMax(value, parent(treeIndex));
    }
}

The second problem when inserting a value is that our tree structure might need to grow, because the new value breaches the capacity of the existing tree. Here, the tree needs to extend“sideways” to leave its complete old structure intact and form a new node on top. For this, I

  1. double the trees size and mirror its current structure to extend its reach,
  2. make a new root,
  3. copy the data from the old root into the new root.

Now that we have doubled the tree size, we can again insert data until we need to expand again.

A note on the default values inside our nodes: I initialize all nodes with the highest possible value as minimum and lowest possible value as maximum.

template MinMax{
    T min = std::numeric_limits::max();
    T max = std::numeric_limits::lowest(); 
    //it’s not ::min(), this costed me hours
};

So when actual real values enter the array, they will change min and max, because they are different to these default extremes.

BE WARNED!std::numeric_limits::min() represents the smallest positive representation of a value, not the lowest possible number. I learned it the hard way.

Indexing: Squeezing the Tree into an Array

In our case, I wanted to optimize the tree accesses and its growth without using a pointer implementation that would link a node to its children using pointers.

Instead, I adopted a commonly used trick to squeeze heaps into arrays, by letting the left child of an element be at 2 × index and the right child at 2 × index + 1. While it seems that I could have used this approach for this project as well, growing the tree would require me to insert and make space at many places. Instead, I went with an infix indexing method, putting the tree into an array in a “left node–root node–right node” order like this:

This is nice for several reasons:

  • It eliminates the need for the use of pointer chasing.
  • Nodes and their parents are fairly close (in the lower tree).
  • Expanding the tree is just doubling the array in size.
  • The root node will be in the middle of the array.

To have convenient ways of accessing rightChild and leftChild as well as the parentNode from a certain index, we have to look at the binary representation of our indices. Note how the parent index, for instance, always is the next higher “pure” power of 2. It would be a bit cumbersome to explain all the magic bit in text form, instead the code tells it best:

leftChild Find lowest set bit, unset it, and set the one-lower bit

template
size_t MinMaxTree::leftChild(size_t index) const
{
    int lsb = ffs(index);
    index &= ~(1UL << (lsb-1));
    index |= 1UL << (lsb-2);
    return index;
}

rightChild Find lowest set bit and set the one-lower bit

template
size_t MinMaxTree::leftChild(size_t index) const
{
    int lsb = ffs(index);
    index |= 1UL << (lsb-2);
    return index;
}

parentNode Find lowest set bit, unset it, and set the one-higher bit

template
size_t MinMaxTree::parent(size_t index) const
{
    int lsb = ffs(index);
    index &= ~(1UL << (lsb-1));
    index |= 1UL << lsb;
    return index;
}

All Functions use the glibc-provided intrinsic ffs, which can be found in  (FindFirstSet to identify the lowest-significant set bit). On Windows, the intrinsic BitScanForward can be used to accomplish this. Similarly, I wrote a function to return the actual range in our data array a particular node covers.

Querying a Range

Now that we have all tools in hand, we can finally implement the range query itself.

We recursively query the tree nodes, starting from root downward. We check how a node’s range relates to our query range and query its children for the minimum and maximum, according to the following few cases:

Case 1: The node’s range is outside of  the query range → Return the uninitialized min/max.

Case 2: The node’s range is fully enclosed in the query range → That’s the best case, we just return the node’s min/max.

Case 3: The node’s range is partly inside, partly outside the query range or the node covers more than the range and we can split → Split, query left and right, and combine the results.

Case 4: The node’s range overlaps and we are at a leaf node → We need to scan through the bucket.

template
MinMax::queryNode(size_t nodeIndex, size_t rangeBegin, size_t rangeEnd) const
{
    // […] calculate Node Range, store in NodeBegin, NodeEnd  
 
    // node outside range, return empty MinMax()
    //               |------range----|
    //  |---node---|           or     |---node---|
    // this should never happen, but safe is safe
    if ((nodeEnd < rangeBegin) || (nodeBegin > rangeEnd))
        return MinMax
 
    // range spans node fully, return nodes' MinMax
    // |---------range-----------|
    //      |------node------|
    if ((rangeBegin <= nodeBegin) && (rangeEnd >= nodeEnd))
        return m_treeOntopOfBuckets[nodeIndex];
 
    // node cuts range left or right or both
    //       |------range----|
    //  |---node---| or |---node---| or
    //     |--------node-------|
    if ((nodeBegin <= rangeBegin ) || (nodeEnd >= rangeEnd))
    {
        const MinMax leftMinMax = queryNode(leftChild(nodeIndex), rangeBegin, rangeEnd);
        const MinMax rightMinMax = queryNode(rightChild(nodeIndex), rangeBegin, rangeEnd);
        MinMax resultMinMax;
        resultMinMax.min = std::min(rightMinMax.min, leftMinMax.min);
        resultMinMax.max = std::max(rightMinMax.max, leftMinMax.max);
        return resultMinMax;
    }
     
    // Node is leaf, re-scan its bucket for subrange
    //              |---------range-----------|
    //  |----node(leaf)----|   or   |----node(leaf)----|
    if( nodeIndex % 2 == 1)
    {
        MinMax scanResult;
        for(size_t i = std::max(nodeBegin, rangeBegin); i <= std::min(nodeEnd, rangeEnd); i++)
        {
            scanResult.min = std::min(m_dataInBuckets[i], scanResult.min);
            scanResult.max = std::max(m_dataInBuckets[i], scanResult.max);
        }
        return scanResult;
    }
}

Results

Visualizing 300.000 data points took more than 2 seconds with the naïve approach (drawing lines from point to point) on the embedded test hardware, while this approach brought down the time for queries to about 3 ms, such that the pure line rendering now even accounts for the bigger part of the cost (6 ms). We again have reached levels below the juicy target of 16 ms.

Further Optimization: Find Lowest Common Parent

In a similar setup, my colleague James Turner found that many of our node visits actually were searching down the tree for the lowest common node covering the full range. In these cases, we often ended up splitting the node in its two children, one of which containing the range fully and the other not containing the range at all.

This initial search down the tree took most of the node visits, while the actual desired min max scan (collecting all the nodes containing the range) was less than that.

So instead of searching from the top, beginning at the root node, I now calculate the left and right leaves, then determine the lowest common node spanning the full range, and perform the query from there (which is a simple loop on bit operations).

I hope, you found this useful. I am happy to hear your comments about this solution. At KDAB, we do these kind of optimizations specific to low-end hardware all the time, ask us if we can help you or check out our Profiling Workshop to learn how to find and tackle performance bottlenecks in your own projects.

The post A Speed-Up for Charting on Embedded appeared first on KDAB.


KDAB on Qt: KDAB Talks at Qt World Summit Berlin

$
0
0

KDAB is presenting two great talks at Qt World Summit. At 13:30, you can get an in-depth look at a new concept for designers and developers with James Turner.

At 14:30, Milian Wolff will be presenting some of KDAB’s renowned opensource tools, some of which, like Hotspot, he created himself.

Streamlined integration of 3D content straight from 3DS Max and Blender into Qt3D

with James Turner

Qt 3D is now established as the ideal 3D rendering engine for cross platform applications needing to integrate 3D content with 2D interfaces in a seamless way. The scene graph lets developers import and control geometry and materials, while the frame graph can be used to build advanced rendering  effects with ease.

 However, just as in the case of 2D content, best results are achieved when designers and developer share a common experience and toolset. Yet the tools used to author 3D scenes, the geometry, the materials, the lighting, the animations, are all very different from what most developers are familiar with.

In this talk, we introduce techniques and principles which make the collaboration between designers and developers smoother. We identify the major pain points and highlight tools and patterns for addressing each of them. We will look at data formats, model conditioning, runtime integration and rendering effects in order to produce compelling applications integrating 3D content with a traditional 2D interface.

We will illustrate all these concepts with a running example.

KDAB’s Opensource Tools for Qt

with Milian Wolff

Richard Feynman is considered one of the greatest physicists, largely because he was able to build lots of practical mathematical tools that greatly simplify the analysis of complex phenomena, thus making them accessible and useful to many.

KDAB maintains its position as the leading Qt consulting firm, partly because of the huge effort KDAB’s top-class engineers put into R&D projects to build great tooling for Qt applications. This tooling has helped countless other engineers solve bugs in their code, fix performance issues and prevent more problems from slipping into codebases.

The cherry on top of all this Qt goodness is that KDAB publishes its tooling under Opensource licenses!

Come to this talk if you want to discover how KDAB’s awesome Opensource Tools for Qt can help you.

View the full agenda here. Sign up for Qt World Summit here.

The post KDAB Talks at Qt World Summit Berlin appeared first on KDAB.

KDAB on Qt: KDAB at Embedded Technology in Japan

$
0
0

Embedded Technology in Japan took place earlier this month and we are thrilled about our first participation in this event which attracted more than 400 exhibitors and over 25000 visitors.

We are also thankful to our partners SRA group and ISB Corporation for welcoming us heartily to their booths and for making this cultural experience possible.

IoT and embedded were at the center of the exhibition and we were proud to support our Japanese partners during the event by providing our expertise in C++, Qt and 3D.

If you couldn’t join us, here is some information about what we displayed :

– At the ISB Corporation booth

Nautical Navigation infotainment demo– our luxury sailboat dashboard demo

See our video here…

– At the Software Research Associates Inc. (SRA Group) booth

OPW mPro measuring station customer showcase for the management, monitoring and automation of precision measurement systems in the context of quality control.

See more here…

Finally both booths will show our brand new 3D product that we premiered there:

Kuesa is a product that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D Qt application. Kuesa includes plugins, tools and libraries that are available for both embedded and desktop applications.

Read more about Kuesa here…

Thanks to everybody who joined us there and see you next year!

The post KDAB at Embedded Technology in Japan appeared first on KDAB.

KDAB on Qt: QtCreator CMake for Android plugin

$
0
0

Santa Claus is coming to … wait a minute, it’s not Christmas yet!

I have the pleasure to let you know that KDAB has contributed to Qt with yet another super cool project!

It’s about QtCreator CMake for Android! I know it’s a strange coincidence between this article and The Qt Company’s decision to ditch QBS and use CMake for Qt 6, but I swear I started to work on this project *before* they announced it 🙂 ! This plugin enables painless experience [cut from here] well, painless experience and cmake in the same sentence is a nonsense[/to here] when you want to create Android apps using Qt, CMake and QtCreator. It’s almost as easy as Android Qmake QtCreator plugin! The user will build, run & debug Qt on Android Apps as easy as it does with Qmake.

Before I go into the boring details, let’s see what the requirements are and, more importantly, when it will be available!

Requirements:

  • cmake 3.7 or newer (needed for server support in QtCreator)
  • NDKr18 or newer (only Clang and libc++ shared are supported)
  • Qt 5.12.1 (was too late for this patch to get in 5.12.0)

When will it be available? Well, I started the blog with the Santa on purpose, because, sadly, it’s too late to push it in QtCreator 4.8 and it will be available in the next version (4.9). If you can’t wait for QtCreator 4.9 and you like to try it sooner, you can apply this patch on top of QtCreator’s master branch.

Now back to technical details, in order to build your Qt Android application, this plugin must do some magic:

  • after it builds the C++ bits, it copies all the targets (DynamicLibraries) into “{build_folder}/android/libs/{arch}”
  • generates android_deployment_settings.json, which is needed by androiddeployqt tool

After this step, androiddeployqt will complete your Android Qt APK by copying all the Qt dependencies (libs & resources).

Last but not least, these are qmake features that you’ll not find in cmake:

  • IDE management for ANDROID_PACKAGE_SOURCE_DIRyes, it supports even the same naming as qmake. You’ll need to add the following piece of cmake script to your CMakeLists.txt file:
    if(ANDROID)
        set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android" CACHE INTERNAL "")
    endif()
    

    The CACHE is mandatory, otherwise QtCreator won’t see the variable and it won’t use it

  • IDE support ANDROID_EXTRA_LIBS, you’ll need to add the next piece of CMake script to your CMakeLists.txt file
    if(ANDROID)
        if (ANDROID_ABI STREQUAL "armeabi-v7a")
            set(ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/android_armeabi-v7a/ssl/libcrypto.so ${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/android_armeabi-v7a/ssl/libssl.so CACHE INTERNAL "")
        endif()
    endif()
    

    The previous snippet will add libcrypto.so and libssl.so files ONLY for armeabi-v7a android ABI.

Note: KDAB offers training in CMake, including all the latest tips from our trainers, who are all active developers.

The post QtCreator CMake for Android plugin appeared first on KDAB.

The Qt Company Blog: Docker-based test servers for network-related Qt autotests

$
0
0

The existing network test server has had limitations for years. Most notably, it is only available in Qt intranet. it is not accessible by Qt developers to run network tests from outside. Since the old network test server can’t easily be reproduced, the contributor relies on Qt CI to verify and debug their changes.

As for Qt internally, the server configurations are out of date and hard to be maintained. Apparently the network code and tests are out of sync. That’s why the test server doesn’t work with many legacy tests. It makes those tests blacklisted. Even we desire to do something, it is no way to remove the blacklist. Moreover, some services (e.q. Samba) don’t allow simultaneous access. When more than one virtual machine are running the test at the same time, flaky result occurs occasionally. (what a nightmare, sigh!)

Replace the monolithic test server with Docker containers

The challenge is that it needs not only consideration for the user environments but also the test framework of Qt. We want to make it ease to use for the developers., but we need to compromise under the current test framework.

After countless discussions, we have managed to make it works on both Ubuntu and macOS.  The developers can now test networking code by using local containers to run the test servers. Besides, Qt CI is doing the test of QNetworkReply with it. If nothing unexpected happens, the Windows system with MinGW compiler is coming soon.

Requirements from developers

  1. Launch the relevant infrastructure transparently when doing make check
  2. Minimal setup required without modifying host settings (e.q. /etc/hosts)
  3. Test network code locally without login Qt intranet
  4. Provide a constant environment for each test
  5. Split the monolithic test server into several dedicated services
  6. Use Gerrit to review tests and the corresponding server configurations in the same space
  7. Progressively convert tests from using the old server to using the new approach one by one
  8. The server configurations vary depending on the repository branches
  9.  Support Qt shadow builds as well

 

Requirements from Qt CI

  1. Coin loses network connectivity after provisioning
  2. Cache the provisioned images so that Coin won’t rebuild the images every time
  3. Run tests in parallel to speed up the process when staging changes
  4. The side-effect shall be completely isolated if the tests are using the same service at the same time

 

NOTE: To learn more about how to rework existing tests and create new test servers, https://wiki.qt.io/Network_Testing.

How to run tests

Just try it, and then you will see how it works!

The container-based solution shall launch itself transparently when building check target. If the user has installed docker engine on the host, the test servers will be built up inside separate docker containers, and then, the test case goes with the docker-based test servers. Otherwise, the tests will keep using the internal test server.

bash: ~/qtbase/tests/auto/network/access/qnetworkreply (dev)
$ make check

Prerequisites

Before starting the test servers, it requires the user to run the provisioning script in advance. The provisioning script is used to build up the docker images into the docker-cache. It handles the immutable parts of the server installation that rarely need adjustment.

qt5/coin/provisioning/common/linux/docker_testserver.sh
qt5/coin/provisioning/common/macos/docker_testserver.sh

What happened in the box

sequence_diagram_step

(1) Ensure that the docker images have been provisioned. If you get the massage below, please run the provisioning script, and then try again.

  • Docker machine qt-test-server not found
  • Docker image qt-test-server-* not found

(2) Use docker-compose to bring up the depending test servers

(3) Build test code with the predefined macro QT_TEST_SERVER

(4) Use mDNS to retrieve the IP address of each server and make sure their services are ready, and then start running test

(5) Destroy test servers and tidy away related files

Future works

It is not the perfect right now. There are still some works to be done. However, this is the first step, as well as the foundation that we can make it better step by step.

  1. Support multistage provisioning. Provision the test data in qtbase.
  2. Use Vagrant Docker provisioner to replace Boot2Docker

 

docker_qnetworkreply

The post Docker-based test servers for network-related Qt autotests appeared first on Qt Blog.

KDAB on Qt: KDAB Training at Qt World Summit Berlin

$
0
0

KDAB is offering eight superb Training Classes in Berlin, you can see the list below, which includes one run by our long-term collaborator, froglogic. All the rest are delivered by KDAB engineers.

There are five classes in our Introductory group, and three in the Advanced. Read the descriptions carefully to see which one you’d like to attend. An Introductory class can be just what you need for a refresher, even if you’re an experienced programmer, as our trainers are always up-to-date with the latest tips.

Introductory
Effective 3D in Qt
Introduction to CMake
Introduction to Qt/QML
Multithreading in Qt
Qt GUI Testing with Squish

Advanced
Modern C++ – What’s New in C++17?
Profiling and Debugging for Linux
QML Applications Architecture

Details

Introductory


Effective 3D in Qt

with James Turner

Target Audience: Qt developers wishing to integrate 3d technology in their application.

Prerequisites: The audience is expected to have familiarity with basic QtQuick and OpenGL concepts, but no in-depth knowledge of them is required.

Course Description

Starting with the utility and enabler classes (for OpenGL, Vulkan and the upcoming Metal support), we will look at low level support for using OpenGL with QOpenGLWindow for rendering and event handling. We will also look at the support in the Widgets module.

Later we will show the technologies available in Qt that allow deep integration of Qt Quick 2 scenes with custom drawn OpenGL content. We will discuss the possibility of simply providing a Qt Quick overlay for an OpenGL scene. The discussion will then proceed to the creation of custom Qt Quick Items drawn using raw OpenGL commands, which can then be used from QML. We will also illustrate how to manually drive Qt Quick’s own rendering if we need to be in complete control of how and when the rendering happens.

Finally, we will look at Qt 3D and how to use its scene graphs and frame graphs to create high performance 3d rendering without requiring the specialist knowledge required when accessing OpenGL directly. Along the way we will introduce the Qt 3D renderer and input systems and how they are built on top of a flexible, highly threaded, Entity Component System (ECS) architecture that scales very well and is ripe for future additions.

You will learn how to:

  • create windows for 3d rendering
  • add a Qt Quick based UI to an OpenGL application
  • create custom high performance Qt Quick Items using OpenGL
  • integrate your own OpenGL renderer with the Qt Quick Renderer
  • construct a basic Qt 3D application
  • make a scene graph, display 3D graphical content using geometry, materials, textures
  • get Qt 3D maps onto the graphics pipeline
  • extend Qt 3D to use your own custom geometry
  • write custom materials and shaders
  • completely control the Qt 3D renderer dynamically at runtime using the Frame Graph
James Turner

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 user-interface, 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.


Introduction to CMake

with Kevin Funk

Target Audience: C and C++ Developers who are interested in how to build their code.

Prerequisite: Experience with build systems.

“The best thing a build system can do is not get in the way”.

Course Description

CMake is the de facto standard build system for C and C++ outside of frameworks that require their own. It has earned this place by supporting the situations and special cases that arise in real projects.

Support for CMake within Qt is being significantly improved and there are longer term plans to switch to CMake for building Qt itself. It’s currently a good alter- native if you hit limitations in qmake.

This course will teach the basics of creating and building projects with CMake.  In recent years, CMake has introduced some cleaner and more precise constructs. The course will focus on the new constructs where possible.

Why learn CMake? CMake has broad functionality that covers many real world problems. Learning CMake enables you to solve advanced build requirements. This includes cross-platform builds, feature detection based on platform or available libraries, built- time configurable feature switches and custom build steps. CMake is increasingly widely adopted across the industry.

Kevin Funk

Kevin has actively developed with Qt/C++ since 2006 and has a special interest in tooling and profiling. He’s an active contributor to KDAB’s GammaRay analyzer (a high-level Qt application debugger) and has a strong emphasis on state machine tooling. He is co-maintainer of the KDevelop IDE, a powerful C/C++ development environment backed by Clang, and is pushing for cross-platform success inside KDE. Kevin holds a Masters Degree in Computer Science.


Introduction to Qt/QML

with Jan Marker

Target Audience: Developers and managers interested in learning the autonomy of a QML application.

Prerequisite: Knowing the basics of Qt at C++ level is an advantage but not a requirement.

Course Description

This training is an introduction to Qt Quick. On the one hand it will teach you how to compose fluid user interfaces with slick animations using the QML language. On the other hand it will teach you how you hook the QML side up to your business logic in C++.

Course contents

  • Connecting a QML UX with C++ business logic
  • Complex list views including data provided from C++ models
  • Custom objects implemented using Qt Quick scene graph
  • Profiling and best practices for optimal performance

Why learn Qt/QML? Designed to take people new to Qt or QML, from the basics to a deep functional understanding of best practices, this Qt/QML training will equip you with the skills and know-how to boost your productivity at work.

Jan Marker

Software Engineer at KDAB, Jan has been using Qt since 2009 when he started contributing to the KDE project. Since joining KDAB he has worked on multiple large Qt and QML projects, while more recently also developing Wayland compositors. Besides in-depth knowledge of Qt and C++, Jan also has a deep interest in other technologies like NodeJS. He holds a BSc in Computer Science.


Multithreading in Qt

with Kevin Krammer

Target Audience: Qt Developers interested in multithreaded programming.

Prerequisite: Knowledge and experience programming with Qt and C++. A basic understanding of multithreaded programming is an advantage but not required.

Course Description

Multithreaded programming is essential for developers to create fast and responsive applications on computers, phones, and embedded devices all with an increasing number of cores. Qt offers several mechanisms for multithreading; however, it can be difficult to know which to use and how to steer clear of common pitfalls. This course offers guidance how to write safe and efficient multithreaded code with Qt.

Topics include:

  • Basic multithreading concepts (threads, processes, data races, reentrency, shared data)
  • Synchronization primitives (mutexes, semaphores, condition variables)
  • Special concerns for Qt applications (cross-thread signals/slots, QObject thread affinity, the GUI thread)
  • Low-level multithreading with Qt (QThread, QThreadPool, QMutex, etc)
  • High-level multithreading with Qt (QtConcurrent)
  • Threading with Qt Model/View
  • A brief summary of atomic operations

Why learn about Multithreading with Qt? Multithreaded development is a complex subject where it is easy to write code that contains severe bugs yet looks correct. This training will provide a solid foundation for writing safe and effective multithreaded code in Qt applications.

Kevin Krammer

Senior Software Engineer and team lead at KDAB, Kevin has actively developed with Qt and contributed consistently to KDE since 2000. He is a founding member of the QtCentre website and has mentored at Google’s Summer of Code program for 10 years. One of KDAB’s most experienced trainers, Kevin keeps our training material up-to-date and has trained engineers from Blackberry, Lockheed Martin, Siemens and Safegate and many others. Kevin holds a BSc in Software and Communications Engineering.


Qt GUI Testing with Squish

with Tomasz Pawlowski

Prerequisites: The course is for developers and testers already familiar with the basic concepts of Qt.

Course Description

In order to achieve high quality applications during testing process all the functionality of the software shall be covered, including fully exercising GUI itself. For regression testing automating this process gives benefits, saving execution time and increasing accuracy. On the other hand, GUI Automation might be a challenge, as GUI may change significantly during a product life cycle.

In this course we learn how to design and implement cross-platform automated tests using Squish GUI Tester for Qt, QML & QtQuick applications that continue to work as your product evolves.

  • Introduction to GUI Testing
  • Squish Overview (installation, configuration)
  • Test Script Creation and Execution
    • Recording and Replaying Test Scripts
    • Verification Points (Properties, Screenshot, Visual)
    • Test Results and Logging
    • Squish API
    • Image-Based Lookup
  • Development of Test Cases at Business Level
  • Set-Up and Tear-Down Functions
  • Debugging Test Scripts
  • Object Recognition
  • Accessing Application Internals (Inspecting, Object Properties and Methods)
  • Synchronisation and Event Handling
  • Squish Command-Line Tools
  • Working with Multiple Applications
  • Hooking into Running Applications
  • Squish Integration with CI
Tomasz Pawlowski

Software engineer at froglogic, Tomasz started the adventure with Squish and GUI Testing in 2011, designing and implementing automated tests for a Flight Planning solution at Lufthansa Systems. In 2014 he joined froglogic and is conducting Squish trainings and consulting for many companies in Europe, India and the USA. Additionally, Tomasz is implementing Squish integrations. Tomasz has a degree in computer science from Nicolaus Copernicus University in Poland.


Advanced

Modern C++ – What’s New in C++17?

with Giuseppe D’Angelo

Target Audience: C++ developers who want to know more about the new features introduced in C++17.

Prerequisite: Knowing the basics of C++11 is a requirement, though more advanced topics will be explained as needed.

Course Description

Starting with C++11 released in 2011, the C++ language and standard library have steadily evolved. At the end of 2017 the new C++17 standard was released, adding a sizable amount of useful new features. All major compilers already support most (if not all) of its features.

In this training, the most useful of the new features introduced in C++17 and its predecessor will be presented. In cases for which these features depend on features introduced in C++11 or C++14, these will be refreshed as well.

New library features being presented include the new types std::any, std::optional and std::variant, the new parallel algorithms, filesystem access, std::string_view and new operations on the container classes. The new language features range from ways to improve template code with fold expressions, constexpr if, and class template deduction over improvements of lambdas to structured bindings and initalizers in if and switch statements.

Why learn what’s new in C++17? C++ is the language that powers most applications written with Qt. To make the most out of the language, developers need to know its capabilities and pitfalls, and keep up with the incremental changes done in new releases. Doing so rewards them with ways to write easier, faster, cleaner and safer code

Giuseppe D’Angelo

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.


Profiling and Debugging for Linux

with Milian Wolff

Target audience: Developers who want to find and fix problems,

Prerequisite: Knowing the basics of C++ and Qt,

Course Description

This training introduces various tools, which help developers and testers in finding bugs and performance issues. This variant of the training focuses on Linux.

The tools presented cover a wide range of problems, from general purpose debugging and CPU profiling to Qt specific high-level analyzers. Often, it is relatively simple to run a tool, but interpreting the results, or even just using some of the more advanced tools, requires deep technical knowledge. The following tools will be covered:

Debugging

  • General purpose debugger: GDB
  • Record and replay, reverse debugging: RR
  • Memory error detectors: AddressSanitizer
  • Thread error detectors: ThreadSanitizer
  • Various Qt built-in features
  • GammaRay to investigate internals of Qt Applications

Static Code Analysis

  • Compilers
  • Clazy

Profiling

  • CPU: Linux perf and hotspot
  • Heap memory: heaptrack
Milian Wolff

Senior Software Engineer at KDAB, Milian leads the R&D in tooling and profiling in which he has a special interest. Milian created Massif-Visualizer and heaptrack, both of which are now used regularly to improve the performance of C++ and Qt applications. When not applying his knowledge to improving code-base performance for KDAB’s customers, Milian maintains QtWebChannel for the Qt Project and is co-maintainer of the KDevelop IDE. In 2015, Milian won KDE’s Akademy Award for his work on Clang integration. He has a Masters Degree in Physics.


QML Applications Architecture

with Tobias Koenig

Target audience: QML developers who want to learn about creating large-scale yet maintainable applications.

Prerequisite: Being comfortable with the basics of QML, as well as some familiarity with developing with C++ and Qt (QObject, signals & slots, properties, etc).

Course Description

QML is a great language for expressing user interfaces in a declarative, easy to understand way. It can however be difficult to scale up from small demo applications to fully featured, complex systems without paying too high a price in complexity, performance and maintainability. In this course, we explore different techniques to deal with these issues to enable you to scale up your applications while steering clear from the common pitfalls.

Topics include:

  • Custom QML items
  • C++ integration
  • Declarative coding
  • Multi-page application architectures
  • Code organization
Tobias Koenig

Senior Software Engineer at KDAB, Tobias has actively developed with Qt since 2001 and has been an active KDE contributor during this time. His contributions have been mainly to the KDE PIM project and the KDE libraries, but also to other open source projects.

There’s still seats left for the One-Day Training at Qt World Summit in Berlin!

Sign up…

The post KDAB Training at Qt World Summit Berlin appeared first on KDAB.

KDAB on Qt: KDAB demos at Qt World Summit, Berlin

$
0
0

KDAB is the main sponsor at Qt World Summit 2018.  In Berlin, we’ll be hosting a training day on December 5th  offering both Introductory and Advanced one day training classes and on December 6th you can listen to two talks from KDAB experts:

  • Streamlined integration of 3D content straight from 3DS Max and Blender into Qt3D, with James Turner, and
  • KDAB’s Opensource Tools for Qt with Milian Wolff.

KDAB will also be exhibiting on both days, starting at 5pm on Wednesday December 5th. Come to our booth and see:

Qt Quick Software Renderer

At Qt World Summit KDAB will show the Qt Quick Software Renderer in action on the very competitively priced NXP i.MX6 ULL platform. Thanks to some clever coding from KDAB, it provides a fluid 60fps touch UI and H.264 video decoding in spite of having neither GPU nor video decoding acceleration on the hardware.

You can now have the full feature set of Qt at your disposal, even at as little as 64MB of RAM and/or Flash memory.

  • NXP i.MX6 ULL (no GPU/VPU/IPU)
  • Fluid 60fps touch UI
  • 64MB RAM/Flash
  • H.264 video decoding using PxP acceleration
  • Full Qt feature set available

See more….

Kuesa – 3D asset creation and integration workflow

Kuesa is a solution that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D software user-interface.

  • Streamlined integration of 3D content from e.g. 3DS Max and Blender
  • High-performance real-time rendering
  • Uses Qt and Qt 3D engine
  • Available on desktop and embedded

Find out more about Kuesa…

KDAB GammaRay

A high-level introspection tool for Qt applications, KDAB’s GammaRay allows you to examine and manipulate application internals at runtime, either locally or on an embedded target. Augmenting conventional debuggers, GammaRay leverages QObject to visualize application behavior at a high level, especially useful where complex Qt frameworks such as model/view, state machines, QGraphicsView or QTextDocument are involved. GammaRay is integral to the Qt Automotive Suite all-in-one package, where it also offers QtCreator integration.

  • High-level introspection tool for Qt applications
  • Insight into Qt Quick and Qt 3D scene graphs
  • Visual state machine debugger
  • Inspect models, layouts, rendering and much more

Find out more about GammaRay…

Clazy Static Code Analyzer

An opensource project spawned by KDAB’s R&D efforts for better C++ tooling, Clazy Static Code Analyzer is an LLVM/Clang-based static analyzer for Qt 5 that extends your compiler with approximately 50 Qt-oriented warnings.

Clazy Static Code Analyzer highlights Qt-related bugs, performance issues or unneeded memory allocations and performs a code rewrite for common tasks like porting to the Qt 5 connect syntax.

Clazy Static Code Analyzer integrates seamlessly with most existing build systems, and is bundled with the latest versions of QtCreator if you don’t want to compile it your self.

  • LLVM/Clang-based static analyzer for Qt
  • Highlights Qt-related bugs, performance issues or unneeded memory allocations
  • Code rewrite for common tasks like porting to the Qt 5 connect syntax
  • Seamless integration with most existing build systems

See our video about Clazy…

KDAB Hotspot Profiler

Created by KDAB’s Milian Wolff, who will be talking about this and other KDAB open source tools at Qt World Summit, KDAB Hotspot profiler does all the heavy lifting for you, when you need to analyze profiling data on Linux Perf.

  • GUI for Linux Perf to analyze profiling data
  • Bottom-Up and Top-Down tree views
  • Caller/Callee list
  • FlameGraph
  • Time line

See how Hotspot works…

Qi – Cellular Tissue Imaging in Qt 3D

Demonstrating the power of Qt 3D, this shows stunning 3D visualizations of microscopic tissue samples that help researchers better understand cell pathology in the fight against cancer. The 3D images are created out of 2D images from electron microscopes in cutting edge clinical diagnostics data sets. The process enables real-time conversion to 3D from 30 image channels using Qt 3D.

  • 3D visualization of microscopy of tissue samples
  • 2D images from cutting edge clinical diagnostics data sets
  • Real-time conversion to 3D from 30 image channels using Qt 3D

Find out more…

nanoQuill Interactive Wall

KDAB will be presenting the nanoQuill interactive display wall at Qt World Summit, where participants can literally help in the cure for cancer by coloring in images of cells. This is a collaboration between KDAB, the Qt Company, Quantitative Imaging Systems (Qi), and Oregon Health & Science University that crowd-sources electron microscope images of cancer cells for people to artfully color, thus #color4cancer.

Once photographed, completed images can be sent to the nanoQuill website where machine learning engages in discerning cell micro structures, helping us understand how tumour cells develop resistance to escape cancer-targeting drugs.

Find out more about nanoQuill….

The post KDAB demos at Qt World Summit, Berlin appeared first on KDAB.

KDAB on Qt: KDAB at Capitole du Libre

$
0
0

Le Capitole du Libre, évènement de logiciel libre annuel à Toulouse auquel KDAB (France) était Sponsor Or pour la 8ème année consécutive, s’est achevé la semaine dernière après 2 jours de conférence intense proposant de nombreuses présentations en parallèle.

Les sujets allaient de l’IoT et l’embarqué au C++ et à la 3D en passant par les libertés et vie privée ainsi que le financement du logiciel libre pour n’en citer que quelques-uns.

Voyez le programme ici.

M. Kevin Ottens a animé‘Des blobs colorés pour l’analyse de données communautaires’ et M. Franck Arrecot a présenté ‘Introduction à Qt QML et à la création de composants’.

Si vous n’avez pas pu y assister, vous pouvez télécharger leur présentation ici:

Merci à tous ceux qui sont venus et à l’an prochain!

The post KDAB at Capitole du Libre appeared first on KDAB.


KDAB on Qt: KDAB releases Kuesa™ for 3D asset creation and integration workflow

$
0
0

KDAB announces the release of Kuesa™, a solution that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D software user interface.

Kuesa provides an easy, integrated and unified workflow without any compromises for designers and developers giving:

  • great performance on both desktop and embedded boards
  • high quality real-time 3D scenes
  • full expressiveness for designers, using professional 3D design tools
  • full control of integration for developers
  • reduced time to market.

For a practical demo, have a look at the tutorials created by KDABian Timo Buske, showing a complete workflow from the designer to the developer:

Kuesa is now available under both an AGPL and Commercial license. For more details about Kuesa and how to download it, visit the Kuesa web page.

Also, at this year’s Qt World Summit Berlin, KDAB’s James Turner will be giving a presentation on Kuesa titled, Streamlined Integration of 3D Content straight from 3DS Max and Blender into Qt3D. You can also view a demo of Kuesa at KDAB’s booth.

The post KDAB releases Kuesa™ for 3D asset creation and integration workflow appeared first on KDAB.

KDAB on Qt: Qt World Summit 2018 Boston

$
0
0

This year’s North American stop on the Qt World Summit world tour was in Boston, held during the Red Sox’s World Series win. Most of us were glad to be flying home before celebration parades closed the streets! The Qt community has reason to celebrate too, as there’s an unprecedented level of adoption and support for our favorite UX framework. If you didn’t get a chance to attend, you missed the best Qt conference on this continent. We had a whole host of KDABians onsite, running training sessions and delivering great talks alongside all the other excellent content. For those of you who missed it, don’t worry – there’s another opportunity coming up! The next stop on Qt’s European tour will be with Qt World Summit Berlin December 5-6. Be sure to sign up for one of the training sessions now before they’re sold out.

Meanwhile, let me give you a taste of what the Boston Qt World Summit had to offer.

Strong Community

One thing was clear: after 23 years, Qt is still going strong. The Qt Company and the greater Qt community have contributed 29,000 commits and fixed 5000 bugs between Qt 5.6.3 and the current head branch. Very kindly and much appreciated, Lars Knoll, CTO of the Qt Company, recognized KDAB as the largest and longest external contributor to the ever-growing Qt codebase in his opening keynote. All of this effort – and most of the things discussed in this blog – come to fruition in Qt 5.12 LTS, with an expected release date at the end of November.

Qt is Everywhere

Training day @ QtWS18

Training day @ QtWS18

Another observation is that Qt is everywhere. Lars shared that it has now been downloaded five million times, a huge increase from three and a half million just two years ago. The more than 400 attendees at Qt World Summit Boston came from over 30 industries, representing academia, automotive, bioscience, defense, design, geo imaging, industrial automation, energy and utilities, and plenty more. All the training sessions and the talks were well attended, most to full capacity with eager attendees standing at the back.

Cross-platform Qt

Is there a reason for this upsurge in Qt interest? Multi-platform is now a critical strategy for nearly every product today. Since Qt provides comprehensive support for mobiles, desktops, and embedded, it has become a top choice for broad cross-platform UX development. It’s not enough to release a cool, innovative product – if it doesn’t link to your desktop or provide a mobile-compatible connection, it often can’t get off the ground.

Qt for Microcontrollers

Qt for Microcontrollers

While there weren’t too many new platforms announced that Qt doesn’t already run on, there was invigorated discussion and demoing at the low end of the embedded spectrum. Qt on Microcontrollers is a new initiative, trimming Qt down to run on smaller MMU-less chips like the Arm Cortext-M7. While still needing some optimization and trimming to get to the smallest configurations, Qt on Microcontrollers currently takes 3-10MB of RAM and 6-13MB of ROM/Flash, making it an attractive option to create one code base that can address a range of products regardless of form factor.

Broad Offering

Another reason behind Qt’s increasing prominence is the breadth of the Qt offering. From 3D through design to web, there are many new improvements and components that make Qt a safe choice for teams that need to continually expand their product’s capabilities. While there have been a host of new additions to the Qt portfolio, here are a few of the more notable ones.

Qt 3D Studio

In a programmer’s worldview, design is often a nice-to-have, yet not a must-have. I guarantee that perspective will change for anyone who had the good fortune of attending Beyond the UX Tipping Point, the keynote from Jared Spool, the so-called Maker of Awesome from Center Centre.

Kuesa preview

Kuesa preview

If you weren’t able to attend the conference, I recommend you watch Jared’s video. Once you do, you’ll be glad that the Qt Company just released Qt Design Studio to help build great interfaces. KDABian Mike Krus also gave a tantalizing preview of Kuesa, a new KDAB tool architected to marry the worlds of design and development. We’ve got some info on our Kuesa webpage (and a screenshot here) – keep an eye out for more to come soon.

Qt for Python

As an aficionado of the language, I’ve always found Python seriously missing UX support – there are solutions but none that are ideal. With the release of Qt for Python however, Python finally has a capable, regularly maintained UI tool with a huge community. This includes integration into the Qt Creator IDE; it will now go from a technical preview to officially supported in Qt 5.12 and beyond. I predict that this will soon make Qt the UI framework of choice for Python – happy news for the many folks who prefer C++ be neatly tucked under the covers.

WebAssembly

There are some clear benefits to running code within a browser recognized by cloud companies – lightweight (and often no) installation required, access everywhere to centralized, managed, and backed-up data stores, along with immediate and hassle-free updates. Those same benefits have now come to Qt with the support of WebAssembly. This lets you compile your Qt application (and with C++ too, not just QML/Qt Quick, mind you) into a WebAssembly compatible package to be deployed on a web server. This technology is now in tech preview, but it’s an active project that will be able to expand the reach of Qt into the cloud realm.

Building Bridges

Frances and Ann #color4cancerMaybe all this flurry of Qt activity is also because it provides a common platform that can build a bridge between disparate disciplines like art, technology, and research. An example of this is nanoQuill, a collaboration between KDAB, the Qt Company, a biotech company: Quantitative Imaging Systems (Qi), and Oregon Health & Science University that crowd-sources electron microscope images of cancer cells for people to artfully color, thus #color4cancer.

Based on Qi’s vision of merging programming and computer graphics with microscopy, nanoQuill built an application to use machine learning on these human colored images to discern cell micro structures, which in turn helps us understand how tumour cells develop resistance to escape cancer-targeting drugs.

Final #color4cancer cell

Final #color4cancer cell

Currently, nanoQuill allows anyone to #color4cancer and post their artwork via their website gallery, a coloring book, nanoQuill: The Coloring Book of Life published in December of 2017, and will soon be in a form of an app. We had a large nanoQuill poster in our booth that people colored throughout the event, allowing Qt World Summit attendees to truthfully say they were not only learning about the latest Qt developments, they were helping fight cancer with art.

CNC Craftspeople

Shaper Origin in action

Shaper Origin in action

Another great merger of art and technology was seen at our KDAB customer showcase from a company called Shaper Tools. If you think you saw a table full of dominos at the edge of our booth, we weren’t passing the time playing – those “dominos” were actually optical registration tapes that allowed Shaper’s hand-held CNC machine to perfectly cut complex shapes. Look at some of the amazing projects that woodworkers have created using the Shaper Origin, and you’ll see that advanced technology doesn’t have to replace master craftsmanship – it can enable it.

Summary

Whether you attended Qt World Summit 2018 to learn about the details of C++ and Qt or the industry trends in medical, automotive, and IoT, there was lots in Boston for everyone. If you care to share in the comments, we’d love to hear what your favourite session was and the best thing you learned.

The post Qt World Summit 2018 Boston appeared first on KDAB.

KDAB on Qt: A Speed-Up for Charting on Embedded

$
0
0

I’d like to talk about a common problem that we have seen come up in several projects, namely how to plot large datasets over time in an efficient manner using Qt. This seems to be a general issue, especially in embedded situations and is affecting many people. Because of this, I thought we’d share one approach that we have found to work well in some situations, maybe it helps you out in your project.

Problem: Waveform Graphs of Large Data Sets

We have a situation where we are accumulating more than 500.000 samples of sensor data. The data is appended over time to a huge array.

We want to visualize this growing amount of sensor information as a waveform graph:

To intelligently render this on low-profile hardware, we cannot visit all the data points in a single render pass, but we need to cheat. Instead of drawing lines between all the hundreds of thousands of data points, we draw each vertical pixel column as one line reaching from the minimum sample to the maximum sample.

With this method, we only need to render a few hundred lines instead of hundreds of thousands to reach the same visual result.

To pull off this trick, however, we need to query minmax(beginIndex, endIndex) to obtain the range of values for which to draw a line very efficiently and very often. For this, I developed a MinMaxTree data structure which can offer high speeds for this query. The effective API of such a data structure can look like this:

template  class MinMaxTree
{
public:
    explicit MinMaxTree();
 
    void append(T value);
    MinMax getMinMaxInRange(size_t rangeBegin, size_t rangeEnd) const;
// ...
};

This API allows you to insert a single data sample to store new sensor data. It also lets you retrieve the minimum and maximum given begin and end indices, which we can then use to render a line in our waveform.

Crafting an Append-Only Min–Max Tree as a Search Index

Remembering computer science classes, I figured that reusing prior calculations can save a lot of work (dynamic programming). In addition, given very large data sets, trees can cut your query times tremendously by intelligently arranging data or—to put it differently—by allowing us to skip a vast amount of data quickly.

The solution I explain in this blog post uses both approaches at their best.

Here is the tree I modeled on top of the data:

The tree summarizes ranges of data points in the underlying array. I designed the tree nodes to contain the minimum and maximum values of their range. Since parent nodes represent the data of their left and right children, they contain the minimum and maximum of their combined ranges. Finally, the root node contains the minimum and maximum values of the entire data set.

Because I want to keep the tree small and profit from caching effects, each node represents a sub-range or “bucket” of the array. The bucket size can be adjusted to match the cache sizes of the hardware best. This keeps the tree flat while still enabling fast linear scans inside the bucket.

Appending a Value, Updating the tree

There are two tasks that come with insertion: updating the tree and, optionally, extending the tree.

When appending a value, it needs to update the overlying tree structure. When inserted, the value needs to find and update its respective tree leaf, which, in turn, must inform its parent node and so on. I hope that it’s easy to see that if a node’s minimum or maximum do not change, it does not need to inform its parent node. Using this optimization, the average-case complexity of insertion is very low. The code snippet below illustrates this recursive “bubbling up” of a value trough the tree:

template;
void MinMaxTree::bubbleUpMinMax(T value, size_t treeIndex)
{
    //updates and returns true, if we altered minmax in the node
    auto minmax = [&](T value) -> bool
    {
        auto &node = m_treeOntopOfBuckets.at(treeIndex);
        const auto oldmin = node.min;
        const auto oldmax = node.max;
        node.min = std::min(value, node.min);
        node.max = std::max(value, node.max);
        return (value < oldmin || value > oldmax);
    };
 
    //we are at the root, break recursion
    if (treeIndex == m_treeCapacity/2)
    {
        minmax(value);
        return;
    }
    //update node and optionally bubble up further
    else
    {
        if (minmax(value))
            bubbleUpMinMax(value, parent(treeIndex));
    }
}

The second problem when inserting a value is that our tree structure might need to grow, because the new value breaches the capacity of the existing tree. Here, the tree needs to extend“sideways” to leave its complete old structure intact and form a new node on top. For this, I

  1. double the trees size and mirror its current structure to extend its reach,
  2. make a new root,
  3. copy the data from the old root into the new root.

Now that we have doubled the tree size, we can again insert data until we need to expand again.

A note on the default values inside our nodes: I initialize all nodes with the highest possible value as minimum and lowest possible value as maximum.

template MinMax{
    T min = std::numeric_limits::max();
    T max = std::numeric_limits::lowest(); 
    //it’s not ::min(), this costed me hours
};

So when actual real values enter the array, they will change min and max, because they are different to these default extremes.

BE WARNED!std::numeric_limits::min() represents the smallest positive representation of a value, not the lowest possible number. I learned it the hard way.

Indexing: Squeezing the Tree into an Array

In our case, I wanted to optimize the tree accesses and its growth without using a pointer implementation that would link a node to its children using pointers.

Instead, I adopted a commonly used trick to squeeze heaps into arrays, by letting the left child of an element be at 2 × index and the right child at 2 × index + 1. While it seems that I could have used this approach for this project as well, growing the tree would require me to insert and make space at many places. Instead, I went with an infix indexing method, putting the tree into an array in a “left node–root node–right node” order like this:

This is nice for several reasons:

  • It eliminates the need for the use of pointer chasing.
  • Nodes and their parents are fairly close (in the lower tree).
  • Expanding the tree is just doubling the array in size.
  • The root node will be in the middle of the array.

To have convenient ways of accessing rightChild and leftChild as well as the parentNode from a certain index, we have to look at the binary representation of our indices. Note how the parent index, for instance, always is the next higher “pure” power of 2. It would be a bit cumbersome to explain all the magic bit in text form, instead the code tells it best:

leftChild Find lowest set bit, unset it, and set the one-lower bit

template
size_t MinMaxTree::leftChild(size_t index) const
{
    int lsb = ffs(index);
    index &= ~(1UL << (lsb-1));
    index |= 1UL << (lsb-2);
    return index;
}

rightChild Find lowest set bit and set the one-lower bit

template
size_t MinMaxTree::leftChild(size_t index) const
{
    int lsb = ffs(index);
    index |= 1UL << (lsb-2);
    return index;
}

parentNode Find lowest set bit, unset it, and set the one-higher bit

template
size_t MinMaxTree::parent(size_t index) const
{
    int lsb = ffs(index);
    index &= ~(1UL << (lsb-1));
    index |= 1UL << lsb;
    return index;
}

All Functions use the glibc-provided intrinsic ffs, which can be found in  (FindFirstSet to identify the lowest-significant set bit). On Windows, the intrinsic BitScanForward can be used to accomplish this. Similarly, I wrote a function to return the actual range in our data array a particular node covers.

Querying a Range

Now that we have all tools in hand, we can finally implement the range query itself.

We recursively query the tree nodes, starting from root downward. We check how a node’s range relates to our query range and query its children for the minimum and maximum, according to the following few cases:

Case 1: The node’s range is outside of  the query range → Return the uninitialized min/max.

Case 2: The node’s range is fully enclosed in the query range → That’s the best case, we just return the node’s min/max.

Case 3: The node’s range is partly inside, partly outside the query range or the node covers more than the range and we can split → Split, query left and right, and combine the results.

Case 4: The node’s range overlaps and we are at a leaf node → We need to scan through the bucket.

template
MinMax::queryNode(size_t nodeIndex, size_t rangeBegin, size_t rangeEnd) const
{
    // […] calculate Node Range, store in NodeBegin, NodeEnd  
 
    // node outside range, return empty MinMax()
    //               |------range----|
    //  |---node---|           or     |---node---|
    // this should never happen, but safe is safe
    if ((nodeEnd < rangeBegin) || (nodeBegin > rangeEnd))
        return MinMax
 
    // range spans node fully, return nodes' MinMax
    // |---------range-----------|
    //      |------node------|
    if ((rangeBegin <= nodeBegin) && (rangeEnd >= nodeEnd))
        return m_treeOntopOfBuckets[nodeIndex];
 
    // node cuts range left or right or both
    //       |------range----|
    //  |---node---| or |---node---| or
    //     |--------node-------|
    if ((nodeBegin <= rangeBegin ) || (nodeEnd >= rangeEnd))
    {
        const MinMax leftMinMax = queryNode(leftChild(nodeIndex), rangeBegin, rangeEnd);
        const MinMax rightMinMax = queryNode(rightChild(nodeIndex), rangeBegin, rangeEnd);
        MinMax resultMinMax;
        resultMinMax.min = std::min(rightMinMax.min, leftMinMax.min);
        resultMinMax.max = std::max(rightMinMax.max, leftMinMax.max);
        return resultMinMax;
    }
     
    // Node is leaf, re-scan its bucket for subrange
    //              |---------range-----------|
    //  |----node(leaf)----|   or   |----node(leaf)----|
    if( nodeIndex % 2 == 1)
    {
        MinMax scanResult;
        for(size_t i = std::max(nodeBegin, rangeBegin); i <= std::min(nodeEnd, rangeEnd); i++)
        {
            scanResult.min = std::min(m_dataInBuckets[i], scanResult.min);
            scanResult.max = std::max(m_dataInBuckets[i], scanResult.max);
        }
        return scanResult;
    }
}

Results

Visualizing 300.000 data points took more than 2 seconds with the naïve approach (drawing lines from point to point) on the embedded test hardware, while this approach brought down the time for queries to about 3 ms, such that the pure line rendering now even accounts for the bigger part of the cost (6 ms). We again have reached levels below the juicy target of 16 ms.

Further Optimization: Find Lowest Common Parent

In a similar setup, my colleague James Turner found that many of our node visits actually were searching down the tree for the lowest common node covering the full range. In these cases, we often ended up splitting the node in its two children, one of which containing the range fully and the other not containing the range at all.

This initial search down the tree took most of the node visits, while the actual desired min max scan (collecting all the nodes containing the range) was less than that.

So instead of searching from the top, beginning at the root node, I now calculate the left and right leaves, then determine the lowest common node spanning the full range, and perform the query from there (which is a simple loop on bit operations).

I hope, you found this useful. I am happy to hear your comments about this solution. At KDAB, we do these kind of optimizations specific to low-end hardware all the time, ask us if we can help you or check out our Profiling Workshop to learn how to find and tackle performance bottlenecks in your own projects.

The post A Speed-Up for Charting on Embedded appeared first on KDAB.

KDAB on Qt: KDAB Talks at Qt World Summit Berlin

$
0
0

KDAB is presenting two great talks at Qt World Summit. At 13:30, you can get an in-depth look at a new concept for designers and developers with James Turner.

At 14:30, Milian Wolff will be presenting some of KDAB’s renowned opensource tools, some of which, like Hotspot, he created himself.

Streamlined integration of 3D content straight from 3DS Max and Blender into Qt3D

with James Turner

Qt 3D is now established as the ideal 3D rendering engine for cross platform applications needing to integrate 3D content with 2D interfaces in a seamless way. The scene graph lets developers import and control geometry and materials, while the frame graph can be used to build advanced rendering  effects with ease.

 However, just as in the case of 2D content, best results are achieved when designers and developer share a common experience and toolset. Yet the tools used to author 3D scenes, the geometry, the materials, the lighting, the animations, are all very different from what most developers are familiar with.

In this talk, we introduce techniques and principles which make the collaboration between designers and developers smoother. We identify the major pain points and highlight tools and patterns for addressing each of them. We will look at data formats, model conditioning, runtime integration and rendering effects in order to produce compelling applications integrating 3D content with a traditional 2D interface.

We will illustrate all these concepts with a running example.

KDAB’s Opensource Tools for Qt

with Milian Wolff

Richard Feynman is considered one of the greatest physicists, largely because he was able to build lots of practical mathematical tools that greatly simplify the analysis of complex phenomena, thus making them accessible and useful to many.

KDAB maintains its position as the leading Qt consulting firm, partly because of the huge effort KDAB’s top-class engineers put into R&D projects to build great tooling for Qt applications. This tooling has helped countless other engineers solve bugs in their code, fix performance issues and prevent more problems from slipping into codebases.

The cherry on top of all this Qt goodness is that KDAB publishes its tooling under Opensource licenses!

Come to this talk if you want to discover how KDAB’s awesome Opensource Tools for Qt can help you.

View the full agenda here. Sign up for Qt World Summit here.

The post KDAB Talks at Qt World Summit Berlin appeared first on KDAB.

KDAB on Qt: KDAB at Embedded Technology in Japan

$
0
0

Embedded Technology in Japan took place earlier this month and we are thrilled about our first participation in this event which attracted more than 400 exhibitors and over 25000 visitors.

We are also thankful to our partners SRA group and ISB Corporation for welcoming us heartily to their booths and for making this cultural experience possible.

IoT and embedded were at the center of the exhibition and we were proud to support our Japanese partners during the event by providing our expertise in C++, Qt and 3D.

If you couldn’t join us, here is some information about what we displayed :

– At the ISB Corporation booth

Nautical Navigation infotainment demo– our luxury sailboat dashboard demo

See our video here…

– At the Software Research Associates Inc. (SRA Group) booth

OPW mPro measuring station customer showcase for the management, monitoring and automation of precision measurement systems in the context of quality control.

See more here…

Finally both booths will show our brand new 3D product that we premiered there:

Kuesa is a product that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D Qt application. Kuesa includes plugins, tools and libraries that are available for both embedded and desktop applications.

Read more about Kuesa here…

Thanks to everybody who joined us there and see you next year!

The post KDAB at Embedded Technology in Japan appeared first on KDAB.

KDAB on Qt: QtCreator CMake for Android plugin

$
0
0

Santa Claus is coming to … wait a minute, it’s not Christmas yet!

I have the pleasure to let you know that KDAB has contributed to Qt with yet another super cool project!

It’s about QtCreator CMake for Android! I know it’s a strange coincidence between this article and The Qt Company’s decision to ditch QBS and use CMake for Qt 6, but I swear I started to work on this project *before* they announced it 🙂 ! This plugin enables painless experience when you want to create Android apps using Qt, CMake and QtCreator. It’s almost as easy as Android Qmake QtCreator plugin! The user will build, run & debug Qt on Android Apps as easy as it does with Qmake.

Before I go into the boring details, let’s see what the requirements are and, more importantly, when it will be available!

Requirements:

  • cmake 3.7 or newer (needed for server support in QtCreator)
  • NDKr18 or newer (only Clang and libc++ shared are supported)
  • Qt 5.12.1 (was too late for this patch to get in 5.12.0)

When will it be available? Well, I started the blog with the Santa on purpose, because, sadly, it’s too late to push it in QtCreator 4.8 and it will be available in the next version (4.9). If you can’t wait for QtCreator 4.9 and you like to try it sooner, you can apply this patch on top of QtCreator’s master branch.

Now back to technical details, in order to build your Qt Android application, this plugin must do some magic:

  • after it builds the C++ bits, it copies all the targets (DynamicLibraries) into “{build_folder}/android/libs/{arch}”
  • generates android_deployment_settings.json, which is needed by androiddeployqt tool

After this step, androiddeployqt will complete your Android Qt APK by copying all the Qt dependencies (libs & resources).

Last but not least, these are qmake features that you’ll not find in cmake:

  • IDE management for ANDROID_PACKAGE_SOURCE_DIRyes, it supports even the same naming as qmake. You’ll need to add the following piece of cmake script to your CMakeLists.txt file:
    if(ANDROID)
        set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android" CACHE INTERNAL "")
    endif()
    

    The CACHE is mandatory, otherwise QtCreator won’t see the variable and it won’t use it

  • IDE support ANDROID_EXTRA_LIBS, you’ll need to add the next piece of CMake script to your CMakeLists.txt file
    if(ANDROID)
        if (ANDROID_ABI STREQUAL "armeabi-v7a")
            set(ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/android_armeabi-v7a/ssl/libcrypto.so ${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/android_armeabi-v7a/ssl/libssl.so CACHE INTERNAL "")
        endif()
    endif()
    

    The previous snippet will add libcrypto.so and libssl.so files ONLY for armeabi-v7a android ABI.

Note: KDAB offers training in CMake, including all the latest tips from our trainers, who are all active developers.

The post QtCreator CMake for Android plugin appeared first on KDAB.

The Qt Company Blog: Qt 3D Studio 2.2 Released

$
0
0

We are happy to announce that Qt 3D Studio 2.2 has been released. Qt 3D Studio is a design tool for creating 3D user interfaces and adding 3D content into Qt based applications.  With Qt 3D Studio you can easily define the 3D content look & feel, animations and user interface states. Please refer to earlier blog posts and documentation for more details on Qt 3D Studio.

New material system

One of the great new features in the Qt 3D Studio 2.2 release is the redesigned Material system. Applying material changes to several objects that share the same material can be now done by simply applying the changes to a single material.

New material system

Materials are now part of the Project View

The way that materials are applied when importing 3D models has been greatly improved. Materials are now part of the Project assets tree view and stored as a separate material definition files as part of the project file structure. This enables also sharing materials between projects. For details please refer to the Materials and Shaders documentation for details how to create and manage materials.

Scene View

Creating pixel perfect UI of course requires attention to detail and a lot of pixel peeping. The 2.2 release introduces a zoomable view for Scene Camera.

Scene Camera View

Scene Camera View

All Qt 3D Studio views are dockable so you can place the Scene view anywhere in the view layout or undock the view to a separate window.

Sub-Presentation Handling

We have done also great improvements to the Sub-Presentation management. Sub-Presentations are now part of the Project View which makes it easier to switch between sub-presentations and add sub-presentation content to the main presentation. Please refer to the documentation for details how to use Sub-Presentations in your project.

Compressed Textures

In Qt 3D Studio 2.1 runtime we introduced the compressed texture support in the runtime and now we have added an option to enable the compressed textures in the Editor Presentation settings. Doing the actual compression requires external tools (such as ETCPACK). In the future versions of Qt 3D Studio, we are introducing more integrated workflow for managing and optimizing the project assets.

Stereoscopic rendering (Technology Preview)

We are also excited to introduce Stereoscopic rendering as a new feature to the Qt 3D Studio runtime. Feature can be tested with the Viewer by enabling the Stereo Mode from the View menu.

Strereoscopic rendering

Enabling stereoscopic mode in the Viewer

Supported stereo modes are: Top-Bottom, Left-Right and Anaglyph rendering. Also eye separation can be increased/decreased from the menu. We will be introducing the QML API for controlling the stereo mode properties in the future releases.

Performance optimization for the runtime

We have been working hard to squeeze our more rendering performance from all kinds of embedded devices and the first set of changes are included in the 2.2 release. We consider these changes to be still experimental and for that reason the new rendering pipeline needs to be explicitly enabled when running the Qt 3D Studio based application. You can test the new rendering by setting Q3DS_DRAGON environment variable to 1. We will be getting more into details on what kind of performance improvements we have been seeing in our tests in a separate blog post. Stay tuned.

View3D QML element

In the QML API we have introduce a new View3D items which can be used to display the contents of a single Qt 3D Studio layer in a Qt Quick scene. This allows placing 3D objects in several places in Qt Quick Scene instead of one rectangular 3D view area. You can also do the Scene composition in the Qt Quick side.

Getting started

Qt 3D Studio 2.2 is available through Qt online installer under the Tools section. We also provide standalone offline installers which contain all you need to start designing Qt 3D Studio User Interfaces. Online installer also contains pre-build runtime for Qt 5.12 which is needed for developing Qt applications using Qt 3D Studio UI. Qt online installer and offline installers can be obtained from Qt Download page and commercial license holders can find the packages from Qt Account. Binary packages are available for Windows and Mac. For the first time we are also providing technology preview binary packages for Linux.

Instructions for building the editor & runtime please refer to the README file. If you are targeting for embedded systems with running e.g. RTOS you need to build the Qt 3D Studio runtime component for the target operating system. Qt 3D Studio runtime can be found from the git repository. If you are Qt for Device Creation Boot2Qt images the Qt 3D Studio Runtime and Viewer are included in the images. Please also note that Qt 3D Studio runtime uses Qt 3D module for rendering which means that Qt 3D Studio 2.2 requires Qt 5.12.

Some example projects can be found under examples folder in the installation directory. Additional examples and demo applications can be found from https://git.qt.io/public-demos/qt3dstudio repository. If you encounter issues with using Qt 3D Studio or you would like to suggest new feature, please use Qt3D Studio project in the https://bugreports.qt.io

 

 

The post Qt 3D Studio 2.2 Released appeared first on Qt Blog.


The Qt Company Blog: From Trunk to Throttle – It’s Software that drives your car

$
0
0

Consumers are demanding great digital experiences in every context of their daily life – from mobile phones through home entertainment and appliances to cars. The automotive industry is quickly moving from a single static display for information sharing to digital cockpits delivering a wide range of services and applications. The pace of change is accelerated not only by external benchmarks such as mobile devices but also industry forerunners, such as Mercedes Benz, Tesla and Audi. All of them have lifted up the expectations for in-car experience. Responding to the increased digital requirements is different than responding to competition with better cup holders*.

The automotive industry must look at the procurement of software differently in the world of digital cockpits. The current processes and practices are optimized for sourcing hardware components globally. Software components are just glued on top of these practices. It has led to situations where software costs are creeping into projects and platforms. In order to build winning digital cockpits automotive OEMs must lift software sourcing to a totally new level. The concept of Software BOM (bill of materials) is at the core of the change. Software BOM should include all the cost related to the product lifecycle – from concepting to deployment and updates. Software decisions also have an indirect impact on hardware cost such as memory (size and quality) and boards (performance and availability), but in this blog series only direct BOM items are covered.

car

The automotive industry today has well-established practices for managing bill of materials. Actually, a typical car project is a fine oiled procurement process of well-defined specifications, bidding practices over multiple rounds and established supplier layers (called tiers). The fundamental idea behind the process is that a car can be departmentalized into small independent units and each unit’s cost can be minimized, resulting in an optimum total cost structure at the end of the day. This is a very good approach when all components are truly independent from each other and do not share anything in common.

A software component, however, has very little independency as everything is connected and often shared. Furthermore, great software is typically the result of several phases from user experience definition and development to final target optimization. Development in one component may have requirements on other components. Thus, software procurement must be seen as a system purchase and not as a component purchase.

There is a simple way to test whether an OEM is mastering Software BOM or not – by just asking one question at the start of production (SOP) ceremony: „What is the software cost per car for this model?“ A black belt is given when you get an answer consisting of a number and currency. All other answers should lead to a change how software decisions are being made.

Would you like to hear more about what is preventing optimized BOM for automotive OEMS. Stay tuned!

Tero Marjamäki
* https://www.theatlantic.com/technology/archive/2018/04/cupholders-are-everywhere/558545/

The post From Trunk to Throttle – It’s Software that drives your car appeared first on Qt Blog.

KDAB on Qt: KDAB Training at Qt World Summit Berlin

$
0
0

KDAB is offered eight superb Training Classes in Berlin, you can see the list below, which includes one run by our long-term collaborator, froglogic. All the rest were delivered by KDAB engineers.

There were five classes in our Introductory group, and three in the Advanced. Read the descriptions carefully to see which one you’d have liked to attend. An Introductory class can be just what you need for a refresher, even if you’re an experienced programmer, as our trainers are always up-to-date with the latest tips.

Introductory
Effective 3D in Qt
Introduction to CMake
Introduction to Qt/QML
Multithreading in Qt
Qt GUI Testing with Squish

Advanced
Modern C++ – What’s New in C++17?
Profiling and Debugging for Linux
QML Applications Architecture

Details

Introductory


Effective 3D in Qt

with James Turner

Target Audience: Qt developers wishing to integrate 3d technology in their application.

Prerequisites: The audience is expected to have familiarity with basic QtQuick and OpenGL concepts, but no in-depth knowledge of them is required.

Course Description

Starting with the utility and enabler classes (for OpenGL, Vulkan and the upcoming Metal support), we will look at low level support for using OpenGL with QOpenGLWindow for rendering and event handling. We will also look at the support in the Widgets module.

Later we will show the technologies available in Qt that allow deep integration of Qt Quick 2 scenes with custom drawn OpenGL content. We will discuss the possibility of simply providing a Qt Quick overlay for an OpenGL scene. The discussion will then proceed to the creation of custom Qt Quick Items drawn using raw OpenGL commands, which can then be used from QML. We will also illustrate how to manually drive Qt Quick’s own rendering if we need to be in complete control of how and when the rendering happens.

Finally, we will look at Qt 3D and how to use its scene graphs and frame graphs to create high performance 3d rendering without requiring the specialist knowledge required when accessing OpenGL directly. Along the way we will introduce the Qt 3D renderer and input systems and how they are built on top of a flexible, highly threaded, Entity Component System (ECS) architecture that scales very well and is ripe for future additions.

You will learn how to:

  • create windows for 3d rendering
  • add a Qt Quick based UI to an OpenGL application
  • create custom high performance Qt Quick Items using OpenGL
  • integrate your own OpenGL renderer with the Qt Quick Renderer
  • construct a basic Qt 3D application
  • make a scene graph, display 3D graphical content using geometry, materials, textures
  • get Qt 3D maps onto the graphics pipeline
  • extend Qt 3D to use your own custom geometry
  • write custom materials and shaders
  • completely control the Qt 3D renderer dynamically at runtime using the Frame Graph
James Turner

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 user-interface, 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.


Introduction to CMake

with Kevin Funk

Target Audience: C and C++ Developers who are interested in how to build their code.

Prerequisite: Experience with build systems.

“The best thing a build system can do is not get in the way”.

Course Description

CMake is the de facto standard build system for C and C++ outside of frameworks that require their own. It has earned this place by supporting the situations and special cases that arise in real projects.

Support for CMake within Qt is being significantly improved and there are longer term plans to switch to CMake for building Qt itself. It’s currently a good alter- native if you hit limitations in qmake.

This course will teach the basics of creating and building projects with CMake.  In recent years, CMake has introduced some cleaner and more precise constructs. The course will focus on the new constructs where possible.

Why learn CMake? CMake has broad functionality that covers many real world problems. Learning CMake enables you to solve advanced build requirements. This includes cross-platform builds, feature detection based on platform or available libraries, built- time configurable feature switches and custom build steps. CMake is increasingly widely adopted across the industry.

Kevin Funk

Kevin has actively developed with Qt/C++ since 2006 and has a special interest in tooling and profiling. He’s an active contributor to KDAB’s GammaRay analyzer (a high-level Qt application debugger) and has a strong emphasis on state machine tooling. He is co-maintainer of the KDevelop IDE, a powerful C/C++ development environment backed by Clang, and is pushing for cross-platform success inside KDE. Kevin holds a Masters Degree in Computer Science.


Introduction to Qt/QML

with Jan Marker

Target Audience: Developers and managers interested in learning the autonomy of a QML application.

Prerequisite: Knowing the basics of Qt at C++ level is an advantage but not a requirement.

Course Description

This training is an introduction to Qt Quick. On the one hand it will teach you how to compose fluid user interfaces with slick animations using the QML language. On the other hand it will teach you how you hook the QML side up to your business logic in C++.

Course contents

  • Connecting a QML UX with C++ business logic
  • Complex list views including data provided from C++ models
  • Custom objects implemented using Qt Quick scene graph
  • Profiling and best practices for optimal performance

Why learn Qt/QML? Designed to take people new to Qt or QML, from the basics to a deep functional understanding of best practices, this Qt/QML training will equip you with the skills and know-how to boost your productivity at work.

Jan Marker

Software Engineer at KDAB, Jan has been using Qt since 2009 when he started contributing to the KDE project. Since joining KDAB he has worked on multiple large Qt and QML projects, while more recently also developing Wayland compositors. Besides in-depth knowledge of Qt and C++, Jan also has a deep interest in other technologies like NodeJS. He holds a BSc in Computer Science.


Multithreading in Qt

with Kevin Krammer

Target Audience: Qt Developers interested in multithreaded programming.

Prerequisite: Knowledge and experience programming with Qt and C++. A basic understanding of multithreaded programming is an advantage but not required.

Course Description

Multithreaded programming is essential for developers to create fast and responsive applications on computers, phones, and embedded devices all with an increasing number of cores. Qt offers several mechanisms for multithreading; however, it can be difficult to know which to use and how to steer clear of common pitfalls. This course offers guidance how to write safe and efficient multithreaded code with Qt.

Topics include:

  • Basic multithreading concepts (threads, processes, data races, reentrency, shared data)
  • Synchronization primitives (mutexes, semaphores, condition variables)
  • Special concerns for Qt applications (cross-thread signals/slots, QObject thread affinity, the GUI thread)
  • Low-level multithreading with Qt (QThread, QThreadPool, QMutex, etc)
  • High-level multithreading with Qt (QtConcurrent)
  • Threading with Qt Model/View
  • A brief summary of atomic operations

Why learn about Multithreading with Qt? Multithreaded development is a complex subject where it is easy to write code that contains severe bugs yet looks correct. This training will provide a solid foundation for writing safe and effective multithreaded code in Qt applications.

Kevin Krammer

Senior Software Engineer and team lead at KDAB, Kevin has actively developed with Qt and contributed consistently to KDE since 2000. He is a founding member of the QtCentre website and has mentored at Google’s Summer of Code program for 10 years. One of KDAB’s most experienced trainers, Kevin keeps our training material up-to-date and has trained engineers from Blackberry, Lockheed Martin, Siemens and Safegate and many others. Kevin holds a BSc in Software and Communications Engineering.


Qt GUI Testing with Squish

with Tomasz Pawlowski

Prerequisites: The course is for developers and testers already familiar with the basic concepts of Qt.

Course Description

In order to achieve high quality applications during testing process all the functionality of the software shall be covered, including fully exercising GUI itself. For regression testing automating this process gives benefits, saving execution time and increasing accuracy. On the other hand, GUI Automation might be a challenge, as GUI may change significantly during a product life cycle.

In this course we learn how to design and implement cross-platform automated tests using Squish GUI Tester for Qt, QML & QtQuick applications that continue to work as your product evolves.

  • Introduction to GUI Testing
  • Squish Overview (installation, configuration)
  • Test Script Creation and Execution
    • Recording and Replaying Test Scripts
    • Verification Points (Properties, Screenshot, Visual)
    • Test Results and Logging
    • Squish API
    • Image-Based Lookup
  • Development of Test Cases at Business Level
  • Set-Up and Tear-Down Functions
  • Debugging Test Scripts
  • Object Recognition
  • Accessing Application Internals (Inspecting, Object Properties and Methods)
  • Synchronisation and Event Handling
  • Squish Command-Line Tools
  • Working with Multiple Applications
  • Hooking into Running Applications
  • Squish Integration with CI
Tomasz Pawlowski

Software engineer at froglogic, Tomasz started the adventure with Squish and GUI Testing in 2011, designing and implementing automated tests for a Flight Planning solution at Lufthansa Systems. In 2014 he joined froglogic and is conducting Squish trainings and consulting for many companies in Europe, India and the USA. Additionally, Tomasz is implementing Squish integrations. Tomasz has a degree in computer science from Nicolaus Copernicus University in Poland.


Advanced

Modern C++ – What’s New in C++17?

with Giuseppe D’Angelo

Target Audience: C++ developers who want to know more about the new features introduced in C++17.

Prerequisite: Knowing the basics of C++11 is a requirement, though more advanced topics will be explained as needed.

Course Description

Starting with C++11 released in 2011, the C++ language and standard library have steadily evolved. At the end of 2017 the new C++17 standard was released, adding a sizable amount of useful new features. All major compilers already support most (if not all) of its features.

In this training, the most useful of the new features introduced in C++17 and its predecessor will be presented. In cases for which these features depend on features introduced in C++11 or C++14, these will be refreshed as well.

New library features being presented include the new types std::any, std::optional and std::variant, the new parallel algorithms, filesystem access, std::string_view and new operations on the container classes. The new language features range from ways to improve template code with fold expressions, constexpr if, and class template deduction over improvements of lambdas to structured bindings and initalizers in if and switch statements.

Why learn what’s new in C++17? C++ is the language that powers most applications written with Qt. To make the most out of the language, developers need to know its capabilities and pitfalls, and keep up with the incremental changes done in new releases. Doing so rewards them with ways to write easier, faster, cleaner and safer code

Giuseppe D’Angelo

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.


Profiling and Debugging for Linux

with Milian Wolff

Target audience: Developers who want to find and fix problems,

Prerequisite: Knowing the basics of C++ and Qt,

Course Description

This training introduces various tools, which help developers and testers in finding bugs and performance issues. This variant of the training focuses on Linux.

The tools presented cover a wide range of problems, from general purpose debugging and CPU profiling to Qt specific high-level analyzers. Often, it is relatively simple to run a tool, but interpreting the results, or even just using some of the more advanced tools, requires deep technical knowledge. The following tools will be covered:

Debugging

  • General purpose debugger: GDB
  • Record and replay, reverse debugging: RR
  • Memory error detectors: AddressSanitizer
  • Thread error detectors: ThreadSanitizer
  • Various Qt built-in features
  • GammaRay to investigate internals of Qt Applications

Static Code Analysis

  • Compilers
  • Clazy

Profiling

  • CPU: Linux perf and hotspot
  • Heap memory: heaptrack
Milian Wolff

Senior Software Engineer at KDAB, Milian leads the R&D in tooling and profiling in which he has a special interest. Milian created Massif-Visualizer and heaptrack, both of which are now used regularly to improve the performance of C++ and Qt applications. When not applying his knowledge to improving code-base performance for KDAB’s customers, Milian maintains QtWebChannel for the Qt Project and is co-maintainer of the KDevelop IDE. In 2015, Milian won KDE’s Akademy Award for his work on Clang integration. He has a Masters Degree in Physics.


QML Applications Architecture

with Tobias Koenig

Target audience: QML developers who want to learn about creating large-scale yet maintainable applications.

Prerequisite: Being comfortable with the basics of QML, as well as some familiarity with developing with C++ and Qt (QObject, signals & slots, properties, etc).

Course Description

QML is a great language for expressing user interfaces in a declarative, easy to understand way. It can however be difficult to scale up from small demo applications to fully featured, complex systems without paying too high a price in complexity, performance and maintainability. In this course, we explore different techniques to deal with these issues to enable you to scale up your applications while steering clear from the common pitfalls.

Topics include:

  • Custom QML items
  • C++ integration
  • Declarative coding
  • Multi-page application architectures
  • Code organization
Tobias Koenig

Senior Software Engineer at KDAB, Tobias has actively developed with Qt since 2001 and has been an active KDE contributor during this time. His contributions have been mainly to the KDE PIM project and the KDE libraries, but also to other open source projects.

There’s still seats left for the One-Day Training at Qt World Summit in Berlin!

Sign up…

The post KDAB Training at Qt World Summit Berlin appeared first on KDAB.

KDAB on Qt: KDAB demos at Qt World Summit, Berlin

$
0
0

KDAB is the main sponsor at Qt World Summit 2018.  In Berlin, we’ll be hosting a training day on December 5th  offering both Introductory and Advanced one day training classes and on December 6th you can listen to two talks from KDAB experts:

  • Streamlined integration of 3D content straight from 3DS Max and Blender into Qt3D, with James Turner, and
  • KDAB’s Opensource Tools for Qt with Milian Wolff.

KDAB will also be exhibiting on both days, starting at 5pm on Wednesday December 5th. Come to our booth and see:

Qt Quick Software Renderer

At Qt World Summit KDAB will show the Qt Quick Software Renderer in action on the very competitively priced NXP i.MX6 ULL platform. Thanks to some clever coding from KDAB, it provides a fluid 60fps touch UI and H.264 video decoding in spite of having neither GPU nor video decoding acceleration on the hardware.

You can now have the full feature set of Qt at your disposal, even at as little as 64MB of RAM and/or Flash memory.

  • NXP i.MX6 ULL (no GPU/VPU/IPU)
  • Fluid 60fps touch UI
  • 64MB RAM/Flash
  • H.264 video decoding using PxP acceleration
  • Full Qt feature set available

See more….

Kuesa – 3D asset creation and integration workflow

Kuesa is a solution that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D software user-interface.

  • Streamlined integration of 3D content from e.g. 3DS Max and Blender
  • High-performance real-time rendering
  • Uses Qt and Qt 3D engine
  • Available on desktop and embedded

Find out more about Kuesa…

KDAB GammaRay

A high-level introspection tool for Qt applications, KDAB’s GammaRay allows you to examine and manipulate application internals at runtime, either locally or on an embedded target. Augmenting conventional debuggers, GammaRay leverages QObject to visualize application behavior at a high level, especially useful where complex Qt frameworks such as model/view, state machines, QGraphicsView or QTextDocument are involved. GammaRay is integral to the Qt Automotive Suite all-in-one package, where it also offers QtCreator integration.

  • High-level introspection tool for Qt applications
  • Insight into Qt Quick and Qt 3D scene graphs
  • Visual state machine debugger
  • Inspect models, layouts, rendering and much more

Find out more about GammaRay…

Clazy Static Code Analyzer

An opensource project spawned by KDAB’s R&D efforts for better C++ tooling, Clazy Static Code Analyzer is an LLVM/Clang-based static analyzer for Qt 5 that extends your compiler with approximately 50 Qt-oriented warnings.

Clazy Static Code Analyzer highlights Qt-related bugs, performance issues or unneeded memory allocations and performs a code rewrite for common tasks like porting to the Qt 5 connect syntax.

Clazy Static Code Analyzer integrates seamlessly with most existing build systems, and is bundled with the latest versions of QtCreator if you don’t want to compile it your self.

  • LLVM/Clang-based static analyzer for Qt
  • Highlights Qt-related bugs, performance issues or unneeded memory allocations
  • Code rewrite for common tasks like porting to the Qt 5 connect syntax
  • Seamless integration with most existing build systems

See our video about Clazy…

KDAB Hotspot Profiler

Created by KDAB’s Milian Wolff, who will be talking about this and other KDAB open source tools at Qt World Summit, KDAB Hotspot profiler does all the heavy lifting for you, when you need to analyze profiling data on Linux Perf.

  • GUI for Linux Perf to analyze profiling data
  • Bottom-Up and Top-Down tree views
  • Caller/Callee list
  • FlameGraph
  • Time line

See how Hotspot works…

Qi – Cellular Tissue Imaging in Qt 3D

Demonstrating the power of Qt 3D, this shows stunning 3D visualizations of microscopic tissue samples that help researchers better understand cell pathology in the fight against cancer. The 3D images are created out of 2D images from electron microscopes in cutting edge clinical diagnostics data sets. The process enables real-time conversion to 3D from 30 image channels using Qt 3D.

  • 3D visualization of microscopy of tissue samples
  • 2D images from cutting edge clinical diagnostics data sets
  • Real-time conversion to 3D from 30 image channels using Qt 3D

Find out more…

nanoQuill Interactive Wall

KDAB will be presenting the nanoQuill interactive display wall at Qt World Summit, where participants can literally help in the cure for cancer by coloring in images of cells. This is a collaboration between KDAB, the Qt Company, Quantitative Imaging Systems (Qi), and Oregon Health & Science University that crowd-sources electron microscope images of cancer cells for people to artfully color, thus #color4cancer.

Once photographed, completed images can be sent to the nanoQuill website where machine learning engages in discerning cell micro structures, helping us understand how tumour cells develop resistance to escape cancer-targeting drugs.

Find out more about nanoQuill….

The post KDAB demos at Qt World Summit, Berlin appeared first on KDAB.

KDAB on Qt: KDAB at Capitole du Libre

$
0
0

Le Capitole du Libre, évènement de logiciel libre annuel à Toulouse auquel KDAB (France) était Sponsor Or pour la 8ème année consécutive, s’est achevé la semaine dernière après 2 jours de conférence intense proposant de nombreuses présentations en parallèle.

Les sujets allaient de l’IoT et l’embarqué au C++ et à la 3D en passant par les libertés et vie privée ainsi que le financement du logiciel libre pour n’en citer que quelques-uns.

Voyez le programme ici.

M. Kevin Ottens a animé‘Des blobs colorés pour l’analyse de données communautaires’ et M. Franck Arrecot a présenté ‘Introduction à Qt QML et à la création de composants’.

Si vous n’avez pas pu y assister, vous pouvez télécharger leur présentation ici:

Merci à tous ceux qui sont venus et à l’an prochain!

The post KDAB at Capitole du Libre appeared first on KDAB.

KDAB on Qt: KDAB releases Kuesa™ for 3D asset creation and integration workflow

$
0
0

KDAB announces the release of Kuesa™, a solution that provides an integrated and unified workflow for designers and developers to create, optimize and integrate real time 3D content in a 3D or hybrid 2D/3D software user interface.

Kuesa provides an easy, integrated and unified workflow without any compromises for designers and developers giving:

  • great performance on both desktop and embedded boards
  • high quality real-time 3D scenes
  • full expressiveness for designers, using professional 3D design tools
  • full control of integration for developers
  • reduced time to market.

For a practical demo, have a look at the tutorials created by KDABian Timo Buske, showing a complete workflow from the designer to the developer:

Kuesa is now available under both an AGPL and Commercial license. For more details about Kuesa and how to download it, visit the Kuesa web page.

Also, at this year’s Qt World Summit Berlin, KDAB’s James Turner will be giving a presentation on Kuesa titled, Streamlined Integration of 3D Content straight from 3DS Max and Blender into Qt3D. You can also view a demo of Kuesa at KDAB’s booth.

The post KDAB releases Kuesa™ for 3D asset creation and integration workflow appeared first on KDAB.

Viewing all 15410 articles
Browse latest View live