KDAB brings its world-class software services to the BlackBerry QNX Distributor and Value-Added Integrator Program

Houston, Texas, May 24th, 2019 — KDAB, the Qt®, OpenGL®, and C++® experts, today announced that it has joined the BlackBerry QNX Distributor & Value-Added Integrator Program, a worldwide network of value-added integrators, distributors, and reseller experts trained on QNX technology. Under the agreement, KDAB will provide integration and customization services for a range of BlackBerry QNX embedded software solutions in the automotive, biotech, medical, industrial, entertainment, government, and consumer industries.

As the global leader in software consulting for architecture, design, and development of Qt®, C++®, and 3D/OpenGL® applications, KDAB has been a BlackBerry QNX partner for many years. For example, KDAB worked on adding Qt® support to the QNX CAR Platform for Infotainment, which included training the QNX CAR engineers, creating the initial Qt® integration, and implementing the product’s showcase UI. In addition, KDAB implemented Qt® for the QNX Neutrino® RTOS, the BlackBerry 10 OS and maintained the Qt® port on the QNX Neutrino® RTOS. KDAB also created Photon migration tools and services to help QNX customers migrate their GUI to Qt® when the Photon micro-GUI reached end-of-life.

Under the agreement, KDAB will support BlackBerry QNX products including the QNX Neutrino® RTOS, QNX OS for Safety, and QNX OS for Medical. This benefits KDAB customers by providing access to safe and secure software through a trusted supplier with a proven track record of delivering QNX-based solutions.

KDAB is a unique partner due to the depth and breadth of their products and services, as well as their extensive experience working with BlackBerry QNX software at all levels,” said Kaivan Karimi, SVP and Co-Head, BlackBerry Technology Solutions, BlackBerry. “If the Industrial IoT is to succeed, it’s going to need to be built on safety-certified, mission-critical embedded software and together with KDAB we offer an unbeatable combination of capabilities and technologies that today’s forward thinking companies are looking for in their mission to deliver best-in-class devices and applications.”

KDAB’s global customer base, which includes industry leaders such as Airbus, Ericsson, IBM, Nokia, Shell, and Siemens, will continue to benefit from the company’s ability to deliver technically superior and innovative cross-platform software but with the added benefit of a safety-critical and resilient RTOS that helps guard against system malfunctions, malware, and cybersecurity breaches.

The BlackBerry QNX Distributor & Value-Added Integrator Program will allow KDAB to augment BlackBerry QNX’s successful embedded legacy to design and develop secure, mission-critical QNX-based solutions – ultimately accelerating customer time to market.

We’re excited to support this full-featured and highly reliable microkernel RTOS portfolio for our customers,” said Matthias Kalle Dalheimer, KDAB’s President and CEO. “This will enable us to provide even more robust and better integrated safety-critical solutions at a rapid pace. We’re also pleased to extend the technical support we currently offer QNX customers.”

To learn about the BlackBerry QNX Distributor and Value-Added Integrator program, visit https://ca.blackberry.com/partners.

About KDAB

KDAB is the global leader in software consultancy for architecture, development, and design of Qt®, C++®, and OpenGL® application across embedded, mobile, and desktop platforms. An ISO certified company, they build effective processes and tools as well as software products based on experience, delivering hundreds of software projects on time with the highest quality. They build runtimes and develop infrastructure for applications and user-interfaces running in cars, medical devices, mobile phones, tablets, industrial machines, oil wells, desktops, and more. Some of the more frequent tasks they are challenged with include harnessing the power of native engineering on constrained hardware, transforming visions into working software, redesigning software architectures, and mentoring engineers on best practices.

KDAB is also the market leader for training in Qt®, Modern C++® and OpenGL®, with offices throughout Europe and the Americas.

www.kdab.com

Media Contacts

Tobias Morell (Europe), Ann Fernandes (US): press@kdab.com

 

The post KDAB brings its world-class software services to the BlackBerry QNX Distributor and Value-Added Integrator Program appeared first on KDAB.

Little Trouble in Big Data – Part 1

A few months ago, we received a phone call from a bioinformatics group at a European university. The problem they were having appeared very simple. They wanted to know how to usemmap() to be able to load a large data set into RAM at once. OK I thought, no problem, I can handle that one. Turns out this has grown into a complex and interesting exercise in profiling and threading.

The background is that they are performing Markov-Chain Monte Carlo simulations by sampling at random from data sets containing SNP (pronounced “snips”) genetic markers for a selection of people. It boils down to a large 2D matrix of floats where each column corresponds to an SNP and each row to a person. They provided some small and medium sized data sets for me to test with, but their full data set consists of 500,000 people with 38 million SNP genetic markers!

The analysis involves selecting a column (SNP) at random in the data set and then performing some computations on the data for all of the individuals and collecting some summary statistics. Do that for all of the columns in the data set, and then repeat for a large number of iterations. This allows you to approximate the underlying true distribution from the discreet data that has been collected.

That’s the 10,000 ft view of the problem, so what was actually involved? Well we undertook a bit of an adventure and learned some interesting stuff along the way, hence this blog series.

The stages we went through were:

  1. Preprocessing
  2. Loading the Data
  3. Fine-grained Threading
  4. Preprocessing Reprise
  5. Coarse Threading

In this blog, I’ll detail stages 1 and 2. The rest of the process will be revealed as the blog series unfolds, and I’ll include a final summary at the end.

1. Preprocessing

The first thing we noticed when looking at the code they already had is that there is quite some work being done when reading in the data for each column. They do some summary statistics on the column, then scale and bias all the data points in that column such that the mean is zero. Bearing in mind that each column will be processed many times, (typically 10k – 1 million), this is wasteful to repeat every time the column is used.

So, reusing some general advice from 3D graphics, we moved this work further up the pipeline to a preprocessing step. The SNP data is actually stored in a compressed form which takes the form of quantizing 4 SNP values into a few bytes which we then decompress when loading. So the preprocessing step does the decompression of SNP data, calculates the summary statistics, adjusts the data and then writes the floats out to disk in the form of a ppbed file (preprocessed bed where bed is a standard format used for this kind of data).

The upside is that we avoid all of this work on every iteration of the Monte Carlo simulation at runtime. The downside is that 1 float per SNP per person adds up to a hell of a lot of data for the larger data sets! In fact, for the full data set it’s just shy of 69 TB of floating point data! But to get things going, we were just worrying about smaller subsets. We will return to this later.

2. Loading the data

Even on moderately sized data sets, loading the entirety of the data set into physical RAM at once is a no-go as it will soon exhaust even the beefiest of machines. They have some 40 core, many-many-GB-of-RAM machine which was still being exhausted. This is where the original enquiry was aimed – how to use mmap(). Turns out it’s pretty easy as you’d expect. It’s just a case of setting the correct flags so that the kernel doesn’t actually take a copy of the data in the file. Namely, PROT_READ and MAP_SHARED:

void Data::mapPreprocessBedFile(const string &preprocessedBedFile)
{
    // Calculate the expected file sizes - cast to size_t so that we don't overflow the unsigned int's
    // that we would otherwise get as intermediate variables!
    const size_t ppBedSize = size_t(numInds) * size_t(numIncdSnps) * sizeof(float);
 
    // Open and mmap the preprocessed bed file
    ppBedFd = open(preprocessedBedFile.c_str(), O_RDONLY);
    if (ppBedFd == -1)
        throw("Error: Failed to open preprocessed bed file [" + preprocessedBedFile + "]");
 
    ppBedMap = reinterpret_cast<float *>(mmap(nullptr, ppBedSize, PROT_READ, MAP_SHARED, ppBedFd, 0));
    if (ppBedMap == MAP_FAILED)
        throw("Error: Failed to mmap preprocessed bed file");
 
    ...
}

When dealing with such large amounts of data, be careful of overflows in temporaries! We had a bug where ppBedSize was overflowing and later causing a segfault.

So, at this point we have a float *ppBed pointing at the start of the huge 2D matrix of floats. That’s all well and good but not very convenient for working with. The code base already made use of Eigen for vector and matrix operations so it would be nice if we could interface with the underlying data using that.

Turns out we can (otherwise I wouldn’t have mentioned it). Eigen provides VectorXf and MatrixXf types for vectors and matrices but these own the underlying data. Luckily Eigen also provides a wrapper around these in the form of Map. Given our pointer to the raw float data which is mmap()‘d, we can use the placement new operator to wrap it up for Eigen like so:

class Data
{
public:
    Data();
 
    // mmap related data
    int ppBedFd;
    float *ppBedMap;
    Map<MatrixXf> mappedZ;
}
 
 
void Data::mapPreprocessBedFile(const string &preprocessedBedFile)
{
    ...
 
    ppBedMap = reinterpret_cast<float *>(mmap(nullptr, ppBedSize, PROT_READ, MAP_SHARED, ppBedFd, 0));
    if (ppBedMap == MAP_FAILED)
        throw("Error: Failed to mmap preprocessed bed file");
 
    new (&mappedZ) Map<MatrixXf>(ppBedMap, numRows, numCols);
}

At this point we can now do operations on the mappedZ matrix and they will operate on the huge data file which will be paged in by the kernel as needed. We never need to write back to this data so we didn’t need the PROT_WRITE flag for mmap.

Yay! Original problem solved and we’ve saved a bunch of work at runtime by preprocessing. But there’s a catch! It’s still slow. See the next blog in the series for how we solved this.

The post Little Trouble in Big Data – Part 1 appeared first on KDAB.

KDAB at CppCon 2019

CppCon is the annual, week-long face-to-face gathering for the entire C++ community – the biggest C++ event in the world. This year, for the first time, CppCon takes place in the stunning Gaylord Rockies Hotel and Convention Center in Aurora, Colorado, very near Denver International Airport.

KDAB is a Bronze sponsor at CppCon, and will be offering 2-day pre- and post-conference training courses.

Sign up for:

We’ll keep you updated about this exciting event.

The post KDAB at CppCon 2019 appeared first on KDAB.

exec on Qt WebAssembly

When porting applications to Qt for WebAssembly, there are a few issues to keep in mind.

One big issue is that you do not have a full operating system underneath for you to utilize.
What you get is the same sandbox in which javascript lives. In some aspects, it is somewhat similar to a single-threaded microcontroller where there is just one thread in which to operate, limited filesystem access and limited resources.

One of the unusual and tricky bits about using Qt for WebAssembly, is that the exec loop is not typical. The Emscripten main loop is co-operative, after each event has a turn to run, control is then returned to the browser. Any blocking of the event loop will mean the web page in which your application runs will become unresponsive.

This is all fine and dandy for simple applications that use one main loop, but gets complicated when you try to exec a secondary loop. To stop the execution of an event loop, emscripten throws an exception, which leads to all kinds of fun. It also means it never returns to the same place that you expect it. So any modal dialog that uses exec() will not return values. Less than ideal.

Take for instance QColorDialog. Typical use is as such:

    QColorDialog dlg(parent);
dlg.exec();
QColor color = dlg.selectedColor();
Which is basically what QColorDialog::getColor does.

... and does not work with Qt WebAssembly, because exec() does not return to the same place as you expect! The call to selectedColor will never get called.

What you can do is use a non-modal dialog with the show() or in the case of QColorDialog open() function and use Qt's signal/slot API to retrieve the selected QColor.

 QColorDialog *dlg = new QColorDialog(this);

connect(
dlg, &QColorDialog::colorSelected,
[=](const QColor &selectedColor) {
qDebug() << Q_FUNC_INFO << selectedColor;
});
dlg->open();

You can read more about the Emscripten execution environment at
https://emscripten.org/docs/api_reference/emscripten.h.html#browser-execution-environment

You can also learn more about Qt for WebAssembly and other things in the book I wrote:
Hands on Mobile and Embedded Development with Qt 5

Qt Design Studio 1.2 Beta released

We are happy to announce the beta release of Qt Design Studio 1.2.

Qt Design Studio is a UI design and development tool that enables designers and developers to rapidly prototype and develop complex UIs. Both designers and developers use Qt Design Studio and this makes collaboration between the two a lot simpler and more streamlined. To get an impression, you should watch this video.

The main addition for Qt Design Studio 1.2 is the Sketch Bridge. It is now possible to export your scenes from Sketch and import them to Qt Design Studio 1.2.

qds11

Qt Design Studio 1.2 also finally supports powerful gradients for Shape-based items. This means you can add and animate spherical, gradients, conical gradients and linear gradients and their properties.

beta1_2

The commercially licensed packages are available through the online installer and on the Qt Account Portal. You can try out and evaluate Qt Design Studio by registering for an evaluation license.

With Qt Design Studio 1.2 there is also a free community version available, which lacks the Photoshop and Sketch bridges, though. The Beta of the Qt Design Studio 1.2 Community Edition can be found here.

Getting Started

You can find the latest online documentation for Qt Design Studio 1.2 here. The documentation is also available from inside Qt Design Studio.

For Qt Design Studio we created new tutorials as part of the documentation.

The welcome page of Qt Design Studio contains examples and links to video tutorials to help you get started.

Please post issues you find or suggestions you have in our bug tracker.

The post Qt Design Studio 1.2 Beta released appeared first on Qt Blog.

Qt Installer Framework 3.1.1 Released

We are happy to announce the release of Qt IFW 3.1.1. Major reason for releasing version 3.1.1 is that it fixes the bug QTIFW-1322. The bug was that after installing with 3.1.0 offline installer, the created maintenancetool size was huge. This occurred in Linux and in Windows. There are also other fixes, the full list of changes can be found from ChangeLog.

Precompiled binaries for the Installer Framework can be downloaded from Qt Online Installer, sources and binaries can be found also in Qt Download page (open source) or in your Qt Account.

The post Qt Installer Framework 3.1.1 Released appeared first on Qt Blog.

Release 3.2.0: Update to Qt 5.12.3 with ECMAScript 7, Subscriptions, Image Picker and Qt Creator 4.8.2

Felgo 3.2.0 adds support for Qt 5.12.3 and Qt Creator 4.8.2, which brings many features and improvements. The new long term supported Qt release includes lots of fixes, new modules and adds JavaScript support for ECMAScript 7. The updated Felgo IDE version 4.8.2 is more stable and adds compatibility with the latest toolchains and platforms.

This post summarizes all of the highlights and changes of the release:

 

Important Update Note: To deploy for Android, the required NDK version now changed to NDK r19c. See the migration hints of this update for more information.

Update to Qt 5.12 LTS – Long Term Supported Release

Qt 5.12.3 is the third patch version for Qt 5.12 LTS, which is a long-term-supported release. It incorporates more than 2000 bug fixes since the previous Qt LTS version, Qt 5.9.7.

On top of Qt 5.12.3, the new LTS version will receive many patch releases throughout the coming years. Additional Qt tools like the latest Qt 3D Studio version are based on Qt 5.12 LTS as well.

What took us so long?

You might wonder why you had to wait so long for Qt 5.12. The reason is pretty simple, there were several bugs in all the official Qt 5.12 releases up until 5.12.3. Those bugs, especially on mobile, prevented a stable release. We need to make sure your apps keep working on all platforms, with every update. This is why we spent more time than usual, to report and fix issues for this major update.

QML Engine Improvements and JavaScript Support for ECMAScript 7

QML performance and memory consumption improved a lot over the previous Qt versions. Especially Qt 5.11 brought some major improvements when using the Qt Quick Compiler to compile QML code ahead of time. Qt 5.12 improves this even more. The following chart shows memory consumption of a Qt Quick Controls example project for different Qt versions:

qt512_qml_engine_performance

Qt 5.9.7 required 18.5 MB RAM, while Qt 5.12 now uses 13.0 MB RAM (with pre-compiled QML). This means that memory usage with Qt 5.12 improved by 30% compared to Qt 5.9.

Qt focuses a lot on improving the QML engine performance. You can read more about Qt 5.12 performance improvements here.

With the new release, you can also take advantage of major improvements to the JavaScript engine that supports QML. Previously compatible with ECMAScript 5, it now fully supports ECMAScript 7. This allows the usage of modern JavaScript and simplifies the integration of Javascript libraries. ECMAScript modules are now also supported and can be loaded both from C++ as well as QML/JS.

Improved Qt Quick Controls 2 and TableView

You can now use the TableView as another type of Item View in Qt Quick. It’s a lot more performant than its previous Qt Quick Controls implementation and is filling the last major gaps in the available set of views.

It is similar to a ListView but with multiple columns. Unlike the previous view of QtQuick Controls 1, it does not do any styling. The TableView provides the optimal solution for instantiating, pooling and reusing delegates on demand as you scroll the table. A TableModel for the view can be created with a custom C++ QAbstractTableModel implementation.

Also, various controls in Qt Quick Controls 2 gained new methods or new functionalities.

Qt Quick Input Handlers, New Tech Previews and More

The Pointer Handlers of Qt 5.11 are now renamed to Input Handlers and are fully supported as a first-class feature in Qt Quick. The Input Handlers simplify the creation of complex touch interactions, that used to be difficult to do with MouseArea and TouchArea alone. They can detect events even in cases of deep nesting.

This also applies for the TapHandler, which can detect taps and touch gestures. Unlike MouseArea, it can handle events in multiple nested Items at the same time:

qt512_touch_inputhandler_nested
import QtQuick 2.12
import Felgo 3.0

App {
 NavigationStack {
   Page {
     title: "Nested Touch Example"

     // Outer Rectangle
     Rectangle {
       anchors.centerIn: parent
       id: outerRect
       width: dp(200)
       height: dp(200)
       color: tapHandler.pressed ? "lightyellow" : "lightgreen"

       TapHandler {
         id: tapHandler
       }

       // Inner Rectangle
       Rectangle {
         id: innerRect
         anchors.centerIn: parent
         width: dp(75)
         height: dp(75)
         color: tapHandler2.pressed ? "lightblue" : "orange"

         TapHandler {
           id: tapHandler2
         }
       }
     }

   }
 }
}

It is also easy to make an Item draggable with the DragHandler:

qt512_touch_draghandler
import QtQuick 2.12
import Felgo 3.0

App {
 NavigationStack {
   Page {
     title: "Drag Example"

     // Draggable Rectangle
     Rectangle {
       // initial position
       x: (parent.width - width) / 2
       y: (parent.height - height) / 2

       width: dp(200)
       height: dp(100)
       color: dragHandler.active ? "lightyellow" : "lightgreen"

       AppText {
         id: text
         text: "Drag Me!"
         anchors.centerIn: parent
       }

       DragHandler { id: dragHandler }
     }

   }
 }
}

HoverHandler was added as a new type of handler for detecting mouse hover. As touchscreens generally do not offer hover events, in practice it detects a hovering mouse or tablet stylus.

The update also adds a new tech preview: you can have a look at the DelegateChooser type. It allows to use different delegates in item views like AppListView. Depending on role values from the model or the index, you can choose between multiple delegates:

qt512_delegatechooser
import QtQuick 2.12
import Felgo 3.0

import Qt.labs.qmlmodels 1.0 // tech preview import

App {
 NavigationStack {
   Page {
     title: "Multiple Delegates"

     AppListView {
       anchors.fill: parent
       model: [
         {
           text: "Apple",
           detailText: "A delicious fruit with round shape",
           type: "fruit"
         },

         {
           text: "Beer",
           type: "drink"
         },

         {
           text: "Orange",
           detailText: "Another fruit with round shape",
           type: "fruit"
         },

         {
           text: "Wine",
           type: "drink"
         }
       ]

       delegate: DelegateChooser {
         role: "type"

         DelegateChoice {
           roleValue: "fruit"

           // Delegate for "fruit" type
           SimpleRow {
             onSelected: text = "Clicked"
           }
         }

         DelegateChoice {
           roleValue: "drink"

           // Delegate for "drink" type
           Rectangle {
             width: parent.width
             height: dp(50)

             color: Theme.tintColor

             AppText {
               x: dp(16)
               anchors.verticalCenter: parent.verticalCenter
               text: modelData.text
               color: "white"
             }
           }
         }
       }
     }

   }
 }
}

There are many more additions you get with Qt 5.12.3, for example:

Also note that the following modules are part of the Qt 5.12 release, but are deprecated and considered for removal in subsequent releases of Qt:

You can also have a look at the official Qt 5.12 blog post or see the full list of changes here.

Subscriptions for iOS and Android

The in-app purchase plugin now supports subscriptions for iOS and Android apps. Today, subscriptions are the best way to monetize your app, offering recurring revenue from your users. Also Apple and Google only take a 15% share on subscriptions after 1 year, compared to the 30% share for regular in-app purchases, so that is another plus!

If you want to use subscriptions or the built-in virtual economy system, we recommend using the Felgo in-app purchase plugin instead of the default Qt Purchasing module.

Note: If you use the Store plugin in your application on iOS, you will need to add additional files with this update. Refer to the integration guide to see which files and where to get them.

ImagePicker Control and Qt Creator Designer Improvements

The new ImagePicker control allows to choose multiple images from the device gallery in one go. It uses a custom QML GridView, which accesses photos from the device gallery or camera roll.

imagepicker-control
import Felgo 3.0
import QtQuick 2.0

App {
 NavigationStack {
   Page {
     id: page
     title: qsTr("Choose Photos")

     // right bar item to accept selection
     rightBarItem: TextButtonBarItem {
       text: "Next"
       enabled: imagePicker.selectedCount > 0

       // your app will probably pop the photo selection page from the stack to move on
       // this example only logs the selected photos
       onClicked: console.debug("SELECTED:", JSON.stringify(imagePicker.selection))
     }

     // image picker view for photo selection
     ImagePicker {
       id: imagePicker
       anchors.fill: parent
     }
   }
 }
}

You can also build your own UI for picking photos. Call NativeUtils::fetchGalleryPhotos() to load a list of all device photos, which your view can then access with the NativeUtils::galleryPhotos property. To further work with individual images, use NativeUtils::getCachedAssetPath().

For Qt Creator design mode, you can now see better item names for all Felgo components:

update-320-qtc-designer

New Felgo IDE – Qt Creator 4.8.2

Along with the Qt 5.12.3 update, Felgo 3.2.0 also presents you with Qt Creator 4.8.2. The new IDE version is more stable and adds support for the latest build tools and platforms.

Improved Android Compatibility and Better iOS Device Support

On iOS, the IDE now better detects later iPhone models like the iPhone XS. The update also includes many improvements and fixes for macOS Mojave.

For Android, you can now connect and use the debugger on API level 24 and later. The new Qt Creator is also fully compatible with Android SDK 28.

Note: The Android Build Kit now uses the Clang compiler instead of GCC, which got removed with NDK r18b. Thus, older NDK versions are no longer supported and we recommend to upgrade to NDK r19c. You can download it here.

Make sure to configure the new NDK in the Qt Creator settings for Android:

qt512_android_ndk19

Before you can build projects, we also recommend to clean previous build folders and project settings:

  • Close Qt Creator
  • Delete the *.pro.user file of your project
  • Remove the previous project build folder
  • Open your project in Qt Creator and choose your Build Kits
  • Rebuild your project for Android

Qt 5.12 and Qt Creator 4.8 also add basic support for the Android ARMv8 architecture. However, there are no pre-built libraries for this architecture with Felgo 3.2.0 yet. If you require early access to Felgo Android ARMv8 support, don’t hesitate to get in touch.

Multiple Debuggers, Programming Language Support and More

Qt Creator 4.8.2 supports simultaneously running multiple debuggers. The debugger tool bar in the Debug mode has an additional pop up menu where you can switch between running debugger instances and the “preset” view which allows to start new debuggers.

On Windows, Qt Creator does no longer force the use of ANGLE for OpenGL on user applications. You can also expect less issues with antivirus programs on Windows systems.

There’s also a new experimental feature to support the Language Server Protocol (LSP), which adds basic support for many different programming languages to Qt Creator:

qtcreator48_lsp_client

You can read more about the improvements of Qt Creator 4.8 in the official release post.

More Features, Improvements and Fixes

Felgo 3.2.0 includes many more features, for example:

For all relevant changes, features and fixes of recent Felgo updates, please check out the change log.

How to Update Felgo

Test out these new features by following these steps:

  • Open the Felgo SDK Maintenance Tool in your Felgo SDK directory.
  • Choose “Update components” and finish the update process to get this release as described in the Felgo Update Guide.

Update Felgo

If you haven’t installed Felgo yet, you can do so now with the latest installer from here. Now you can explore all of the new features included in this release!

For a full list of improvements and fixes to Felgo in this update, please check out the change log!

 

 

 

More Posts Like This

Release 3.1.0: New Felgo Plugins Version, Unified App Configuration and FlickablePage

V-Play is Now Felgo – New Release & Roadmap

The post Release 3.2.0: Update to Qt 5.12.3 with ECMAScript 7, Subscriptions, Image Picker and Qt Creator 4.8.2 appeared first on Felgo.

Qt on CMake Workshop Summary – May ’19

This is a follow-up post to Qt on CMake Workshop Summary – Feb ’19

Intro

From May 2nd to May 3rd another Qt on CMake workshop was hosted at the KDAB premises in Berlin, where interested stakeholders from both The Qt Company and KDAB gathered together to drive the CMake build system in Qt further. Many of KDAB’s customers are using CMake in their Qt projects, so we are keen to see the CMake support for Qt improve and happy to help out to make it happen. The workshop was public, for anyone interested, but we had no external visitors this time. We’d be happy to have some more CMake enthusiasts or interested people in these workshops, so be sure to sign up for the next CMake workshop (watch the qt-development mailing list for this)!

This workshop in May was mostly intended to reassess what has happened in the wip/cmake branch of qtbase since the last workshop and to discuss any further work. We spent almost half of the first day just deciding how to approach certain things such as how the CMake build system port will affect the upcoming Qt6 work, which is currently gaining momentum as well. We had between 8 and 10 people present across the 2 day workshop, from KDAB and (mostly) The Qt Company.

Workshop summary

Excerpt of the top-level CMakeLists.txt in qtbase.git

First of all: Thanks to Alexandru Croitor for driving the porting efforts and for organizing sprints and meetings where interested people can keep track of the progress!

The workshop summary notes are also courtesy of Alexandru, let me try to quickly recap the most interesting bits:

CMake config files in Qt6 and beyond

One of the key considerations of the CMake config files installed as part of the upcoming Qt6 was that there should a) be the possibility to just be able to use CMake targets like Qt::Core (compared to Qt5::Core) and functions/macro names like qt_do_x() (instead of qt5_do_x()) to allow most applications to just pull in a Qt version of their choice and then use “versionless” CMake identifiers. This allows to upgrade Qt versions more easily, without a lot of search-replace in CMake code. Note that you can continue to use the version-specific identifiers as before. This is an additional feature.

But on the other hand we’d also like to keep the possibility to mix Qt version X and Qt version Y in the same CMake project. Think about a project where two executables are being built, one depending on Qt6, the other one a potential Qt7 version. This is not as cumbersome as you’d think; we experience a lot of customer projects where people have this setup. It might as well be the case during a porting project, where old code might still continue to use an older Qt version.

Consider this example (which is not fully implemented yet, but you get the idea):

### Usecase: application wants to mix both Qt5 and Qt6, to allow gradual porting 

set(QT_CREATE_VERSIONLESS_TARGETS OFF) 
find_package(Qt5 COMPONENTS Core Gui Widgets) # Creates only Qt5::Core 
find_package(Qt6 COMPONENTS Core Gui Widgets) # Creates only Qt6::Core 
target_link_libraries(myapp1 Qt5::Core)
target_link_libraries(myapp2 Qt6::Core)

### Usecase: application doesn't mix Qt5 and Qt6, but allows to fully switch to link against either Qt5 or Qt6 

set(MY_APP_QT_MAJOR_VERSION 6) # <- potentially set at command line by application developer
# set(QT_CREATE_VERSIONLESS_TARGETS ON) <- Default, doesn't need to be set 
find_package(Qt${MY_APP_QT_MAJOR_VERSION} COMPONENTS Core Gui Widgets) # Creates Qt5::Core and Qt::Core OR Qt6::Core and Qt::Core, based on the variable
target_link_libraries(myapp Qt::Core) # Just links to whatever Qt major version was requested

More details (and development notes from the past meetings):

After a lot of back and forth we actually found a straight-forward way to at least create the two namespaces in the CMake config files easily, see e.g.: https://codereview.qt-project.org/#/c/253169/

QMake will still be around in Qt6

As it stands, existing users of Qt and specifically users of QMake do not have to fear the CMake port too much, for now. The current bias is towards keeping the qmake executable (and the associated mkspec functionality) around for the Qt6 lifetime, as we’d obviously create a lot of additional porting effort for our users. During the Qt6 lifetime it would probably be wise to consider moving your pet project to a CMake build system, but only time will tell.

QMake is currently built via the CMake build system in the wip/cmake branch and already available for use. Upside-down world, right. Additionally, we’re looking into generating the QMake module .pri files using CMake as well. All this is definitely no witch craft but just needs dedicated people to implement all of it.

Further notes

You can find a lot more details on the Wiki, in case you are curious, I would not like to duplicate even more of the really comprehensive work log produced here: https://wiki.qt.io/CMake_Port/Development_Notes

If you would like to learn more about CMake, we are offering a one-day Introduction to CMake training at the KDAB training day as part of Qt World Summit in Berlin this year.

If you have comments or if you want to help out, please ideally post feedback on the Qt Project infrastructure. Send a mail to the qt-development mailing list or comment on the wiki page dedicated for the CMake port. Or just join us in the IRC channel #qt-cmake on Freenode!

 

The post Qt on CMake Workshop Summary – May ’19 appeared first on KDAB.

Qt Quick Performance Improvements with Qt 5.12 LTS (Updated for Qt 5.12.3)

We are continuously working on improving the performance and optimizing the memory consumption of Qt. One focus area for Qt 5.12 has been to reduce the memory consumption of the QML engine and tuning the JavaScript performance. Qt 5.12.3 provides further improvements especially for QML engine performance. 

This is an update for the earlier Qt 5.12 performance blog post from last November. Measurements have been done with Qt 5.12.3 release, which contains further improvements to Qt Quick and QML performance compared to the Qt 5.12 beta used in the previous post.

Qt 5.9 LTS already shows a great improvement of the overall performance compared to the previous long-term supported Qt 5.6 LTS release. These are summarized in a blog post about Performance Improvements with Qt 5.9 LTS and Qt Quick Performance Improvements on 64-bit ARM. With Qt 5.12 LTS we have continued to tune these further and taken a deeper look into the areas of QML engine memory consumption and JavaScript performance. In addition to Qt 5.6 LTS no longer supported, the performance of the Qt 5.12 LTS is a solid reason to upgrade.

QML Memory usage

Applications use memory for multiple things and to optimize the overall memory usage a good start is typically to look into the graphics assets, leveraging asset conditioning, the Qt Lite feature system to remove unused functionality and other techniques to optimize the memory usage. As it is very difficult for an application developer to affect the memory used by the QML engine itself, we have taken a deep look into how it can be reduced.

One important optimization done with Qt 5.12 LTS are to the data structures used in conjunction with compiled QML. The QML engine creates cache files that contain a dump of internal data structures on the fly when loading a .qml or .js file at run-time (named .qmlc and .jsc). If found, these files are mapped into the application process and used directly without requiring a compilation step. We have an option to create those cache files ahead of time while compiling the application. In that case, we don’t have quite the same degree of visibility into the type system as the QML engine has at run-time. This leads to a staged approach where we can’t resolve quite as much as when generating the data structures at run time, requiring us to do some additional work on top of the pre-generated cache files.

In Qt 5.12 LTS two changes are done to reduce the memory consumption when using such ahead-of-time generated cache files:

  • Avoid the re-creation of the indexed string table for the in-memory generated compilation unit and instead fall back to the memory mapped string table provided from the cache file.
  • Reduce the size of data structures so that the size of the files as well as their memory consumption is reduced.

In addition to the changes described above, we have done also multiple smaller improvements to reduce the memory consumption of the QML engine, while still keeping the performance on a good level (and actually improving quite a bit in some areas).

Actual memory usage of a Qt Quick applications depends a lot upon the application itself. In the comparison chart below, we have measured the QML engine related memory consumption for two different applications. We have used the Qt Quick Controls example to represent a Qt Quick application.

qml_engine_ram_use

For the example application we can see that Qt 5.6.3 uses 36.3 MB, Qt 5.9.7 uses 18.5 MB and Qt 5.12.3 uses 13.0 MB RAM (using pre-compiled QML). This means that memory usage with Qt 5.12 is 30% lower than Qt 5.9 and 64% lower than Qt 5.6 with the example application. These savings are available for all users of Qt. For commercial users Qt 5.6 and 5.9 offered a separate tool called Qt Quick Compiler that can be used for pre-compiling QML. Using the Qt Quick Compiler, the memory usage of Qt 5.6 drops to 14.4 MB (60% lower RAM usage than without). So even when using the Qt Quick Compiler with 5.6, upgrading to Qt 5.12 will lead to a very nice 10% improvement in memory usage.

As all applications are different it is best to check how big the benefit is for your application. We compared the QML engine memory use of Qt 5.6 and 5.9 using Qt Quick Compiler and Qt 5.12 using the pre-generated QML with a rather complex real-life Qt Quick application. In this measurement Qt 5.9 used 1.1 MB less RAM than Qt 5.6 (both with Qt Quick Compiler), and Qt 5.12 used a whopping 9.8 MB less RAM than Qt 5.6 (with Qt Quick Compiler). Especially for embedded systems with constrained resources or ones that run multiple applications this type of RAM savings in the QML engine, with no changes to the application code, are very beneficial.

JavaScript Performance

A major difference of Qt 5.12 LTS compared to Qt 5.9 LTS and Qt 5.6 LTS is the completely new compiler architecture of the QML engine introduced with Qt 5.11. The new pipeline has also enabled making some of the memory use optimizations described earlier in this post. With the new pipeline, we get a significant improvement in JavaScript performance, even with the addition of ECMAScript 7 support in Qt 5.12.

To compare the JavaScript performance for different Qt versions, we have run the same JavaScript benchmark with Qt 5.6.3, Qt 5.9.7 and Qt 5.12.3. The benchmark is run on 64-bit ARM processors using Linux operating system.

qt_5_12_3_js_comparison

To highlight the improvement with Qt 5.9 and 5.12 we have normalized the result of Qt 5.6 to 100.

Overall improvement (TotalScore) of Qt 5.9.7 compared to Qt 5.6.3 is 1785% and Qt 5.12.3 compared to Qt 5.6.3 the improvement is 2138%. Compared to Qt 5.6.3, the biggest performance improvement is seen due to supporting JIT on 64-bit ARMv8 architecture used in many modern embedded processors. With Qt 5.6 JIT is not supported on 64-bit ARM.

Qt 5.9 and Qt 5.12 both support JIT, so between these the improvements are mainly due to the new compiler architecture. Compared to Qt 5.9.7 the overall JavaScript performance improvement of Qt 5.12.3 is 19%.

Overall Qt Quick Performance

Because it is so easy to break performance, we regularly run several different kinds of performance tests. These also help in analyzing how the various optimizations work across different platforms and to make sure feature development and error corrections do not have unintended side effects to performance. Some of these results are visible at testsresults.qt.io, for example the QML Bench tests.

To compare the effect of Qt versions, we have run the full QML Bench test set with Qt 5.6.3, Qt 5.9.7 and Qt 5.12.3. To improve the comparability of results, we are running Qt Quick Controls 1 tests on Qt 5.6.3, as it does not have Qt Quick Controls 2 functionality. Otherwise the functionality tested by the QML Bench is same between these Qt versions. For these tests, QML Bench was run on an Nvidia Jetson TX1 development board (64-bit ARM processor) running the Nvidia supported Linux for Tegra Ubuntu 16.04.

Due to the very large performance improvement in Javascript and Qt Quick Controls, we have presented those separately to make the charts below more readable (JavaScript earlier in this post and Qt Quick Controls in an earlier blog). We have again normalized the Qt 5.6.3 result to be 100 in order to better highlight the improvements with Qt 5.9.7 and Qt 5.12.3.

qt_5_12_3_qml_comparison

For the overall QML Bench test the performance with Qt 5.9.7 is over double compared Qt 5.6.3 (109% better than Qt 5.6.3), and the performance of Qt 5.12.3 is even slightly higher (113% better than Qt 5.6.3). The improvements in areas other than JavaScript and Qt Quick Controls are smaller, typically between 15 to 25%. Comparing Qt 5.9.7 and Qt 5.12.3 shows overall improvement of 7%. This has improved since the first Qt 5.12 releases as the performance regressions in a few tests have been fixed. Those using Qt 5.12 LTS, should update to Qt 5.12.3 or later in order to get this increase in Qt Quick performance.

QML Bench has been developed with typical application use cases in mind, trying to cover as many of those as possible in a comprehensive suite. But as with any benchmark, this still means that the improvements in your application might vary depending on how QML is being used there – so it is always recommended to gather performance data with your own application to see how much its performance improves.

Other improvements

In this post the focus was in the Qt Quick performance, where we have improved the performance of Qt 5.12 LTS significantly compared to the earlier LTS releases of Qt in three important areas:

  • QML memory usage
  • Overall Qt Quick performance
  • JavaScript performance

In addition to these, Qt 5.12 LTS provides many other performance improvements as well. One important improvement in Qt 5.12 LTS is the possibility to use pre-generated distance fields of fonts. Earlier Qt has created the distance fields during the application startup, which can consume a lot of CPU cycles especially for non-latin fonts (that have many glyphs) and complex latin fonts (that have a lot of different shapes). With Qt 5.12 LTS, we release a tool called “Qt Distance Field Generator”, which allows you to pregenerate the distance fields for either a selection of the glyphs in a font or all of them.

Other areas where we have been improving performance include, for example, Qt 3D CPU usage and Qt 3D memory consumption (especially beneficial for Qt 3D Studio applications). Qt 5.12 LTS also introduces a completely re-designed TableView, which takes the performance of large tables to completely different level than the old TableView implementation of Qt Quick Controls 1. Of course, Qt 5.12 LTS also benefits from the compressed texture support introduced with Qt 5.10 and improved with Qt 5.11, as well as multiple other improvements done since the previous LTS release of Qt.

If you have not yet looked into Qt 5.12 LTS, please take it for a spin.

The post Qt Quick Performance Improvements with Qt 5.12 LTS (Updated for Qt 5.12.3) appeared first on Qt Blog.

Mobile and Embedded Development with Qt

At times it was a bit painful juggling writing a book, doing my day job and running around doing the things that life throws. It's done and dusted now, you too can buy my book titled Hands-On Mobile and Embedded Development with Qt 5! It has a nice image of glacier ice on the cover, which I thought was appropriate for a technology founded in Norway and then continued in Finland.



https://www.packtpub.com/application-development/hands-mobile-and-embedded-development-qt-5

A big thanks to the co-founder of Trolltech, Eirik Chambe-Eng, who was gracious enough to write the forward at the last second. Tons of thanks to all the editors who also worked on this book.

One of the things I learned writing this book is that Qt is big. I already knew that, but now it's plainly apparent just how big it has grown. Not only are there major companies developing products with Qt, but it has a lot of different functionality and is not just about desktop widgets. There are a huge number of classes to cover.

You can check out the table of contents if you want to see what is covered and included. One area that I did not include is OpenGL ES. This is a huge topic and easily a book on it's own. It's something I would like to know more about, which is why I did not feel qualified to cover it. You need to know OpenGL Shader Language (GLSL), and I did not have the time to discover that to any real depth.

I hope that I covered topics that are relevant for mobile, embedded and IoT developers. From QtWidgets, QtQuick, QtSensors (of course) to In-app purchasing and building an embedded system with Qt Company's Boot To Qt and Yocto. I also explore Qt's newest platform - Qt for WebAssembly, which allows you to serve Qt applications from a web server to run in a web browser.


Enjoy!

The Future of AST-Matching refactoring tools (EuroLLVM and ACCU)

I recently made a trip to LLVM in Brussels and ACCU in Bristol. It was a busy week. I gave a talk at both conferences on the topic of the future of AST Matchers-based refactoring.

As usual, the ‘hallway track’ also proved useful at both conferences, leading to round-table discussions at the LLVM conference with other interested contributors and getting to talk to other developers interested in refactoring tooling at ACCU.

Presentations

The learning curve for AST-Matcher-based refactoring is currently too steep. Most C++ developers who are not already familiar with the internal Clang APIs need to invest a lot in order to learn how to make such bespoke tooling to improve and maintain their codebase.

The presentations both include demos of steps I’ve been taking to try to address these problems.

The first demo is of clang-query discovery features which aim to reduce the need to infer AST Matcher code by examining the Clang AST itself. I also showed the debugging features I am preparing to upstream to clang-query. Finally – in terms of demo content – I showed a Qt tool which can eliminate some of the additional difficulties and problems of long-developer-iteration-time.

The debugging features and the Qt tool were world exclusives at the LLVM conference (and at the ACCU conference because most people didn’t attend both 🙂 ). I hadn’t shown them to anyone else before, so I was quite happy the demos went well.

Videos

My 25 minute presentation to the LLVM developers tried to show that these changes can make mechanical refactoring more easily available to C++ developers.

The aim was to show the features to the LLVM community to

  1. illustrate the issues as I see them
  2. get some feedback about whether this is a good direction
  3. introduce myself for the sake of further code reviews (and collaborators). As this was my first LLVM conference, I am not already familiar with most of the attendees.

My 1.5 hour ACCU presentation is a far-less-rushed presentation of the same tools and a repetition of some of the content at code::dive 2018. In the ACCU presentation, the new demo content starts about 30 minutes in. This talk is the one to watch if you are interested in using mechanical refactoring on your own code.

Feedback was very positive from both talks, so I’m happy with that.

Qt Tooling

Earlier this year I refactored the clang AST dump functionality. It was previously implemented in one class, ASTDumper, which had the dual responsibilities of traversing the clang AST and creating a textual representation of it. I separated the textual output from the generic output independent traversal, which introduces the possibility of alternative output formats such as JSON.

Of course, given my KDE and Qt contribution history, I would only create a generic tree traversal class in order to implement QAbstractItemModel for it.

The demos show all of the features you would expect from a point-and-click refactoring tool including exploring, feature discovery, debugging with in-source feedback, live source updates, experimental refactoring etc.

Of course, all of this requires changes to Clang upstream (for example to add the debugging interface) which was the point of my visit to EuroLLVM. Hopefully, once enough of the changes are upstream, I’ll be able to open source the tool.

The idea as always is to hopefully have enough functionality in Clang itself that IDEs such as Qt-Creator, KDevelop and Visual Studio would be able to integrate these features using their own GUI APIs, making the simple tool I made obsolete anyway. I only made it for demo purposes.

This will take the mechanical refactoring workflow which is currently

and turn it into

You will still do the same things, but with much faster development iteration to achieve the same result.

There is even more that can be done to make the process of mechanical refactoring with clang easier and faster. We discussed some of that at EuroLLVM, and hopefully all the pieces can come together soon. Meanwhile I’ll be upstreaming some of this work, talking at NDC Oslo, and at my local meetup group on this topic.

KDAB now offers standalone on-site Git training

New on-site Git training

KDAB’s training portfolio now includes a dedicated on-site training class about the version control system Git. The Git training material has been a supplemental chapter in our other on-site training offerings for quite a while. Given the recent rise in interest in this chapter we’ve reorganized, updated and extended the course. It now covers the latest changes in Git and most recent Git workflows out there.

This one-day training class provides a comprehensive introduction into modern software development with the code version control system Git. Beginning with the basic concepts, all the fundamental topics to manage code bases in Git will be covered.

Building on that, it expands into strategies for common workflows in software development life cycles and introduces options for collaboration on large scale or widely distributed projects.

Course Contents

  • Initial setup and checkout of Git repositories
  • Managing and committing changes
  • Navigating through Git history
  • Branching and merging
  • Development strategies
  • Collaboration via Gerrit code review and similar systems

View more details about the training course, including the full table of contents.

Another good reason to learn the basics of Git is that Qt itself is available through Git. A basic knowledge of Git is therefore essential if you want to apply patches back to Qt or try out a not yet released version of Qt.

The Git training course is completely platform-agnostic: we have already had several training sessions including people working with either Linux, macOS or Windows. We’re focusing on Git concepts explained by Git command-line usage which is applicable on any operating system. If needed we can also give a short introduction in graphical user interfaces for Git, such as TortoiseGit, Git extensions, git-gui, etc..

This training course has a duration of one day and is currently offered as on-site training only. It is suited for developers who work on software collaboratively or who need to maintain a delivered/deployed version while simultaneously working on new features for the next one.

Contact us

If you’re interested in a Git training course, please contact us!

The post KDAB now offers standalone on-site Git training appeared first on KDAB.

Qbs 1.13 released

We are happy to announce version 1.13.0 of the Qbs build tool. This is the last version to be released under the auspices of the Qt Company, but certainly not the least.

Highlights

Transparent pkg-config support

Qbs projects can now make use of pkg-config modules. Syntax-wise, the same dependency mechanism as for Qbs’ own modules is used. For instance, on a typical Linux machine with an OpenSSL development package installed, the following is enough to let a Qbs project build against it:

Depends { name: "openssl" }

Internally, this functionality is implemented on top of module providers, a powerful new feature that allows creating Qbs modules on demand.

Automatic Qt detection

Projects with a Qt dependency now set up the required Qt-specific modules (such as Qt.core) automatically at build time, using either the PATH environment variable or the moduleProviders.Qt.qmakeFilePaths property. It is therefore no longer strictly necessary to create a profile using the setup-qt command. Behind the scenes, this feature is also implemented using module providers.

Job Pools

The global limit for the number of concurrently running jobs does not make sense for all types of commands. For instance, linkers are typically I/O-bound and take up a lot of memory, so it often makes sense not to parallelize them as much as compilers. Here’s how job-specific limits are set on the command line:

$ qbs --job-limits linker:2,compiler:8

These limits can also be provided via preferences and in project files. The details are explained here.

What else is new?

Language Improvements

Rules are no longer required to specify output artifacts. As a result, rules whose main purpose is in their “side effect” will look more natural now, as they don’t need to declare a dummy output file anymore.

It is no longer necessary to start each project file with an “import qbs” line.

The Application, DynamicLibrary and StaticLibrary items have new properties install and installDir for more convenient installation of target binaries.

We introduced Process.atEnd() and FileInfo.canonicalPath().

C/C++ Support

GNU linker scripts are now scanned recursively to catch changes to included linker scripts. Thanks to Ola Røer Thorsen for this contribution!

The new cpp.linkerVariant property allows to force the use of ld.gold, ld.bfd or lld for linking.

Qt Support

We introduced the new property Qt.core.enableBigResources for the creation of “big” Qt resources.

Static builds now pull in the default set of plugins as specified by Qt, and the user can specify the set of plugins by type.

Android Support

The AndroidApk item has been deprecated. Instead, a normal Application item can and should be used now.

Building Qt apps is properly supported now. Some small changes to Qt’s androiddeployqt tool were necessary to achieve this, so you need at least Qt 5.12.

Autotest Support

There is an autotest module now, which you can use to specify arguments and working directory per test.

Various things

We introduced the texttemplate module, a facility similar to qmake’s QMAKE_SUBSTITUTES feature.

We added basic support for Google Protocol Buffers (for C++ and Objective-C). Thanks to Ivan Komissarov for this contribution!

Try It!

The Open Source version is available on the download page, and you can find commercially licensed packages on the Qt Account Portal. Please post issues in our bug tracker. You can also find us on IRC in #qbs on chat.freenode.net, and on the mailing list. The documentation and wiki are also good places to get started.

Qbs is also available on a number of packaging systems (Chocolatey, MacPorts, Homebrew) and updated on each release by the Qbs development team. It can also be installed through the native package management system on a number of Linux distributions including but not limited to Debian, Ubuntu, Fedora, and Arch Linux.

Qbs 1.13.0 is also included in Qt Creator 4.9.0, which was released earlier this week.

So, what now?

Preparations for handing over the project to the community are ongoing. Stay tuned for further announcements.

The post Qbs 1.13 released appeared first on Qt Blog.

Modernizing SCADA HMIs

Supervisory control and data acquisition (SCADA) systems have been around since the 1950s, far longer than most other types of computer applications. Their rock-solid performance has been responsible for the streamlining of any industry that needs precise and consistent controls: building automation, energy management, part machining, printing and packaging, robotic assembly, ship building, water treatment, woodworking, and many more. However, this long legacy can also carry a hidden drawback – the user interfaces of many SCADA devices look more appropriate as part of Windows for Workgroups than the modern age.

This situation is ripe for change. Now that everyone carries superior user interfaces in their pocket at all times, even the non-designers responsible for running the system expect their SCADA human-machine interface (HMIs) to have a certain level of polish and sophistication. Having implemented attractive SCADA HMIs for our customers, we believe that Qt is the right tool to build the modern SCADA system.

Download the whitepaper and read more…

The post Modernizing SCADA HMIs appeared first on KDAB.

Qt 5.9.8 Released

Qt 5.9.8 is released today. As a patch release Qt 5.9.8 does not add any new functionality, but provides security fixes and other improvements.

Compared to Qt 5.9.7, the new Qt 5.9.8 contains multiple security fixes, updates to some of the 3rd party modules and close to 20 bug fixes. In total there are around 130 changes in Qt 5.9.8 compared to Qt 5.9.7. For details of the most important changes, please check the Change files of Qt 5.9.8.

Qt 5.9.8 can be installed using the maintenance tool of the online installer. For new installations, please download latest online installer from Qt Account portal or from qt.io Download page. Offline packages are available for commercial users in the Qt Account portal and at the qt.io Download page for open-source users.

The post Qt 5.9.8 Released appeared first on Qt Blog.

Continuous Integration and Delivery (CI/CD) for Qt and Felgo

Felgo aims to improve your whole development process, from idea to app store. Today you get access to another piece of the puzzle. Introducing: Felgo Cloud Builds

Boost your Qt and Felgo development with continuous integration and delivery for Qt and Felgo projects. As the only CI/CD exclusively for Felgo/Qt, it enables users to build and distribute apps with minimum effort and maximum speed.

Here is a short teaser video, introducing Felgo Cloud Builds:

 

Felgo Cloud Builds On-Premise

Cloud Builds is available as a hosted solution by Felgo, and on-premise. Contact us if you want to host Cloud Builds on your own servers and integrate it into your existing CI/CD systems.

 

Contact Us for On-Premise Hosting

Build your Apps in the Cloud with Felgo Cloud Builds

A great development workflow will make your good developers great, and your great developers exceptional. Deploying a new version to the app stores can be an annoying and time-consuming task. You need to make sure all your native tooling for each platform is set up and working as expected. And unfortunately, those tend to just break more often than you would like to.

Felgo already eliminates the need for native tooling while developing Qt/QML apps with Felgo Live code reloading. When it comes to store deployment, it was still required.

This changes with Felgo Cloud Builds. You connect your source code repository and we build the project for you, for iOS, Android and any other supported platform. Soon you will also be able to build for Windows, Mac, Linux, Embedded & Web (WebAssembly). Contact us if you need any of those platforms immediately.

You trigger a new build with a single button click and then you can:

  • Download the created binaries
  • Automatically upload them to your beta channels or the app stores
  • Try out previous versions of your application

 

Build your project with Felgo Cloud Builds

Benefits of Using Cloud Builds

There are a number of benefits in using a CI/CD for developing your projects. First of all, the obvious one, time savings:

  • No setup of native frameworks required
  • Cut time to provide new test versions
  • Cut time for publishing new versions
  • Release more frequent updates for your users

The whole build and deployment process to both app stores only takes about 5-10 minutes.

Apart from that, there are several other advantages that you can benefit from:

  • Easy integration with Git
  • Automatic upload to iOS TestFlight and Google Play testing tracks
  • Deploy to iOS without the need for a Mac
  • Soon you will also be able to select different Felgo and Qt versions to build with

Why we built Felgo Cloud Builds for Continuous Integration and Delivery?

We built hundreds of projects using Qt on mobile platforms. Looking back at all the time spent on building and uploading binaries for every supported platform, we knew this had to change. With Felgo, we already made a lot of things simpler and faster during development, but manual publishing was still a major time-consuming process.

This is why now is the perfect time to use Felgo Cloud Builds. Cross-platform cloud building and publishing. Out of the box. Rapidly.

How to build apps with Felgo Cloud Builds

Your project is easy to set up. And after done once, there is no need to touch the configuration again, just build!

1. Create a new Project

Visit https://felgo.com/cloud-builds and create a new project.

First up are the general settings. You will also be able to choose different Qt and Felgo versions for your builds soon.

2. Connect your Git repository

In order to fetch your source code for building, you need to provide access to your Git repository.

For public repositories, this is the easiest, as you can just provide the HTTPS URL.

For private repositories, we recommend to generate a new SSH key pair. Then you can add the public key to your repository, and the private key to Cloud Builds (just as if it was your local development environment).

You can use GitHub, GitLab, Bitbucket, and custom private Git repositories.

3. Select target platforms and provide signing details

You can decide what platforms you want to build your application for.

iOS

Apple requires you to have an active App Store Connect account, in order to sign your application. To create a build that can be distributed and installed on your device, you need to provide your Certificate (*.p12 format) and Mobileprovision.

Please follow the Apple developer documentation if you are not familiar with how to obtain this information.

Android

Android is less restrictive when it comes to signing and deployment. You can use the Development Build option to create test builds without providing any further information.

Make sure that your Android device allows installation of apps from unknown sources (not via Google Play Store), to install the development build directly on your device.

If you want to create a distribution build, signed with your own certificate, you need to provide your Keystore, together with the associated credentials.

Please follow the Android developer documentation if you are not familiar with how to obtain this information.

4. Configure app store uploads

Felgo Cloud Builds also allows you to upload your builds to the app stores. Then you can release them as test versions or publish updates for your users.

iOS

For iOS, it is required to provide the credentials of an App Store Connect user account. To guarantee the maximum access control for you, we recommend adding an own user to App Store Connect for Cloud Build access.

Android

In order to fully configure an app in the Google Play Store, one manual APK upload is required. Before this, the App Identifier is not set within the Play Store, and the automatic uploads of Cloud Builds cannot be matched with the store app.

To enable app store uploads on Android, you need to provide the Google Play API JSON file of your Play Store account.

5. Build the project and grab a (quick) coffee

Now you are all set and can trigger a new build. This will only take about 5-10 minutes, depending on your configured platforms and if store deployment is enabled as well.

You can start a build using the “New Build” button. Then you can define the branch (or leave default) and enable deployment to app stores.

6. Download and Install Binaries

Once the build is finished you can download the binaries and test them on your devices. For iOS builds, the recommended procedure is to use automatic store deployment and to install the app using TestFlight.

7. Release Test Versions or Publish Updates

If store deployment is enabled, your new builds will appear in the configured stores. You can release them as new test versions or updates for your published apps.

Can I use Felgo Cloud Builds?

Felgo Cloud Builds is designed to work with any Qt and Felgo project. It is free to start on a fair-use policy, for any Felgo user. Just sign up for a Felgo account and you can start building.

 

Sign Up and Start Building

 

If you require advanced options, you will soon be able to customize your builds, with settings like:

  • Select Qt version
  • Select Felgo version
  • Select Android SDK & NDK versions
  • Select Xcode version
  • Integrate custom pre/post build scripts

Felgo Cloud Builds can also be hosted on-premise.

Contact us if you need early access to any of those features.

More Benefits with using Felgo

Felgo adds a lot of features on top of Qt, which you can also use with Felgo Cloud Builds.

  • Auto-incrementing version codes for cloud builds
  • Native UI for iOS and Android apps
  • Responsive design
  • Advanced mobile components and native features
  • Custom UI and visual effects
  • Game engine and gaming components
  • Plugins for augmented reality, machine learning, monetization, analytics and many more

This might also be Interesting for You

V-Play is Now Felgo – New Release & Roadmap
Felgo-Release-Roadmap
QML Tutorial: How to Create Native Cross Platform Apps with Qt and Felgo | Free Udemy Course
udemy-qml-tutorial-teaser
Make Cross-Platform Mobile Apps with Qt: Felgo Apps for iOS, Android, Desktop & Embedded

The post Continuous Integration and Delivery (CI/CD) for Qt and Felgo appeared first on Felgo.

Qt 5.12.3 Released

Qt 5.12.3, the third patch release of Qt 5.12 LTS, is released today. While not adding new features, the Qt 5.12.3 release provides a number of bug fixes, as well as performance and other improvements.

Compared to Qt 5.12.2, the new Qt 5.12.3 provides almost 200 bug fixes. For details of the most important changes, please check the Change files of Qt 5.12.3.

Qt 5.12 LTS will receive many more patch releases throughout the coming years and we recommend all active developed projects to migrate to Qt 5.12 LTS. Qt 5.9 LTS is currently in ‘Strict’ phase and receives only the selected important bug and security fixes, while Qt 5.12 LTS is currently receiving all the bug fixes. Qt 5.6 Support has ended in March 2019, so all active projects still using Qt 5.6 LTS should migrate to a later version of Qt.

Qt 5.12.3 is available via the maintenance tool of the online installer. For new installations, please download latest online installer from Qt Account portal or from qt.io Download page. Offline packages are available for commercial users in the Qt Account portal and at the qt.io Download page for open-source users. You can also try out the Commercial evaluation option from the qt.io Download page.

The post Qt 5.12.3 Released appeared first on Qt Blog.

ClangFormat plugin in Qt Creator 4.9

Starting with Qt Creator 4.8 we ship the new ClangFormat plugin based on the LibFormat library. In 4.9 it is not experimental anymore but still disabled by default. Let’s shortly recall the history of ClangFormat support and why we’ve decided to have a new plugin.

Beautifier plugin

The clang-format tool could already be used in Qt Creator before as part of the experimental Beautifier plugin along with Uncrustify and Artistic Style. If you have this plugin enabled you can simply invoke the executable by the shortcut or apply formatting on save. Pretty straight forward. You edit your code, you format it when you’re done. We’re not planning to remove any of this functionality because it serves its purpose pretty well and can be customized to the clang-format version that you prefer to use in your project.

But Beautifier does not cover other important cases, it’s only a tool to finalize your code.

Indentation with ClangFormat

I assume that you already use Ctrl+I to have your code indented. The same thing happens when you press Return or move/paste some code into the C++ editor. Since ages Qt Creator has its own indentation engine to provide you the proper white space where necessary. At least it should be proper. But the reality is that Qt Creator indentation still does not fully support modern C++. For example we already have these bugs for quite a long time Qt Creator indentation bugs and they always raise our desire to fix them altogether.

So the main purpose of our new ClangFormat plugin is to indent the code properly. But it can potentially bring much more in the future.
To enable the plugin go to Help > About Plugins, click on ClangFormat and restart your Qt Creator.

Features

With the plugin you can not only indent but also apply standard clang-format formatting which will optimize lines if possible, remove trailing white space and empty lines, etc. We have decided that it’s a good idea to apply formatting on the same hotkey as indentation (Ctrl+I) but only when the checkbox is selected in Tools > Options > C++ > Code Style > ‘Format instead of indenting’. There are a few more checkboxes to customize the plugin behavior. ‘Format while typing’ will try to reformat code automatically if possible and ‘Format edited code on file save’ will go through and format the edited lines in the file you are saving.

By default the plugin uses the .clang-format configuration which it finds according to the standard clang-format rules. You can override them with either global Qt Creator settings or with specific settings for your project.

Limits

Because clang-format was never meant to be used as an indentation tool we have to use a modified version of the LibFormat library. It helps us to keep the line breaks if we are sure they must remain. To force indentation for empty lines we have to supply clang-format with some extra code which should behave as if it’s a valid code. In addition clang-format can be confused by incomplete code so if you have something like this:

int main() {
foo(//Press CR here
}

the default clang-format won’t properly format the parameters until you provide it a closing ‘)’. In such cases we try to predict the possible code and trigger the formatting with modified text but it is not very reliable yet. So if you encounter problems like that you might just manually press Ctrl+I to reformat such piece of code (or save the file) when the statement is complete.

Get Qt Creator 4.9.0

The opensource version is available on the Qt download page, and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.9.0 is also available through an update in the online installer. The Qt Creator Manual 4.9 is available here. Please post issues in our bug tracker. You can also find us on IRC on #qt-creator on chat.freenode.net, and on the Qt Creator mailing list.

The post ClangFormat plugin in Qt Creator 4.9 appeared first on Qt Blog.

Debugging Clang AST Matchers

Last week I flew to Brussels for EuroLLVM followed by Bristol for ACCU.

At both conferences I presented the work I’ve been doing to make it easier for regular C++ programmers to perform ‘mechanical’ bespoke refactoring using the clang ASTMatchers tooling. Each talk was prepared specifically for the particular audience at that conference, but both were very well received. The features I am working on require changes to the upstream Clang APIs in order to enable modern tooling, so I was traveling to EuroLLVM to try to build some buy-in and desire for those features.

I previously delivered a talk on the same topic about AST Matchers at code::dive 2018. This week I presented updates to the tools and features that I have worked on during the 6 months since.

One of the new features I presented is a method of debugging AST Matchers.

Part of the workflow of using AST Matchers is an iterative development process. For example, the developer wishes to find functions of a particular pattern, and creates and ever-more-complex matcher to find all desired cases without false-positives. As the matcher becomes more complex, it becomes difficult to determine why a particular function is not found as desired.

The debugger features I wrote for AST Matchers intend to solve that problem. It is now possible to create, remove and list breakpoints, and then enable debugger output to visualize the result of attempting to match at each location. A simple example of that is shown here.

When using a larger matcher it becomes obvious that the process of matching is short-circuited, meaning that the vertically-last negative match result is the cause of the overall failure to match the desired location. The typical workflow with the debugger is to insert break points on particular lines, and then remove surplus breakpoints which do not contribute useful output.

This feature is enabled by a new interface in the Clang AST Matchers, but the interface is also rich enough to implement some profiling of AST Matchers in the form of a hit counter.

Some matchers (and matcher sub-trees) are slower/more expensive to run than others. For example, running a matcher like `matchesName` on every AST node in a translation unit requires creation of a regular expression object, and comparing the name of each AST node with the regular expression. That may result in slower runtime than trimming the search tree by checking a parameter count first, for example.

Of course, the hit counter does not include timing output, but can give an indication of what might be relevant to change. Comparison of different trees of matchers can then be completed with a full clang-tidy check.

There is much more to say about both conferences and the tools that I demoed there, but that will be for a future log post. I hope this tool is useful and helps discover and debug AST Matchers!

Qt Creator 4.9.0 released

We are happy to announce the release of Qt Creator 4.9.0!

Generic Programming Language Support

In Qt Creator 4.8 we introduced experimental support for the language server protocol. This enables editing support for a wide range of programming languages through a common protocol. In 4.9 we add support for the document outline, find usages, and also for code actions, which allow the language server to suggest fixes or refactoring actions at a specified place in the code. If the language server of your favorite programming language supports these features, they are now available in Qt Creator as well. Enable the LanguageClient plugin in Help > About Plugins (Qt Creator > About Plugins on macOS) and configure your server in Tools > Options > Language Client to check it out.

Highlighting is still provided by the generic highlighter in these cases. We changed our highlighter to be based on the KSyntaxHighlighting library, which is the library used in KDE for this purpose. Many thanks to the maintainers of KSyntaxHighlighting for making it available to a wide range of uses.

C++ Support

The UI for diagnostics from the Clang analyzer tools got many improvements. They are grouped by file now. Diagnostics from the project’s headers files are now also included.
Fix-its show details on what they do when applied. We also added a guard against applying Fix-its to files that have changed in the meantime. In the Clazy configuration you can enable or disable individual checks.

If you enabled a diagnostic to be shown inline in the code editor, you can disable individual checks via a button in the diagnostic’s tool tip.

QML Support

We updated our QML parser to Qt 5.12, adding support for ECMAScript 7.

Profiling

Perf is a powerful performance profiling tool for software running on a Linux system. Profile your application via perf with Analyze > Performance Analyzer, after enabling the plugin in Help > About Plugins. The integration in Qt Creator is available for applications running on a local Linux system, and also for applications running on a remote Linux system from a Linux or Windows host.

Generic Projects

Similar to our support for deploying files to a remote system for CMake-based projects, you can now add a QtCreatorDeployment.txt file to your generic project, to specify the necessary information about where to deploy which files.

If your project needs some special compiler flags to be correctly handled by the code model, you can now specify these in a .cxxflags or .cflags file.

Other Improvements

For Windows, we added support for MSVC 2019. On macOS we added a Touch Bar if you run Qt Creator on a MacBook.

For remote Linux targets, we exchanged our Botan-based SSH backend by use of OpenSSH tools. You need to install the tools separately (if you have not already) to be able to benefit from a wide range of encryption and authentication features in Qt Creator. We also added a rsync-based deployment method, as well as support for Run in Terminal.

Version control support has also received many fixes and improvements. The Git Branches view has a new Push action and Git tracks detached HEADs.

These are just some highlights of the many improvements and fixes included in Qt Creator 4.9. Please refer to our change log for a more thorough overview.

Get Qt Creator 4.9.0

The opensource version is available on the Qt download page under “Qt Creator”, and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.9.0 is also available as an update in the online installer. Please post issues in our bug tracker. You can also find us on IRC on #qt-creator on chat.freenode.net, and on the Qt Creator mailing list.

The post Qt Creator 4.9.0 released appeared first on Qt Blog.

Qt Design Studio 1.1.1 released

We are happy to announce the release of Qt Design Studio 1.1 .1!

Qt Design Studio is a UI design and development tool that enables designers and developers to rapidly prototype and develop complex UIs. Both designers and developers use Qt Design Studio and this makes collaboration between the two a lot simpler and more streamlined. To get an impression, you should watch this video.

Since the Qt Design Studio 1.1 release, we worked hard on bug fixes.

To learn more about the improvements and fixes, you can check out the change log.

We fixed the export from text using the Photoshop Bridge. The export of font styles and positions is now more accurate. You can find our test cases for text here.
We also published our PSD files from our examples and the PSD file we use for testing. You can find those here.

Text export from Photoshop has been improved

Text export from Photoshop has been improved

Qt Design Studio 1.1.1 ships with the runtime from Qt 3D Studio 2.3. You can find an example on how to integrate 3D content into Qt Design Studio 1.1.1 here.

Qt Design Studio 1.1 comes with new examples and updated documentation

Qt Design Studio 1.1.1 comes with Qt 3D Studio 2.3 runtime

Download and try out Qt Design Studio 1.1.1

The commercially licensed packages are available through the online installer and on the Qt Account Portal. You can try out and evaluate Qt Design Studio by registering for an evaluation license. We are also working on an open source version of Qt Design Studio and our target is to have it out with the 1.2 release (May 2019).

Getting Started

You can find the latest online documentation for Qt Design Studio 1.1.1 here. The documentation is also available from inside Qt Design Studio.

For Qt Design Studio 1.2 we created new tutorials as part of the documentation.

The welcome page of Qt Design Studio contains examples and links to video tutorials to help you get started.

Please post issues you find or suggestions you have in our bug tracker.

The post Qt Design Studio 1.1.1 released appeared first on Qt Blog.

Updated Qt Installer Released

We are happy to announce the new Qt Installer release, based on the Installer Framework 3.1. The main reason for a new installer was that we wanted to provide a more intuitive and streamlined user experience.

We simplified the component tree view by introducing package categories. This has a significantly improved the metadata download performance, as there is no need to load the metadata of all the packages anymore. In addition, it is more intuitive for new users to pick up the right packages instead of selecting everything just in case.

The updated Qt Installer contains four package categories:

  • Latest releases category shows the latest supported releases, e.g. Qt 5.12.2. Additional releases may be visible, if Qt products have dependencies on them.
  • Preview shows the latest unofficial release previews, including snapshots, alpha, beta, and RC releases.
  • Archive contains all supported releases.
  • LTS contains the latest Long-Term Support releases, such as Qt 5.12.2 and 5.9.7.

installer-screenshot

Qt Installer does not contain unsupported releases anymore. This reduces the download size of the metadata even further which makes the installation process faster and smoother. Another reason why we removed the unsupported versions was that unsupported releases have known security issues that will remain unaddressed. Thus, we do not recommend you using them anymore. Lastly, having fewer releases available significantly lowers the amount of data our mirrors need to store.

The older versions of Qt have not completely disappeared. You can still find them in the archive on http://download.qt.io, where we keep a full history of all our releases. In addition, commercial users will still be able to see old releases in the Qt Installer, as they can purchase extended support.

The Qt Installer is still not yet perfect. We are considering improving login/sign-up experience, and adding a default installation option to improve the on-boarding of new users. However, right now we are researching how to separate the installer UI from the component model. Tight coupling of the UI and the package repository model has set several challenges to improve the UX.

 

Updates in Maintenance Tool

Qt Installer’s Maintenance Tool has a few improvements as well. Signing is now enabled in Windows. Note however that old Maintenance Tool itself breaks the signing. If you update from Qt Maintenance Tool 3.0.6 or older to 3.1, the tool still lacks the signing. However, after you have updated to 3.1, the future Maintenance Tools include the signing.

In addition, we have enabled the use of Qt Installer and Maintenance Tool, even if there are some broken components. Previously, “Cannot find missing dependency..” or “SHA mismatch detected..” errors aborted the installation. In the new version, you can continue the installation despite some broken components. You will notice that these broken components are greyed out in the component tree and cannot be selected for the installation.

Feeling curious? Try it out for yourself here.

The post Updated Qt Installer Released appeared first on Qt Blog.

Qt sensors just got better on Android

Each month KDAB schedules time for me to maintain the Qt for Android port. Usually I use it to review the pending patches or fix bugs, but sometimes there is a quiet month and I have time to add new functionalities or improve the existing ones.

April was quite quiet so I decided to rewrite the Android sensors plugin (no, this is not a late April fool’s joke).

Why on earth did I want to do that? Why try to fix something that works? After all, the current implementation faithfully served us for years!

I decided to rewrite it after I did some performance tests that showed some surprising numbers. When I used the NDK API to get sensors data, the CPU usage dropped from over 60% to even less than 20% (it fluctuates from 15% up to 30%)! Yup, that’s a surprising performance improvement, which TBH I hadn’t expected at all!

I expected it to be faster, as the NDK API doesn’t need to move the data to JAVA and then back to C/C++ world (via JNI) but, I never dreamed it would be that fast!

Are you wondering why we didn’t use the NDK API in the first place? It’s because the sensors NDK API was not introduced until API-16, which means that when we first implemented the sensors API, we were supporting Android from API-9. However, starting with Qt 5.9, the minimum API has been raised to API-16, so, now I can safely use NDK API for this job.

Here you can find the pending patch. It targets dev branch which will be part of Qt 5.14.

The post Qt sensors just got better on Android appeared first on KDAB.

Orthodox canonical class form

This post is more about the basics of C++ and the last things C++11 brings to the orthodox canonical class form (OCCF). Some times the basics of a programming language are assumed by everybody but there is always a the time when someone asks why. Implement the complete OCCF is something that not always is required. In fact when you work with Qt framework and specially with widgets or inheritance from QObject is something you usually don't care. And that's an error.

La entrada Orthodox canonical class form aparece primero en My C++ & Qt blog - Cesc M..

Update from the documentation workshop: the way forward

This is an update from the documentation workshop we had 11th and 12th March. The location was The Qt Company’s location in Oslo, Norway. The participants were product management, software engineers, and R&D managers from TQtC. We also had documentation engineers from both TQtC and Luxoft. A good week before the workshop, I blogged about it. The blog post received tremendous response (thanks!), and I brought my notes from your comments and emails. So although you weren’t physically in the room, your ideas definitely were!

Since then, we’ve added a bunch of placeholder tasks in Jira. We will expand upon these as we go over the next 3-6 months. In the following, I would like to describe some of the highlights from the workshop. Perhaps it will make the Jira tasks make more sense. Also, please comment on and vote on these issues in!

(Tip: I labeled all the issues DocWorkshop03.19, so they should be easy to find. Edit: This link takes you straight to the search results.)

Why documentation?

We came up with six “personas” to serve as a way to anchor the further discussions. These personas were meant to help us relate to the target audience (i.e. you). The idea is to let these guide our future documentation efforts. We will develop these personas further, and I hope we can present them in a coherent manner in a future blog post. For now, they are a bunch of keywords on post-its on my office window.

We also had a higher-level discussion about the motivation for providing documentation. This discussion was framed by the response we got from you. Some of the problem areas we have identified are:

  • The structure of the documentation landing pages is poor. This makes it hard, in particular for new users, to figure out where to start or where to go next.
  • The documentation is very information dense. Further separation of topics is beneficial.
  • We need more overview documentation and conceptual docs, with coherent organization. It is unnecessarily hard to find topics that relate to each other.
  • We need more best-practice documentation, and explanations of why we do things in a certain way.
  • The sheer number of examples is daunting, and some of them are hard to digest for beginner to intermediate level users.
  • Examples commonly show only minor bits that may serve better as snippets in the class/overview documentation.
  • Maintenance is difficult, in particular of examples. Several go back many years, some even more than a decade.
  • Basic requirements/prerequisites are not part of the official documentation. This includes build dependencies (these are on wiki.qt.io). This generates “noise” elsewhere, such as on the forums.

Tooling

At first, the discussion about tooling was a technical discussion about the current QDoc implementation. Then we had a higher level discussion regarding the documentation tooling requirements of the future. Currently, QDoc employs Clang to parse C++, and the QML parser for QML. From a development perspective, the current focus is to clean up the QDoc code base.

A pain point for Qt developers (when it comes to documentation) is the complexity of building docs. This makes it difficult to develop docs alongside code. This has become increasingly complex with time. Currently, we require all modules that reference each other to have QDoc’s .index-files. This means you have to run make prepare_docs across the entire code base at least once. The consensus in the workshop was that incremental documentation builds per translation unit would be preferable to today’s workflow.

QML and cross-platform considerations

Parsing QML is a hard requirement for any future tooling. Also, we require cross-platform content in the complete documentation set. We can achieve this by first generating a structured intermediate output. The tool that builds the final output can use this. This could then be independent of presentation format (HTML, PDF, etc). Choosing to split content and presentation may also impact how we create overview and topic documentation. DITA with DITA Open Toolkit was suggested as a potential overall structure. AsciiDoc, DocBook and reStructuredText are alternatives. The documentation team at the Qt Company will research the capabilities and limitations of various approaches.

Another point of consideration is that PySide2 has also requirements that relate to how we generate the documentation. Moving away from the current QDoc/proprietary webxml output means that also PySide build tools need a redesign (but that might be an improvement in itself, of course).

Other approaches

We also discussed the state of documentation tooling. Newer languages, such as Go, Python, and Rust, provide documentation as a feature of the language itself. If C++ had documentation as a language feature, it would be supported by the compilers. This would benefit the C++ community at large, not just the Qt project.

The way forward

The two areas we want to prioritize are examples and tooling. A lot of the examples are small, and they do not include multiple modules. It would probably be better to tear down these “silos” and have examples that resemble real solutions to problems. One suggestion is to move our current slew of examples to a separate repository. Then we can create a set of example applications that use the broad spectrum of Qt. Along with a tutorial series, these examples can aim at teaching enough about Qt to let users use the API documentation when creating their own applications.

When it comes to tooling, we want to explore new initiatives out there to learn more about the possibilities. We might also have something to contribute. After all, we do have some experience in documenting C++ code already. A project we found exciting is clang-doc, and we will explore this and similar approaches.

Finally, we agreed that the documentation should be built in CI as part of normal builds. Documentation quality should be part of CI gating. For instance, patches that increase the number of warnings from QDoc could be blocked.

Of course, summarizing the entirety of two full days is way out of scope for a blog post. I hope I’ve managed to convey some of the interesting ideas that were discussed, and that the tasks in Jira show that we’re committed to improving the Qt documentation experience. I would love to hear back from you out there, though. Use the comments, send me emails, look the team up on IRC, or (even better!) engage with us all on bugreports.qt.io!

The post Update from the documentation workshop: the way forward appeared first on Qt Blog.

Optimizing Real-Time 3D for Entry Level Hardware

When more and more cars are being equipped with digital instrument clusters, it is very important to consider the cost of the electronics needed to achieve the desired user experience. In volume products, it matters a lot whether the cost of a hardware component is 10, 50 or 100 USD – so it really pays off to consider what is the most efficient approach for software running in the SoC. Today users expect high-quality graphics and smooth animations, and in a system like a digital instrument cluster, it is also a matter of safety to make sure performance is constantly high. In this post, we will explain how we reached a silky smooth and constant 60 fps rendering performance with Renesas R-Car D3 entry-level SoC using Qt Quick and Qt 3D Studio.

Requirements for the project

We selected the Renesas R-Car D3 low-end SoC as the hardware for this project. Similar performance entry level SoCs are available from other manufacturers as well, and we have also completed projects in the past with NXP’s entry-level SoCs. Now we wanted to use the Renesas R-Car D3, which comes with the Imagination PowerVR GE8300 entry level GPU (https://www.imgtec.com/powervr-gpu/ge8300/) and one ARM Cortex A53 CPU core.

Our visual designers created a rather typical modern digital instrument cluster design as the basis of this work. The cluster UI has two different gauge modes and a real-time 3D ADAS (Advanced Driver Assistance Systems) view in the middle. The target was to achieve a solid 60 FPS at 1280 x 480 resolution on the selected low-end hardware (Renesas R-Car D3 entry-level SoC). The design concept contained both real-time 3D elements (ADAS view) as well as elements that can be rendered with 2D using OpenGL shaders and visual design bringing a seamless 3D experience (without actually being calculated as real-time 3D).

demolayout

The structure of the design concept

Initial setup and findings

After completing the initial prototype using Qt 3D Studio we deployed it to the R-Car D3 development board running Qt 5.12 to analyze performance. Even though the graphics were not very complex, this non-optimized design was only rendering a mere ~10 fps. After we optimized the project assets it improved the situation, but at ~20 fps we were still quite far from the target rendering 60fps. It was clear, we will have to do further analysis and consider the overall architecture of the application.

The analysis was started with PVRTrace to learn more from the D3 SoC and where the pain points are. Very soon we learned that usage of large FBO’s (Frame Buffer Objects) or rendering target buffers in OpenGL basically kill the performance on this hardware. We measured 10ms overhead from using even just a single fullscreen FBO, which was 10ms out of the 16.6 we had available for the targeted 60fps.

Measured architectures

We measured variety of different application architectures and to get a baseline what can be reached with D3 hardware we also measured Qt Quick + plain OpenGL ADAS view. We implemented everything possible with Qt Quick and drew ADAS with pure OpenGL commands. With this setup we reached 60fps, which confirmed that are target is attainable.

We then moved on to the Qt Quick + Qt 3D Studio setup. The gauges were implemented with Qt Quick and the ADAS view in the middle as a Qt 3D Studio component. This method uses 1 FBO. A single layer was used for 3D content (single layer pass through), therefore no second FBO is used. Further savings on RAM can be achieved using texture compression. This setup was able to render static 60fps as well.

The most optimal architecture

After trying different approaches it was obvious that we will achieve the best possible performance when implementing the 2D elements with Qt Quick and use Qt 3D Studio runtime for the ADAS view. By implementing a background drawing patch to the runtime, we were able to squeeze out a few more frames per second and lower the CPU consumption.

demolayout2

Gauges implemented with QtQuick and 3D ADAS view with Qt 3D Studio 

Normally when you want to combine a 3D scene created with 3D Studio with 2D content with Qt Quick, it is necessary to composite the two together.  In this case Qt Quick has the responsibility for composition, however since Qt Quick is a 2D renderer it is necessary to flatten any 3D content embedded in the scene.  This is by default done by rendering the 3D content to an off-screen texture first, but as we mentioned above, the target hardware comes with a huge performance penalty for rendering to off-screen surfaces.  So this default route needed to be avoided.  Fortunately, Qt Quick is quite flexible and allows for some workarounds.

Our workaround was to render the Qt 3D Studio scene directly to the window at the start of the frame and then render the Qt Quick User interface over it.  The element in the Qt Quick UI where the 3D scene would have in this case been just a transparent hole so that you can see the underlying 3D content that was already rendered to the screen.  When doing this it’s also important to remember not to clear the window when rendering, which can be done by setting the Window color to “transparent” in QML.

This approach does come with some design limitations, though. In this case the limitation was not a problem and the design concept was possible to implement without any changes.  You can choose to either render the 3D content before, or after you render the Qt Quick UI, meaning the content will always either be above or below.  Since we chose to draw before and thus below the the Qt Quick UI it is then possible for us to draw controls on top of the 3D UI (even though we don’t in our case), but we would have not been able to blend any content that was under the 3D view.

If we needed to blend the 3D view with some 2D content that was under the 3D view, we could have chosen to render after the 2D content was rendered, thus above.  What is not possible with the chosen approach though is composing content below and above of the 3D content at the same time.  That is only possible via the use of an off-screen texture, so keep that in mind when designing content for such targets. It is also worth considering that blending has high resource utilization, especially on low-end hardware where your resources are limited, so although we did not have this constraint for this particular project it’s worth considering whether blending is needed early on in the design phase.

Final design optimisations to the 3D parts

As always with real-time 3D applications, we also looked into optimizing the graphics assets. Very often the 3D models and other assets first received from the designer are not yet optimized for the target application and hardware environment. For example, the models may have a higher level of detail than the human eye can detect from the screen. When every GPU and CPU cycle counts, it is essential to optimize the graphics assets as well. With the right tricks, the system load can be significantly reduced without any visible difference for the user.

Road mesh optimizations

We created a road mesh that uses vertex colors multiplied by road texture. This way the road can blend to the black background without rendering transparency, or using another texture to create an overlay gradient.

demovertexcolors

Vertex colors are multiplied by road texture

We created the road movement by animating the models’ texture coordinates. (Animatable material)

demoroad

Animated road

For low cost “Anti-aliasing effect” the edges of road texture were painted with background color (black).

demoantialias

Antialiasing effect

Car mesh optimizations

First step for optimizing a high polygon car model with multiple textures and materials was to create a low poly version. A few low poly models were generated with different poly counts in Zbrush and those low poly models were tested in application to see what is the minimum poly count that still looks good. The final low poly car model was created with Autodesk Maya’s Quad Draw tool.

demolowpoly

High polygon car model to low polygon

The final car mesh had multiple materials with detailed textures which were baked into single texture map, deleting half of the car and three of the wheels. The UV texture layout was created for the left side of the car and one of the wheels and the textures were baked based on the high poly model. After this, the geometry was duplicated and mirrored to create the right side of the car, where the wheels were also copied. This way our model had 50 % more pixels on the geometry while maintaining the same texture size.

democar

Creating the texture map

The maximum size of the car on screen is 200*150 pixels, so we reduced the size of the texture to 256*256 pixels.

demotexture

Reducing texture size. The size of the pixels on the car’s surface A are similar to the pixel size in the actual render of B. and the final size C still preserves enough details.

2D component optimizations

We built the 2D UI from reusable textures to reduce memory usage and startup time. In this case we loaded ~15 000 pixels into memory, and used those to render ~200 000 pixels to screen. By using this approach, we basically only load 7.5% of the used assets, because of the re-usage.

demotopbar

Reusing 2D elements 

Optimized Proof of Concept Application

You can download application source codes and assets from https://git.qt.io/public-demos/qt3dstudio/

And here is a video showing the application running on Renesas R-Car D3

 

Summary

Getting the desired visual concept running constant 60 fps with real-time 3D content can be a challenge, but Qt provides a great framework and tools to achieve amazing performance even on a low-end hardware. To achieve maximal performance it is important to consider and identify which components that must be in real-time 3D and the components that can be done with 2,5D (visually looking 3D, but not rendered spatially). This helps to achieve a computationally optimal architecture, and it is a pre-requisite for getting the maximal performance. All the graphical assets should be optimized carefully, especially the 3D models and textures, which can easily become too complex, considering what is possible to detect with a human eye. When using OpenGL shaders, it is important to make sure these are suitable and optimized for the target hardware. With the architecture and assets in shape, the remaining work is to use sound Qt programming techniques – and to regularly use profiling tools to identify and analyze where the possible performance glitches may be coming from.

If you are planning or working on a project where high-performance graphics on lower-end hardware are requirements, we can help. Contact us for more information about our professional services.

The post Optimizing Real-Time 3D for Entry Level Hardware appeared first on Qt Blog.

Qt 3D Studio 2.3 Released

We are happy to announce the Qt 3D Studio 2.3 release is now available via the online and offline installers. Here’s a quick summary of the new features and functions in 2.3. For detailed information about the Qt 3D Studio, visit the online documentation page.

Font Rendering

The 2.3 release introduces a new font rendering engine based on distance field font rendering. The new renderer is the default starting from 2.3 release onward. The old Qt Painter texture based can be enabled by setting an environment variable Q3DS_DISTANCE_FIELD_DISABLED to 1. The new font rendering also supports pre-generated distance field cache. The new font rendering does require Qt 5.12.2 release, with the earlier Qt releases the text rendering in using the old font rendering.

We have also added additional text properties e.g. fixed size text elements, text eliding and word wrapping options.

Variant tags

2.3 release also introduces Variant Tags  feature which enables to exclude parts of a presentation project during loading. This is to avoid parsing and loading objects that are not needed in the presentation for certain variants, saving on loading time and resource usage.

Variant Tags

Using Variant Tags

This enables creating multiple variations of a product UI with one single Qt 3D Studio presentation. One concrete use case is the need to have UI variants for different geographical areas or enabling or disabling some parts of the user interface based on a hardware model information. Please see more details on the variant tags documentation how to add variants into design.

Performance improvements

As mentioned earlier in the performance improvement blog post we have been working on several performance related topics. In addition to the texture compression introduced in 2.2 release we have now enabled the new animation system by default. If you wan’t to switch between the old animation system it can be enabled by setting the Q3DS_NO_DRAGONWINGS environment variable to 1. We have also working with the new experimental renderer which can be enabled by setting the Q3DS_DRAGON environment variable to 1.

Other improvements

We have been making several improvements to the 3D asset importing functionality. For example lights and camera objects are now imported from COLLADA and FBX files. There are also several improvements to compatibility with Maya FBX exports.

We have also added a QML API for controlling the Stereoscopic rendering properties from the application.

Getting started

Qt 3D Studio 2.3 is available through Qt online installer under the Developer and Designer 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, Mac and Linux.

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.

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

Bicing Barcelona with Qt

When I was living in Barcelona I saw that there is a OpenData service to get the information of the bike public service. They provide the data in several formats such as CSV, XML and JSON. I wanted to write an app for Windows and Linux that retrieves the information from the stations and shows their current status. And for that, I chose JSON since I think the format is easier to read than XML.

After thinking a while I realised that it could be useful not just have every station data on demand but also a historic. To achieve that I split the app in two separated parts: "backend" that works as a deamon or service, and "frontend" that is the actual GUI app.

La entrada Bicing Barcelona with Qt aparece primero en My C++ & Qt blog - Cesc M..

SDDM v0.18.1

We are happy to release a new SDDM version.

SDDM is a Qt based graphical login manager developed in a collaborative fashion by people from LiriKDE and LXQt.

This time around we made a point release with the following hot fix:

Use C++ scoping for handling buffer deletion - link
SDDM is developed by volunteers, please consider donating money that can be used to support the features that you most desire.

We now have a Bountysource page and I hope that we can get more developers to help us, as we are sometimes struggling to keep a consistent pace with the development.  Having a full time developer, would even be better, but we can start with bounties and see what happens.

Download the source code here.