What makes for good animation?

In the beginning there was …

 

That’s how things start, right? And in the beginning there were punch cards. The UI was rudimentary direct machine language, so we could say there was no UI. So let there be light!

In very simplistic terms that was a screen where one could type text (using a keyboard) and see the same text on the screen … maybe get some feedback on the results of a command. And let the animation begin!

The post What makes for good animation? appeared first on KDAB.

Device detection in Qt for Device Creation 5.9

Qt for Device Creation provides ready disk images for a variety of devices. When you flash it to a device, start enterprise Qt Creator and plug the device in via USB, it will be detected automatically. You are ready to run, debug and profile your applications right on the device. From a user’s point of view the green marker for a ready device just appears.

ready-device

But how do we actually see the device? There have been changes here for 5.9 and in this post I’ll discuss what we ended up doing and why.

How things used to be

Previous versions of Qt for Device Creation use Android Debug Bridge (ADB) for the device discovery. As you can guess from the name, it’s the same component that is used in the development of Android applications. It was a natural choice early in the development of the Boot2Qt when Android was a supported platform along with embedded Linux. But nowadays we focus on embedded Linux only. (In Device Creation with the device images, Qt can of course still be used to build applications on Android.)

Due to requiring Google’s USB drivers, ADB has made installing more complicated than desired for our users on Windows. And when they jumped through the hoops, they could end up with a different version than we tested against. There’s also the risk of mixups with Android development environments, who may include their own versions of ADB. There were also some things missing, which required working around inside our Qt Creator integration.

Recognizing USB devices

So to avoid those issues we decided to decided to write our own debug bridge, which we without extraneous imagination called QDB. It looks for Boot2Qt devices in a similar way as the purpose of other USB devices is discovered. When a device is enumerated in the universal serial bus, it describes its class, subclass and protocol. For example for my mouse the command lsusb -v reveals:

      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse

There is a vendor-defined class 255. We have picked a subclass and protocol inside that which our devices use, thus allowing QDB to find them. Finding them is of course not enough, since there needs to a way to transfer data between the host computer and the device.

Network over USB

ADB implements file transfers and port forwards. It transfers the data over the USB connection using its own protocol. One obvious option would have been to do the same thing. That would have been reinventing the wheel, as was quickly pointed out by many. There was also a second place where duplication of effort to accomplish the same thing was happening. The Boot2Qt plugin for Qt Creator was implementing support for running, debugging and profiling applications with ADB. But Qt Creator also supports these things with any Linux device over SSH through the RemoteLinux plugin. If we were able to use SSH, all of that duplication could be gotten rid of (after the support window for older Qt for Device Creation releases runs out).

Linux allows a device to present itself as an USB Ethernet adapter with the kernel module usb_f_rndis. The device then shows up as a network card in both Linux and Windows. This way we can have a network connection between the host computer and the device, which allows the use of SSH and thus the desired reuse. And apart from Qt Creator activity, the user can also use regular SSH to connect to the device. It has a properly resizing terminal, unlike adb shell! All the other things you might do over the network also become possible, even if the embedded device has no Ethernet socket.

But there’s something we glossed over. Networks don’t configure themselves. If the user would need to set the right IP address and subnet mask on both the computer and the device, then we certainly wouldn’t meet the bar of just plugging in the device and being ready to go.

Configuring the network

Now despite what I just said there actually are efforts for networks to configure themselves. Under the umbrella term zeroconf there are two things of interest in particular: link-local IPv4 addresses as specified in RFC 3927 and mDNS/DNS-SD, which allows finding out the addresses of devices in the network. For a while we tried to use these to accomplish the configuration of the network. However, getting the host computer to actually use link-local addresses for our network adapter proved fiddly and even if it worked there was a bit too long delay. The connection only works after both the host computer and device have gotten their IP which wasn’t predictable. I hope we will be able to revisit mDNS/DNS-SD at some point, because it might allow us to provide device discovery when devices are connected over Ethernet instead of USB, but for now zeroconf required too much configuration.

Another thing which we looked at was using IPv6 link-local addresses. Unlike their IPv4 cousin they are part of the protocol and always available, which would eliminate the delays and configuration burden. Here the downside is that they are a bit more local to the link. An IPv4 link-local IP is from the block 169.254.0.0/16 and you can just connect to it regularly. IPv6 versions use the prefix fe80::/10, but they also require a “scope ID” to describe the network adapter to use. I’d rather not write

ssh user@fe80::2864:3dff:fe98:9b3a%enp0s20f0u4u4u3

That’s superficial, but there was also a more important issue: All the tools would need to support IPv6 addresses and giving these scope IDs. GDB – which we use for debugging – didn’t.

Back to the drawing board. The simplest approach would be picking up a fixed IP address for the devices. That has two issues. First, you can’t connect more than one device. Second, the fixed IP address might already be in use on the host computer. We ended up using the following approach to circumvent these problems: The same process that recognizes the USB devices knows a list of candidate network configurations in the private use IPv4 ranges. When a new device is connected, it looks at the networks the host computer currently has and then picks a candidate that doesn’t conflict. The device is told the configuration, sets its own IP address accordingly and then acts as a DHCP server that provides an IP for the host computer.

After this process is done, the host computer and device have matching network configurations, Qt Creator knows the IP of the device and everything is ready. If you connect a second device, a different candidate configuration is picked, since the first one is already in use. The DHCP server is disabled when the device is disconnected, because otherwise host computer could get an IP from a previous configuration when it is connected again.

The post Device detection in Qt for Device Creation 5.9 appeared first on Qt Blog.

What’s new in Qt 3D with Qt 5.9?

by Sean Harmer, KDAB [Qt Service Partner] (Qt Blog)

I am pleased to announce that there are lots of new goodies coming along with Qt 3D as part of the Qt 5.9.0 release as well as the usual round of bug fixes. Engineers from KDAB and The Qt Company have been hard at work over the last months (and will be for some time to come) adding in some of the most frequently requested features. In this article, we will give a brief overview of some of the bigger features coming your way.

Using Qt Quick within Qt 3D

A very common request that we have had since we first released Qt 3D is to have the ability to embed Qt Quick scenes within a Qt 3D application. The use cases for this are wide ranging, but a typical example is to place a 2D user interface onto the surface of some planar piece of geometry in your 3D world to simulate an “in-3D-universe-control-panel”. As VR/AR become more popular, this use case is likely to increase in importance.

I’m happy to say that embedding Qt Quick into a Qt 3D scene is now easily possible. Even better, it is possible to interact with such 2D UIs within the 3D world! The Scene2D QML Example shows how to use the new Scene2D type to render Qt Quick to a texture, apply it to a 3D object, and ensure that events are forwarded to the QQuickItems to allow interactivity.

scene2d

 

 

In short, we can render a Qt Quick 2 scene into a texture with Scene2D and register it to receive events from a Qt 3D entity called “cube”:

Scene2D {
    id: qmlTexture
    output: RenderTargetOutput {
        attachmentPoint: RenderTargetOutput.Color0
        texture: Texture2D { id: offscreenTexture }
    }
    
    entities: [ cube ]
    
    Item {
        id: customQtQuickStuff
    }
}

This takes care of rendering the texture. Using it on an Entity is simply a case of applying the resulting texture which can be done with the TextureMaterial:

Entity {
    id: cube

    components: [cubeTransform, cubeMaterial, cubeMesh, cubePicker]

    property real rotationAngle: 0

    Transform {
        id: cubeTransform
        translation: Qt.vector3d(2, 0, 10)
        scale3D: Qt.vector3d(1, 4, 1)
        rotation: fromAxisAndAngle(Qt.vector3d(0,1,0), cube.rotationAngle)
    }

    CuboidMesh {
        id: cubeMesh
    }
    
    TextureMaterial {
        id: cubeMaterial
        texture: offscreenTexture
    }
    
    ObjectPicker {...}
}

The ObjectPicker in the above code is picked up by the Scene2D’s “entities” property and used as a source for events.

The counterpart to Scene2D is Scene3D which allows embedding a Qt 3D scene inside of a Qt Quick 2D UI. Hopefully, in the future, we will be able to get a seamless blend between Qt Quick and Qt 3D.

Physics Based Rendering

Modern rendering engines have largely adopted Physics Based Rendering (PBR) to improve the visual appearance of their results and to make it easier for artists to get predictable results. PBR encompasses a family of techniques but essentially says that rendering should be more physically rigorous when shading than older ad hoc lighting models. For more information and background on PBR please take a look at this talk from Qt Con 2016.

pbr-metal-rough powerup-qt3d-pbr

New to Qt 3D in Qt 5.9 are two new materials: QMetalRoughMaterial and QTexturedMetalRoughMaterial which implement a PBR algorithm with Blinn-Phong specular highlights. There is also a new light type QEnvironmentLight that can be used in conjunction with the above materials to provide nice environmental reflections and image based lighting (IBL) as shown below.

The source code for the above examples are available at KDAB’s github.

Key Frame Animations

Qt Quick has long had support for easily specifying animations using an intuitive API. This can be used along with Qt 3D to animate properties. A frequent request from digital content creators is for support of key frame animations. Also, given the highly threaded architecture of Qt 3D, it would be nice if we could find a way to improve how animations scale compared to having them evaluated by the main thread. The technology preview of the new Qt3D Animation module achieves exactly this.

Whereas the Qt Quick animation API (and the QPropertyAnimation API in C++) specify an animation curve between the start and end times, when using key frame animations we instead specify the property values at specific times known as key frames. To evaluate the animation at times that do not exactly correspond to key frames we use interpolation/extrapolation. For now, Qt 3D Animation implements a Bezier curve interpolation, but we will expand this with other types for Qt 5.10. However, with the key frames being Bezier curve control points, it is already possible to achieve a wide range of animation curves.

The animation curves are specified using QAbstractAnimationClip which boils down doing it programmatically with QAnimationClip or loading baked animation data exported from a digital content creation (DCC) tool with QAnimationClipLoader. Qt 3D provides a handy addon for Blender to export the animation data of objects into the json format consumed by Qt 3D.

bezier-animation-curves

 

The actual playback of animation data is handled by a new QComponent subclass called QClipAnimator. As with all other QComponents, the clip animator must be aggregated by an entity to give behaviour to the entity. In addition to the raw animation data, the clip animator also needs a way to specify which properties of which target objects should be updated by the animation. This is done with the QChannelMapper and QChannelMapping classes. Please take a look at this blog post showing a simple application that animates a character using the Qt 3D Animation framework. The source code for this can be found at KDAB’s github.

Entity {
    id: cube

    components: [
        Transform { id: cubeTransform },
        Mesh { source: "qrc:/assets/egg/egg.obj" },
        TexturedMetalRoughMaterial { ... },
        ObjectPicker { onClicked: animator.running = true },
        ClipAnimator {
            id: animator
            loops: 3
            clip: AnimationClipLoader { source: "qrc:/jumpinganimation.json" }
            channelMapper: ChannelMapper {
                mappings: [
                    ChannelMapping { channelName: "Location"; target: cubeTransform; property: "translation" },
                    ChannelMapping { channelName: "Rotation"; target: cubeTransform; property: "rotation" },
                    ChannelMapping { channelName: "Scale"; target: cubeTransform; property: "scale3D" }
                ]
            }
        }
    ]
}

The clip animator, animation data, and channel mapper types represent different concepts which are all merged in the familiar Qt Quick and QPropertyAnimation APIs. Separating these out allows us more control and reuse of the individual parts but we will look at adding some convenience API on top for common use cases.

The QClipAnimator class simply plays back a single animation clip. But what if we wish to combine multiple animation clips? We could drop down a level and craft some new animation data that combines the clips but that’s tedious, error prone and doesn’t work well when changing how we combine the clips at a high frequency. Enter QBlendedClipAnimator. Instead of a single animation clip, the API of a blended clip animator takes a pointer to the root of an animation blend tree – a data structure describing how an arbitrary number of animation clips can be blended together. The blend tree consists of leaf nodes representing animation clips and interior nodes representing blending operations such as linear interpolation or additive blending. For more information on blend trees, please take a look at the Qt 3D Overview documentation.

In order to have performance that scales, the Qt 3D Animation framework evaluates the animation curves on the thread pool utilised by the Qt 3D backend. This allows us to scale across as many CPU cores as are made available. Also, it is often the case that the object tree on the main frontend thread doesn’t need to know or care about the intermediate property updates during an animation. Therefore by default, only the final change from an animation is sent to the frontend objects. If you do need the intermediate values, perhaps because you have property bindings depending upon them, then you can subscribe to them via the new QNode::defaultPropertyTrackingMode. The default behaviour is consistent with the Qt Quick Animator types.

In addition to key frame animations, the Qt 3D Animation module introduces initial support for morph target animations that allow blending mesh geometries between a set of specified target shapes. The blending can be controlled via the above key frame animations. This is likely to be moved into the Qt3D Render module once we flesh out the support a little more.

Level of Detail

When building larger 3D scenes it can be useful to only render the full resolution geometry with high-resolution textures when the object is close enough to the camera to justify it. When the objects are farther away, and the projected screen size is small, it makes sense to use lower fidelity models, textures, and perhaps even shaders to reduce the overall rendering cost and therefore increase performance. Qt 5.9 introduces the QLevelOfDetailand QLevelOfDetailSwitch components to enable this.

The QLevelOfDetail component allows you to set an array of the camera to object distance thresholds or projected screen pixel sizes. As these thresholds are reached, the component adjusts its currentIndex property to match that of the corresponding threshold. You can bind to this property (or connect to its notification signal) to do whatever you like in response. For example, use a loader to load a different mesh, set smaller textures, use a simpler material or shader. It’s up to you.

Entity {
    components: [
        CylinderMesh {
            radius: 1
            length: 3
            rings: 2
            slices: sliceValues[lod.currentIndex]
            property var sliceValues: [20, 10, 6, 4]
        },
        Transform {
            rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
        },
        PhongMaterial {
            diffuse: "lightgreen"
        },
        LevelOfDetail {
            id: lod
            camera: camera
            thresholds: [1000, 600, 300, 180]
            thresholdType: LevelOfDetail.ProjectedScreenPixelSizeThreshold
            volumeOverride: lod.createBoundingSphere(Qt.vector3d(0, 0, 0), 2.0)
        }
    ]
}

The QLevelOfDetailSwitch component works in a similar way but implements a common use case where the children of the Entity upon which it is aggregated are all disabled except for the one matching the currentIndex property. This allows you to quickly and easily get a level of detail system into your application.

Entity {
    components: [
        LevelOfDetailSwitch {
            camera: camera
            thresholds: [20, 35, 50]
            thresholdType: LevelOfDetail.DistanceToCameraThreshold
        }
    ]

    HighDetailEntity { enabled: false }
    MediumDetailEntity { enabled: false }
    LowDetailEntity { enabled: false }
}

For the QML users, there is also a LevelOfDetailLoader which, as its name suggests, dynamically loads custom QML components as the level of detail thresholds are reached.

LevelOfDetailLoader {
    id: lodLoader
    camera: camera
    thresholds: [20, 35, 50]
    thresholdType: LevelOfDetail.DistanceToCameraThreshold
    volumeOverride: lodLoader.createBoundingSphere(Qt.vector3d(0, 0, 0), -1)
    sources: ["qrc:/HighDetailEntity.qml", "qrc:/MediumDetailEntity.qml", "qrc:/LowDetailEntity.qml"]
}

Text Support

Although we have support for embedding Qt 3D within Qt Quick and vice versa, it is still nice to be able to directly use textual content within your 3D virtual worlds. Qt 5.9 introduces 2 ways to do this (beyond Scene2D).

First, there is 2D planar text implemented with distance fields just like the default text rendering in Qt Quick. This is done by way of the QText2DEntity

Text2DEntity {
    id: text
    text: "Hello World"
    width: 20
    height: 10
}

This can be positioned freely in 3D space just like any other entity, and so this becomes a first class citizen of your 3D world.

For those of you that want solid, extruded, 3-dimensional text, there is the QExtrudedTextGeometry class. Or for even more convenience, there is the analogous QExtrudedTextMesh which is a subclass of the QGeometryRenderer component and can, therefore, be directly aggregated by an entity.

auto *text = new Qt3DCore::QEntity(root);

auto *textTransform = new Qt3DCore::QTransform();

auto *textMesh = new Qt3DExtras::QExtrudedTextMesh();
textMesh->setDepth(.45f);
QFont font(family, 32, -1, false);
textMesh->setFont(font);
textMesh->setText(QString(family));

auto *textMaterial = new Qt3DExtras::QPhongMaterial(root);
textMaterial->setDiffuse(QColor(111, 150, 255));

text->addComponent(textTransform);
text->addComponent(textMesh);
text->addComponent(textMaterial);

3d-text

If you need any other kinds of text support in Qt 3D please let us know.

Summary

I hope that this has given you a good overview of the new features coming to Qt 3D with Qt 5.9. We think that you will find them useful in building ever more ambitious 3D projects with Qt. We have even more surprises in the pipeline for Qt 5.10 so watch this space.

The post What’s new in Qt 3D with Qt 5.9? appeared first on Qt Blog.

Release 2.11.0: All Monetization Plugins Now Free, Plugin Trial & Firebase Qt Plugin

V-Play 2.11.0 adds many improvements to V-Play plugins:

  • All monetization plugins for in-app purchases and advertisements are now free to use in all licenses, including the Personal License!
  • You can test all other plugins (for analytics, push notifications, crash reporting, beta distribution) in your free license too.
  • It is a lot easier now to add these plugins to your projects with the new plugin templates.
  • The Google Firebase plugin is new – you can use it for user authentication and to access the Firebase Realtime Database.

Free Monetization Plugins for all V-Play Developers

Many developers ask us: “I’d like to earn money with my app/game, but can’t afford the Indie license as I’m doing this as a hobby. What can I do?”

We decided to make this decision easy. Starting with this V-Play release, you can use all monetization plugins for free, and you don’t need an Indie/Enterprise license to make money with your app or game!

The now-free monetization plugins include:

  • Soomla Plugin for cross-platform in-app purchases and virtual currencies
  • Advertisement plugins to show interstitial ads, banner ads and rewarded videos with Google AdMob and Chartboost

We don’t charge any revenue share, all the revenue you make is yours. And if your app is doing well and you’re earning more than $50,000 a year, the Indie license (which is $49 per month) is the right choice. The Indie license has a few additional benefits – you can:

  • Remove the V-Play Splash Screen.
  • Also use all the other plugins, such as those for advanced analytics, push notifications, crash reporting and beta distribution.
  • Get advanced email support.

To sum it up, the Indie license is for established companies who are already earning revenue. And for starting your app or game business, you can now use all the monetization options available in the higher-tier licenses.

How to Add a V-Play Plugin to your App or Game

When you create a new project, you can now choose the Plugin Application template. Open Qt Creator and choose “File / New File or Project”, then select Plugin Application in the V-Play Games or V-Play Apps section.
Plugin_ProjectWizard_0

Then select the platforms you’d like to add the plugins for. The plugins are available for iOS & Android. There is a fallback functionality in place on Desktop platforms so your project still works when you call methods of the plugins. This allows you to do the main development on your PC, and for testing the plugin functionality you can run the project on iOS and Android:
Plugin_ProjectWizard_2

You can then choose which of the plugins you’d like to add to your project:
Plugin_ProjectWizard_4

Your project is now set up with all the correct plugin dependencies for Android & iOS automatically. This includes:

  • Setting up the .gradle file for Android.
  • Setting up the .plist file for iOS.
  • Setting up the .pro file to include the plugin libraries for iOS.

How Can I add a Plugin to an Existing Application?

If you have an existing V-Play application, follow these steps to include a plugin to your app or game.

Note: If you have an existing Qt application, you can also add V-Play Plugins to your app! See here how to do this.

In Qt Creator, choose “File / New File or Project” and choose either V-Play Games or V-Play Apps from Files and Classes. Select V-Play Plugin and press Choose.
Plugin_FileWizard_1

You can now select the plugin you want to add, in this example we’ve chosen AdMob:

Plugin_FileWizard_2

The AdMob item is now added to your project. The created item contains ready-to-use ad identifiers so you can try it quickly without having to create an own account. You can of course also change these to your ad ids. The created item looks like this:


import VPlayPlugins 1.0
import QtQuick 2.0
import VPlayApps 1.0 // only used for ListView with Plugin Overview and Example

/*
 EXAMPLE USAGE:
 Add the following piece of code inside your main QML { } to display this example page.

 ItemWithAdMob {

 }

*/

Rectangle {
 anchors.fill: parent

 // Plugin Item
 AdMobBanner {
   id: adMobBanner
   adUnitId: "ca-app-pub-9155324456588158/9913032020" // replace with your AdMob adUnitId
   banner: AdMobBanner.Smart

   anchors.horizontalCenter: parent.horizontalCenter
   anchors.bottom: parent.bottom
 }

 // Plugin Item
 AdMobInterstitial {
   id: interstitial
   adUnitId: "ca-app-pub-9155324456588158/9075427220" // replace with your AdMob adUnitId
 }

 // AppListView for Plugin Overview and Example Usage
 AppListView {
 // example usage of the plugin, removed here for brevity ...
 }
}

 

To use the item in your project, simply perform these steps:

  • Include the ItemWithAdMob (use the name you entered in the template before) in your main.qml file.
  • Modify the .pro file & .plist file for iOS usage. See the iOS integration guide for AdMob here.
  • Modify the the .gradle file for Android usage. See the Android integration guide for AdMob here.

How to Test All Plugins – New Plugin Trial

With this release, you can test all plugins that are included in the Indie & Enterprise license in your free license too. There are plugins for analytics, push notifications, crash reporting, beta distribution and more.

The full functionality of a plugin is available for testing. When you are calling a method from the plugin, for example AdMob::showInterstitial(), there is a dialog shown and a watermark in your application to notify you about the testing state of the plugin.

If you have purchased the Indie or Enterprise license, you can remove these notifications and fully use all plugins in your apps by creating a license key. As the monetization plugins are now free to use in all licenses, you can also enable their full functionality on the license creation page.

This is how it works:

1. Choose the plugins you want to include in your license key:

v-play-plugin-selection

2. Click on “Generate License Key” and set the app identifier & version code. You can see that the AdMob plugin was enabled in this license key:

licensekey-app-identifier

3. Copy the generated licenseKey to your GameWindow or App component.

generated-licensekey

4. You can now fully use the plugins!

New Firebase Qt Plugin

With the new Firebase plugin, you can:

  • Use Firebase Authentication for user authentication via email. This includes account creation, password recovery and of course login and logout functionality. This does not require your own backend.
  • Use the Firebase Realtime Database to store and sync data with the Firebase NoSQL cloud database. Data is synced across all clients in realtime, and remains available when your app goes offline.

The Firebase plugin comes with various examples and extensive documentation on how to use it. You can find it here.

Firebase Authentication

Most apps need to know the identity of a user. Knowing a user’s identity allows an app to securely save user data in the cloud and provide the same personalized experience across all of the user’s devices.

Firebase Authentication provides backend services to authenticate users in your app. The plugin currently supports authentication using e-mail and passwords. Additionally, the Firebase plugin comes with a “forgot password” feature, which you can easily use in your application without tedious setup.

You can design the login screen completely customized for your app. If you don’t want to do that, we’ve got you covered as well: You can easily create a login page template using our wizard. Just click File -> New File or Project -> V-Play Apps -> Page and in the next step, select Login Page as Page Type.

Firebase Realtime Database

Use the Firebase Realtime Database to store and sync data with the Firebase NoSQL cloud database. Data is synced across all clients in realtime, and remains available when your app goes offline.

The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and internally synchronized in realtime to every connected client.

When you build cross-platform apps with the Realtime Database, all of your clients share one Realtime Database instance. The Firebase backend automatically receives updates with the newest data as soon as the database is changed by one of the clients. Additionally, changes to the database are propagated to other clients and can be read by the clients in real time.

firebase-database-data

As an alternative to Firebase, V-Play also comes with its own easy to use WebStorage component, which connects to the V-Play backend. It is a simple key-value store which syncs across different devices and platforms via the V-Play Game Network Backend as a Service (BaaS).

More Fixes & Improvements

Besides the highlights mentioned above, there are many other fixes and improvements for the SDK. For a full list of improvements and fixes to V-Play in this update, please check out our change log!

How to Update V-Play

Test out these new features by following these steps:

  • Open the V-Play SDK Maintenance Tool in your V-Play SDK directory.
  • Choose “Update components” and finish the update process to get V-Play 2.11.0 as described in the V-Play Update Guide.

update-sdk

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

For a complete list of the changes to V-Play with this update, please check out our change log!

More Posts like This

 

How to Make Cross-Platform Mobile Apps with Qt – V-Play Apps

How to Make a Qt app

Release 2.10.1: V-Play Apps, TexturePacker & Qt 5.8 Improvements

Release 2-10-1

The post Release 2.11.0: All Monetization Plugins Now Free, Plugin Trial & Firebase Qt Plugin appeared first on V-Play Engine.

QtLocation: using offline map tiles with the OpenStreetMap plugin

The OpenStreetMap plugin in QtLocation 5.8 has received a new Plugin Parameter, osm.mapping.offline.directory, to specify a indexable location from which to source offline tiles. Since this new feature seems to have generated some confusion, here is an attempt to clarify how it works.

Until now, when a tile became visible on the map, the QtLocation engine would first attempt to source it from the tile cache. If not present, it would attempt to fetch it from the provider.

With QtLocation 5.8 it is possible to pass an additional offline directory to the OSM plugin. When this parameter is present, tiles will be sourced from the specified directory before being searched in the tile cache, and, after that, being requested to the provider.

The content of such an offline directory is read only, for QtLocation, meaning that the engine will not add, delete or update tiles present therein. Tile filenames have to follow the osm plugin filename pattern, meaning osm_100-<l|h>-<map_id>-<z>-<x>-<y>.<extension>.

The field map_id goes from 1 to 7 (or 8, if a custom map type is specified), referring to the map types street, satellite, cycle, transit, night-transit, terrain and hiking, in this order.
The field before has to contain an l or an h, which stands low-dpi and high-dpi tiles, respectively.

The intended use cases that this feature aims to address are mainly:
– shipping custom maps for limited regions with the application.
– shipping tiles for low zoom levels with the application so to prevent blank maps when the application is run for the first time without internet connection.

To exemplify the usage of this feature, OsmOffline is an example application that uses tiles from the Natural Earth project, which are licensed under very permissive TOS, to address the second scenario.
This example embeds tiles for one map type at zoom levels 0, 1 and 2 using the Qt Resource system, and sources them from the qrc path :/offline_tiles/.

The post QtLocation: using offline map tiles with the OpenStreetMap plugin appeared first on Qt Blog.

Qt Creator 4.3.0 released

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

Qt Quick Designer with integrated code editor

Qt Quick Designer

For Qt Creator 4.3 we integrated a code editor into Qt Quick Designer. This allows you to use the Properties editor and the Navigator also while editing code. Additionally, you can split the view to show both the graphical and the code editor, and directly see how a change in the graphical editor affects the code, and vice versa. Of course, you can still use the code-only editor in the Edit mode as well.

There have been many more improvements and additions to Qt Quick Designer, like better support of stacked containers and a new tool bar for common actions. Please take a look at the blog post that focuses only on what is new in Qt Quick Designer.

CMake

If you use Qt Creator with CMake 3.7 or later, we now use the server-mode that was added to CMake 3.7 for the benefit of IDEs. It provides much better information about the project structure, include paths, and more, than what we could parse from the generators and Makefile before. As a result you also see products and targets in the project tree and can build them individually.

Regardless of CMake version we added header files to the project tree, even if they are not listed explicitly in the project files. You now can also import existing builds of a CMake project, like we already provide for QMake based projects, which sets up a kit with the information found in the CMake cache from the build, and registers new toolchains and Qt versions as needed.

C++

If you are coding in C besides C++, or use files in different (sub-)projects with different defines, you will find a new feature in the C++ editor helpful: If a file is used in different contexts, a drop down menu appears in the tool bar on top of the editor, that allows you to choose the (sub-)project and language that the editor should interpret the file in (documentation).

If you are up for a bit of experimentation, enable the ClangRefactoring plugin. It adds preliminary support for clang-query to Advanced Find and uses Clang for the local renaming refactoring.

CDB / MSVC Debugging

Our CDB support for debugging MSVC code now uses a Python based backend for pretty printing. This results in much better performance and, since it shares most pretty printing code with our GDB and LLDB backends, also in more, better, and unified pretty printers for Qt Creator’s CDB support.

Note: The CDB debugging support moved to a separate, optional component in the installers (enabled by default). Unfortunately that means that if you use the online installer to update to Qt Creator 4.3, this new component will not be installed. You have to restart the maintenance tool, choose “Add or remove components”, and install the Qt > Tools > Qt Creator CDB Debugger Support component to get it back.

QML Profiler with in-code performance information

QML Profiler

When you profile your Qt Quick application with the QML Profiler, you see performance information now also directly in the QML code editor. The profiler itself received many performance improvements as well, and many smaller UI issues were fixed.

Android

Qt Creator 4.3 fixes the issues created by changes in the Android SDK version 25.3.1.

iOS

If you use Qt Creator for iOS development, you can now choose the developer team and provisioning profile used for signing. This overrides the default that QMake chooses and any settings you have in your project files.

Other Improvements

There have been many more improvements, which are described in more detail in our change log.

Get Qt Creator 4.3.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.3.0 is also available through 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.

Note: The CDB debugging support moved to a separate, optional component in the installers (enabled by default). Unfortunatly that means that if you use the online installer to update to Qt Creator 4.3, this new component will not be installed. You have to restart maintenance tool, choose “Add or remove components”, and install the Qt > Tools > Qt Creator CDB Debugger Support component to get it back.

Note: We now provide 64-bit offline installers for Windows.

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

Qt Quick Designer in Qt Creator 4.3

For Qt Creator 4.3 we added many new features to the Qt Quick Designer.

Integrated text editor

The most obvious addition is an integrated text editor in the Design mode that also allows editing the QML code side by side with the form editor as a preview.
Besides being able to edit QML code while seeing a preview also the property editor can be used together with the text editor. Qt Quick Designer will always select the item that currently contains the cursor.

So if you just forgot the name of a property or enum, you can now use the property editor instead. Switching between the form editor and the integrated text editor is also a lot faster than switching between Edit and Design mode. This makes it more convenient to move to the integrated text editor to refactor or clean up something.

The style in Qt Quick Designer side by side editing

Here we style a button from Qt Quick Controls 2
using the form editor as a preview. Qt Quick Designer now also shows common actions as part of the selection rectangle. In case you selected a Rectangle you can easily set the color.

Toolbar

toolbar

Another directly visible change is the new toolbar. We added the toolbar to make certain operations more visible to the user that were hidden in context menus before. For example, you can automatically lay out multiple selected items in a row, column or grid layout.

Styling

Qt Quick Designer now reads the qtquickcontrols2.conf configuration from Qt Quick Controls 2 and enables you to change the Qt Quick Controls 2 style on the fly using the toolbar. This is especially useful if you want to quickly see how your UI looks with different styles.

Tab Bar

Managing a StackLayout and an attached TabBar has become a lot easier.

You can easily add new Items to the stack layout and navigate between the active Item. And using
the context menu you can add a TabBar to an existing StackLayout. The required anchors and bindings are set up automatically.

 

Qt 5.9 comes with an example that shows how to define your own custom style for Qt Quick Controls 2 and use this style in Qt Quick Designer.

Caption

The user just has to add the custom style to the project. The location of the subdirectory containing the style has to be next to the qtquickcontrols2.conf file.
In the configuration file, the style has to be the name of the subdirectory.

Qt Quick Designer then shows all QML forms using the custom style.

In the example we combine this with a QML plugin containing a singleton defining all constants and colors. This makes adjusting and maintaining a style a lot easier.

Move Component into Separate File

Another very useful feature is Move Component into Separate File.

movetocomponent

This was already available in the Edit mode for a long time, but now it is also possible in the Design mode and the feature got improved. The user now can select which properties are set inside the component and which properties are in the original instance. In the nscreenshot we move the button with a custom background into the component MyButton.qml.

Mock up C++

The contact list example shows how to use QML_DESIGNER_IMPORT_PATH in the .pro file.

movetocomponent

The QML_IMPORT_PATH setting informs the code model and Qt Quick Designer about imports, whereas the new QML_DESIGNER_IMPORT_PATH introduces a specific import path just for Qt Quick Designer.
This enables you to use different components in Qt Quick Designer from those used in the actual application. This is very useful to mock complex items or in this case, a list model written in C++. We simply use ListModel to create a simple model that is then used in Qt Quick Designer.

 

States and state machines

We created the traffic light example that shows how to use QML and Qt Quick Designer together with a SCXML state machine.

trafficstates

To achieve this, we add QML states and bind those to the SCXML state machine.

trafficbackends

To manage the QObject that represents the SCXML state machine, we added the Backends tab to the connections editor. This makes it easier to make QObjects that represent the C++ backend available
and to bind properties or states to those.

settingwhencondition

Another new feature is the ability to edit the when condition of states. This makes it easy to map QML states to the states of the SCXML state machine. The expressions for the when condition are edited with the same
editor that is used for expression bindings in the property editor. The expression editor does support auto completion.

It is now also possible to change the type of an item by double clicking on the type name in the property editor. This also enables you to change the type of the root item.
Users of High DPI displays will like the fact that the form editor is now supporting High DPI and all items are rendered in High DPI for such displays.

Last but not least we moved the states editor to the bottom and it is collapsed by default. Our experience is that many QML forms do not use states, so the valuable screen estate on the top was wasted in those cases.

The post Qt Quick Designer in Qt Creator 4.3 appeared first on Qt Blog.

Ci vediamo a QtDay 2017?

With an apology to English-speaking audiences 🙂

Anche quest’anno KDAB partecipa a QtDay, la conferenza italiana interamente dedicata a Qt. Giunta oramai alla sua sesta edizione, QtDay continua a crescere. Quest’anno QtDay si articola in 3 giorni: il primo dedicato a un training su QML, seguito da due giorni di conferenza vera e propria.

Durante la conferenza terrò due interventi:

  • Venerdì 23 giugno parteciperò ad una tavola rotonda sul come contribuire allo sviluppo di Qt;
  • Sabato 24 giugno

The post Ci vediamo a QtDay 2017? appeared first on KDAB.

Functional Safety with the Qt Safe Renderer

I am pleased to announce a new approach for inclusion of functional safety critical user interface elements in Qt based systems. The new Qt Safe Renderer makes it easy to create safety critical systems that also have a rich graphical user interface. Industries such as automotive, medical and industrial automation, where Qt is the leading UI framework, can now satisfy safety critical requirements with Qt easier than before.

For those who are not yet familiar with our approach to functional safety please check the earlier blog post about functional safety and a blog post on how to create certified systems with Qt.

To create a certified system, the safety critical features must be separated from the other parts of the system. The safety critical functionality can be separated, for example, by running in own memory protected processes with a certified Real-Time Operating System (RTOS). This leaves two parts that need to be addressed in a safety critical system:

  • Certified tooling to produce the UI design workflow
  • Designing, writing and certifying the safety-critical code

The new Qt Safe Renderer solves both of these by providing tooling to design safety critical UI items and dedicated software to reliably render the these elements in a Qt based safety critical system.

The Qt Safe Renderer tooling makes it easy to add safety critical UI elements to Qt based safety critical systems. Adding safety critical UI elements, such as telltales or other indicators, is very simple using Qt’s drag-and-drop visual design tools. Qt even comes with a comprehensive set of ISO standard icons for warnings and other indicators, all readily accessible from the visual design tool. The visual design tool integration allows modifications to the safety critical UI elements without needing to change any of the certified software components.

Qt Safe Renderer Design Tool

Image 1: Adding safety critical visual elements to a Qt application is convenient with the provided visual design tools.

ISO Icon Browser

Image 2: Qt provides a wide selection of ISO standard warning and other icons and a convenient tool to use these in the Qt application.

After you have added the safety critical UI elements to the application, it is time to build. A new tool extracts the safety critical UI elements from the UI providing the layout and images of the safety critical parts to the safety certified renderer component. The tool also removes the safety critical parts from the main Qt UI. When the system is running, no matter what happens in the main UI, the safe rendering system ensures that the safety critical parts continue to operate uninterrupted.

safe_pic_3

Image 3: A digital instrument cluster leveraging Qt Safe Renderer can be certified according to ISO 26262 ASIL B.

With Qt and the Qt Safe Renderer it is possible to create many different kinds of certified systems. While our initial focus is on automotive digital cockpits this solution is also applicable to medical and industrial automation systems. ISO 26262, IEC 61508 or IEC 62304 are some of the applicable standards that we are working to certify the new Qt Safe Renderer for.

Qt Safe Renderer works with Qt 5.9 and Creator 4.3, or later versions. For the target RTOS we are supporting INTEGRITY and QNX. On the silicon side we are supporting the NXP iMX6 and NVIDIA Tegra X1 with plans to to add support for Qualcomm Snapdragon 820 and Renesas H3. We can support alternative RTOS and processors on an as needed basis.

The Qt Safe Renderer and related tooling will become available as an add-on to the commercially licensed Qt.

Contact us to learn more and discuss your safety related needs in more detail.

The post Functional Safety with the Qt Safe Renderer appeared first on Qt Blog.

Built with Qt: Episode I – Feeding Automation

We create #BuiltwithQt cases so that people who are new to Qt can get an idea of what Qt is used for and for people who already know Qt to see what is possible. In the past 12 months, we have created a lot of videos — not only customer cases, but talks and demos from events.

The automation industry spans from home & building through to service & industrial automation and even scales up to ship automation. Qt is being used in everywhere within the automation industry and there are a wide range of customers such as M2I, Ulstein and CELOS who are using Qt. Automation is catching fire and here are some additional examples of companies using Qt in the automation space that may entice your interest.

Let’s indulge:

LG Electronics, is a leader in smart kitchen appliances as well as consumer electronics, and recently showcased their Alexa-running smart refrigerator built with Qt and using WebOS, which is also the OS they are using in their Smart TVs.

smart-home

N&W Global Vending is a worldwide leader in manufacturing specialized food and beverage vending machines using Qt, NXP i.MX6 and Witekio services to brew a perfect hot beverage of your choice. You can even check the weather and see a Twitter feed on the machine’s HMI while you are waiting for your coffee — a need I did not know I had.

CELOS simplified machine automation with a network process for consistent management, documentation and visualization of an order, process and machine data–all built with Qt. Operational automation, energy saving, ERP/POS systems? No problem.

Qt is truly everywhere and we’ll be at the NRA Show 2017 booth #6875 showcasing what’s possible with Qt Quick Controls 2  with Venture/Vest! Join us and contact us to learn more.

 

 

The post Built with Qt: Episode I – Feeding Automation appeared first on Qt Blog.

Training in Foss Compliance

On June 23rd 2017, there’s a new, one day training in our Berlin facility, this time in German.

Training in FOSS Compliance will be available, in English, in Berlin and other locations later this year. More on that below, in English. Meanwhile, since our first open-enrolment training to help you with the complex issues around compliance is in German…….

Der Begriff Corporate Compliance ist seit einigen Jahren in den Fokus der Öffentlichkeit gerückt, aber wenige Unternehmen wissen bislang um die

The post Training in Foss Compliance appeared first on KDAB.

INTEGRITY RTOS Support in Qt 5.9 LTS

I am pleased to confirm that Qt 5.9 LTS officially supports the INTEGRITY Real-Time Operating System (RTOS) from Green Hills Software. INTEGRITY was initially supported with Qt 4.8 and will again be supported from Qt 5.9 onwards. The interest in running Qt on INTEGRITY has been customer driven, primarily from Automotive for use in safety certified Instrument Clusters, but also from other industry sectors.

One might ask why is it important to support INTEGRITY for Qt? Why is the leading cross-platform application and UI framework needed in RTOS applications? Aren’t these the ones so deeply buried into our infrastructure, that you almost never notice when you come across one? Well, yes and no. It is true that most of the RTOS applications are still done without any UI, let alone a fancy and interactive graphical user interface. But the number of those RTOS applications that require an advanced GUI framework to meet the user expectation is growing fast, along with the demand to run Qt on an RTOS that provides high degree of safety and security. Other embedded operating systems, such as embedded Linux, are not sufficient when it comes to their real-time capability, reliability, security and certified operations essential for certain industries such as automotive, medical, aerospace and industrial automation.

Qt 5.9 LTS for INTEGRITY is covered by our excellent technical support for all existing Qt for INTEGRITY license holders. All the most important modules are available, for example: Qt Core, Qt Network, Qt GUI, Qt Quick, Qt Qml, Qt Quick Controls 2 and Qt 3D. Initially we are supporting NXP i.MX6 and NVIDIA Tegra X1 hardware. Other hardware, such as Intel Apollo Lake can also be used, and we intend to continue adding support for new hardware with subsequent Qt releases. The following video shows Qt 5.9 LTS based digital instrument cluster running on top of INTEGRITY RTOS with NXP i.MX6 and NVIDIA Tegra X1.

Leveraging the Qt framework with INTEGRITY RTOS enables an easy way of adding state-of-the-art graphical user interfaces to security and safety critical systems. It is easier to certify the product to comply with the requirements of for example the automotive or medical industries when the solution is built on top of an RTOS that is already certified for that industry domain. We see many industries, for example medical, automotive, industrial automation, aerospace and defense, directly benefiting from now being able to leverage Qt for INTEGRITY. The in-built capabilities of the INTEGRITY RTOS platform allow the Qt framework to run in such a way that it does not interfere with the real-time operation of the system. This simplifies creation of safety critical systems and enables certifying the Qt based system to standards for functional safety such as IEC 61508, ISO 26262 and IEC 62304.

Green Hills INTEGRITY is not only a certified RTOS, but also provides a real-time hypervisor, INTEGRITY Multivisor, allowing guest OSes such as Linux to run on the same SoC as the safety critical RTOS. This simplifies building complex systems such as digital cockpits. The following video shows Qt Automotive Suite running on top of Linux as well as a Qt-based instrument cluster running on the INTEGRITY RTOS – both on the same Intel Apollo Lake SoC leveraging INTEGRITY secure virtualisation.

If you have not yet considered leveraging Qt for your next safety-critical project, I recommend taking a deeper look. Our sales, consultants and support are available to guide you through the evaluation process. If you have any questions, we are very happy to discuss more on how Qt meets the needs of your next product – please contact us.

The post INTEGRITY RTOS Support in Qt 5.9 LTS appeared first on Qt Blog.

Fixing a flaky test – how hard can it be?

Flaky tests are a pain point for any reasonable continuous integration system. And by flaky I refer to tests that sometimes pass and sometimes fail. Lately I’ve been bothered by a lack of data and metrics when it comes to discussions around the topic of flaky tests (it pops up regularly on the Qt development mailing list). It’s a hot topic because it influences our productivity, many randomly failing tests slow everyone down.

Metrics

While we worked a lot on our testing infrastructure, a good way of gathering metrics was lacking. For a while we tried building a custom website, but it wasn’t really maintained, so it slowly died.
For a completely unrelated project, I started running influxdb and grafana on a server. Yes, that’s Qt’s new and shiny benchmark metrics infrastructure. I recently gained some experience with these tools, therefore I decided to log data from Coin.

As a first step logging all failing tests seemed like a good idea. I have a feeling that it has already paid off big time, we now have top lists of flaky and failing tests.

Grafana showing a list of flaky tests

I haven’t done as much C++ work lately as I’d have liked to. And I really felt like spending a bit of time on fixing one or two issues. Where to start? I picked the top candidate off of the list of failing tests. Most often failing and blocking integrations was a test called TouchMouse (written by yours truly, in a past life, and enhanced by others). After looking at the data, it was clear that it was only failing on macOS. Not great for me, my more powerful machine is running Linux. Could I avoid booting up my old, old Mac Mini? My medium old Mac Pro had just died and replacement is still on its way…

Picking up the TouchMouse Test

Let’s open the test’s cpp file to get a feel for the test:

...
// ------------------------- Mouse move to mouseArea1
QTest::mouseMove(window.data(), p1);

QVERIFY(enterSpy1.count() == 1);
QVERIFY(mouseArea1->hovered());
QVERIFY(!mouseArea2->hovered());

// ------------------------- Touch click on mouseArea1
QTest::touchEvent(window.data(), device).press(0, p1, window.data());

QCOMPARE(enterSpy1.count(), 1);
QCOMPARE(enterSpy2.count(), 0);
QVERIFY(mouseArea1->pressed());
QVERIFY(mouseArea1->hovered());
QVERIFY(!mouseArea2->hovered());

QTest::touchEvent(window.data(), device).release(0, p1, window.data());
QVERIFY(clickSpy1.count() == 1);
QVERIFY(mouseArea1->hovered());
QVERIFY(!mouseArea2->hovered());

// ------------------------- Touch click on mouseArea2
if (QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0)
    QSKIP("hover can be momentarily inconsistent on X11, depending on timing of flushFrameSynchronousEvents with touch and mouse movements (QTBUG-55350)");

QTest::touchEvent(window.data(), device).press(0, p2, window.data());

QVERIFY(mouseArea1->hovered());
QVERIFY(mouseArea2->hovered());
QVERIFY(mouseArea2->pressed());
QCOMPARE(enterSpy1.count(), 1);
QCOMPARE(enterSpy2.count(), 1);

QTest::touchEvent(window.data(), device).release(0, p2, window.data());

QVERIFY(clickSpy2.count() == 1);
QVERIFY(mouseArea1->hovered());
QVERIFY(!mouseArea2->hovered());
QCOMPARE(exitSpy1.count(), 0);
QCOMPARE(exitSpy2.count(), 1);
...

Did you spot it too? Yeah, we skip the test on xcb… now what happens if I comment that out? Let’s run it on Linux for the fun of it.

In the past year I switched to fish as my main shell, that allows me to write while and for loops, without having to read the manual. I never managed to just write them when using bash, but now we’re really getting side-tracked…

set i 0; while
    ./tst_touchmouse hoverEnabled
    set i (math $i+1)
    echo $i
end

is how I run the test in a loop with a nice counter. Good luck getting out of there, pressing ctrl-c at random intervals helps eventually. And wow, the issue can be reproduced immediately (after removing the QSKIP which simply ends the test otherwise).

Understanding the issue

Glancing at the code in QQuickMouseArea, I saw that we have logging code in there, so I opened ~/.config/QtProject/qtlogging.ini and added:

[Rules]
qt.quick.hover.trace=true

Logging for the win! There were three scenarios (see the bug report for details). Sometimes the first MouseArea would get “unhovered”, sometimes not.
I got a nice backtrace by cheating a bit: the extra “unhover” event was in mouse area 1… if only I could break when that happens… I’m weak at writing conditional breakpoints. Let me add a small snippet that will help breaking in the right place in QQuickMouseArea’s code instead:

void QQuickMouseArea::setHovered(bool h)
{
...
    if (objectName() == "mouseArea1" && !h) {
        // break point here
        qDebug() << "mouseArea1 got unhovered";
    }
...
}

Do not forget to set the objectName in QML, otherwise this won’t work. And observe that flushFrameSynchronousEvents runs at regular but indeterministic intervals. Uhhh… that could explain the flakyness. Re-run and see different traces. And for good measure, add one more debug line into QQuickWindowPrivate::flushFrameSynchronousEvents.

...
if (!q->mouseGrabberItem() && !lastMousePosition.isNull() && dirtyItemList) {
    bool accepted = false;
    bool delivered = deliverHoverEvent(contentItem, lastMousePosition, lastMousePosition, QGuiApplication::keyboardModifiers(), 0, accepted);
    if (!delivered)
        clearHover(); // take care of any exits
    qDebug() << Q_FUNC_INFO << "delivered artificial hover: " << delivered << lastMousePosition;
}

We see who’s making this test non-deterministic. Let’s check if there’s a bug report for this… JIRA instantly shows QTBUG-55350 as first hit when I copy “hoverEnabled” into the search field. Suddenly the day was over and I had other business to mind.

Fixing the flaky test

Scene cut; next morning. After breakfast and walking to work while it was snowing (on the 10th of May), it’s back to debugging.
I had the idea that I could comment out some of the test verification and see if everything else is in order. To my dismay, I quickly saw, that something was still off. The second mouse area in the test would suddenly receive hover events after a touch release. This didn’t make sense because we never move the mouse there. Therefore the hover event must be triggered by a touch event. But after a touch release?

At this point, it was fairly easy to spot. The code that sends “pretend” hover events was doing something funny: sending a hover event after a touch release (through flushFrameSynchronousEvents, thus randomly timing dependent). Resetting the variable that keeps track of the last mouse position fixed the problem. That way no more fake events for touch releases are delivered. Suddenly the test completely worked and also on Linux/XCB where it was skipped before. More test coverage enabled and one bug down left a happy developer.
The patch went in and we should have the worst offender removed. I can’t wait to see how the metrics develop over time. I’m sure there’ll be something else coming up again. But now we have metrics to battle it 😉

The post Fixing a flaky test – how hard can it be? appeared first on Qt Blog.

Introducing Long Term Support for Qt 5.9

We are pleased to announce that Qt 5.9 will be a Long Term Supported (LTS) release. We have done a lot of improvements to Qt since the previous, Qt 5.6 LTS, and to maximize the benefits for our users we will make Qt 5.9 an LTS release. There will be several Qt 5.9.x patch level releases created during the next three years – also after the next Qt 5.x releases become available. Commercial licensees eligible for technical support will also be able to submit support requests during the whole LTS period.

Since the release of Qt 5.6, our previous LTS release, a huge amount of improvements has been added to Qt. We have done significant work on improving performance, added multiple important new features, and fixed thousands of bugs. Qt 5.9 LTS is a fantastic product that offers substantial improvements over Qt 5.6 LTS. To make it possible for all our users to benefit from these, we will be providing Long Term Support for Qt 5.9.

As with Qt 5.6 LTS, we will be using a phased approach to content in patch level releases for Qt 5.9 LTS. During the first 6 months after release day, an LTS release receives a lot of fixes, including low-priority ones. Then the LTS release enters a ‘strict’ phase where only critical bugs and security issues are addressed. This will ensure the stability of the LTS releases. During the final year of an LTS release the commit policy is ‘very strict’, at which phase we only address severe security issues.

For all new projects, we strongly recommend using Qt 5.9 LTS. The upcoming Qt 5.9 LTS will be supported alongside with the earlier Qt 5.6 LTS release, which still allows the use of the old C++98 compilers. As already noted above, Qt 5.9 LTS offers lots of performance improvements as well as a vast amount of other improvements and bug fixes that are not included into Qt 5.6 LTS. Currently, Qt 5.6 LTS is in the ‘strict’ phase where it only receives selected critical fixes and next it is moving into the ‘very strict’ phase. During this final phase, Qt 5.6 LTS will receive important security fixes only.

According to our LTS promise, we guarantee that Qt 5.9 LTS will be supported for three years via standard support, after which additional extended support can be purchased. During this time, even though following Qt releases (5.10 onwards) are already out, Qt 5.9 LTS will receive patch releases providing bug fixes and security updates. For an LTS release, the amount of patch releases will be higher than non-LTS releases of Qt and we aim to provide these throughout the LTS period. In addition to security fixes, error corrections and improvements provided by the LTS patch releases, we may also add support for new operating system and compiler versions to an LTS release of Qt, when feasible. It should be noted that the deprecated modules and technology preview modules are not subject to the LTS.

Qt 5.9 Beta releases are already available via the online installer, check it out if you have not yet done so. If you do not have the Qt online installer yet, please get it from the Qt Account or the Qt downloads page. We are working hard to further fix and polish it with the target of having the Qt 5.9.0 final out around the end of May 2017.

The post Introducing Long Term Support for Qt 5.9 appeared first on Qt Blog.

Cutelyst benchmarks on TechEmpower round 14

The new TechEmpower benchmarks results are finally out, round 14 took almost 6 months to be ready, and while a more frequent testing is desirable this gave us plenty of time to improve things.

Last round a bug was crashing our threaded benchmarks (which wasted time restarting), besides having that bug fixed the most notably changes that improved our performance were:

  • Use of a custom Epoll even dispatcher instead of default glib one (the tests without epoll in it's name are using the default glib)
  • jemalloc, this brought the coolest boost, you just need link to it (or use LD_PRELOAD) and memory allocation magically get's faster (around 20% for the tests)
  • CPU affinity that helps the scheduler to keep each thread/process pinned to a CPU core.
  • SO_REUSEPORT which on Linux helps to get connections evenly distributed among each thread/process
  •  Several code optimizations thanks to perf

I'm very glad with our results, Cutelyst managed to stay with the top performers which really pays off all the hard work, it also provide us with good numbers to show for people interested in.

Check it out https://www.techempower.com/benchmarks/

Ci vediamo alla Italian C++ Conference 2017?

(English speaking? Keep reading!)

Il prossimo Giugno parteciperò all’Italian C++ Conference 2017, la più importante conferenza italiana sul C++, sponsorizzata da KDAB.

L’evento è gratuito e si rivolge tanto ai programmatori esperti di C++ quanto a chi voglia avvicinarsi a questo linguaggio. L’edizione di quest’anno prevede due tracce, di cui una completamente in inglese, con ospiti internazionali d’eccezione: Phil Nash, Jens Weller, Bartosz Milewski e Dietmar Kühl.

L’appuntamento è per Sabato 17 …

The post Ci vediamo alla Italian C++ Conference 2017? appeared first on KDAB.

Corso di Qt/QML per Embedded a Milano, settembre 2017

KDAB è lieta di annunciare una data italiana per il corso Programmazione Qt/QML per sistemi embedded, che si svolgerà a Milano dal 12 al 14 settembre 2017.

Qt è un application framework moderno e ricco di funzionalità, utilizzato per realizzare applicazioni cross-platform per sistemi embedded, mobile e desktop. Qt è usato da oltre 800.000 sviluppatori in tutto il mondo per creare interfacce di domotica e home automation; sistemi di in-vehicle infotainment (IVI); pannelli di controllo industriale; applicazioni desktop …

The post Corso di Qt/QML per Embedded a Milano, settembre 2017 appeared first on KDAB.

WeAreDevelopers Conference App – Open Source & Live Now!

This week, the biggest developers conference in Europe is held in Vienna: the WeAreDevelopers Conference 2017. V-Play is joining this conference and to make the conference even better, we have developed an open-source conference app for it!

You can download it now from the app stores:

itunes_download_link google_play_badge-1

You can also download the app on Github and use the code in your own apps. So you can use this app as the basis for your own conference app. Or just use the source code to learn the best-practices we used in the app:

github_logo

What’s Inside the We Are Developers Conference App

What can you do with the conference app?

  • Browse the conference schedule.
  • See detailed information for all talks and speakers.
  • Manage your personal schedule by adding talks to your favorites.
  • Connect with other conference participants, chat and become friends.
  • Get notified of upcoming favorited sessions with push notifications.
  • Full-text search of all speakers & talks.
  • Get rewards with gamification elements: attend talks & start the app often to get to the leaderboard top.
  • Customize the UI and switch between different native styles and colors.

Here are some screenshots from the app for Android & iOS:

wearedevelopers-androidwearedevelopers-ios

How We Developed the Conference App

We used the Qt World Summit Conference App Template that is part of the V-Play SDK as a basis, which looks like this:

native-navigation-ios-and-android

Having the UI and native look & feel for iOS & Android already in place, we only had some minor tweaks left to finish the app:

  • Get the conference data (talks + speakers list) by scraping the WeAreDevelopers website. This task took actually most of the time. 😉
  • Change the theme of the app to reflect the conference colors & style from the website.
  • Add new content like the venue and about page.
  • Create the app in the V-Play Game Network backend to get access to leaderboards, chat and push notifications (when a new chat message or friend invite is received).
  • Write the app store description & create an app icon.

The whole process from start until publishing in the app stores took about 16 hours.

giphy

You’ll be across the finish line in no time!

Conference App Highlights

These are some of our favorite app features:

Simulate Other Platforms at Runtime

You can change the colors & even simulate another platform within your app! Just browse to the settings screen:
wearedevelopers-settings
You can set the theme to iOS on an Android device and vice versa, which is pretty cool for testing what the app looks like on another platform. During development, this saves a lot of time because you can test how your app looks like on all platforms on your Desktop PC!

Gamification

You get points when you open the app and attend talks. There is a leaderboard with the most active conference attendees, and you can connect with these: by sending friend invites and in-app chat messages. This functionality is available with V-Play Game Network and V-Play Multiplayer and takes less than 50 lines of code to integrate!

So you can use gamification functionality also in your V-Play based apps. Gamification features are retention boosters, that’s why we recommend to add it to “normal apps” too and not only games.

Hidden Gems

Here are some of the smaller app features:

  • When the conference is happening, you will see a “Scroll to Now” button that jumps straight to the correct day & time. Convenient, right? :)
  • You get a push notification 15 minutes before your favorited talk starts. You can also disable these notifications in the settings.
  • Images of the speakers are cached after the first network attempt. On conferences, network connection is usually restricted – with this caching mechanism you can even see the speakers images when your phone is offline.

100% Cross-Platform App: Single Code Base

With a single source code, the app looks native on iOS & Android. This means you get:

  • A navigation drawer on Android & bottom tab navigation
  • On iOS you have a swipe-back gesture to navigate back to the last page, on Android the back button is used
  • Native UI elements like tabs, switches, buttons for each platform
  • Native page push/pop animations for each platform

To get this native look & feel, you don’t need to write any platform-specific code. It’s 100% the same source code for both iOS & Android!

The full source code of the app is only ~2,900 lines of code. The app contains 13 pages/screens, which is an average of just 223 loc per page. Quite an impressive featureset for this little source code, right?! If you wonder why so little code is needed: that’s the power of QML and the V-Play app components. For a detailed app comparison of V-Play with other frameworks like React or Xamarin, see the PropertyCross project here.

Meet Us at the Conference!

If you’re attending WeAreDevelopers Conference 2017 and want to find out more about cross-platform development with V-Play, let us know when you want to meet!

Meet the V-Play Team at WeAreDevelopers 2017!

If you’d like to meet at an after-show event, just contact us here!

 

 

More Posts like This

 

How to Make Cross-Platform Mobile Apps with Qt – V-Play Apps

How to Make a Qt app

Release 2.9.2: Qt World Summit 2016 App Showcase and New App Components

Conference App Cover Image

 

The post WeAreDevelopers Conference App – Open Source & Live Now! appeared first on V-Play Engine.

Qt Creator 4.3 RC1 released

We are happy to announce the release of Qt Creator 4.3 RC1.

Since the Beta release we have kept ourselves busy fixing bugs, so please take this last opportunity to test and give us feedback. Take a look at the Beta release blog post or the more detailed change log for an overview of what has changed in 4.3.

Get Qt Creator 4.3 RC1

The opensource version is available on the Qt download page, and you find commercially licensed packages on the Qt Account Portal. 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.3 RC1 released appeared first on Qt Blog.

KDAB trainings at CppCon 2017

Registrations for CppCon 2017 have just opened!

CppCon is the annual conference for the C++ community: five days packed with amazing talks, inspiring keynotes, panel discussions, hallway chats, funny evening events and much more.

CppCon is a project of the Standard C++ Foundation, a not-for-profit organization whose purpose is to support the C++ software developer community and promote the understanding and use of modern, standard C++ on all compilers and platforms.

This year KDAB is proud to be hosting

The post KDAB trainings at CppCon 2017 appeared first on KDAB.

foss-north 2017 follow-up

On the morning of April 26 I arrived at our venue, preparing for around 120 people to fill the rooms at foss-north 2017.

I’m still in the post-event cleaning up phase, so the visitor questionnaire has not yet been sent out, but the feeling is positive. This year we expanded changed venue and moved from one to two tracks. This led to more administration with two room hosts and double video recordings, so that everyone could see everything. The videos are available online now. You can either find a specific talk from the talks and speakers page, or simply enjoy the entire playlist here:

I’d like to extend a big thank you to everyone who made this possible: Jeena and Johnny helping out recording videos and hosting. All our speakers. Our partners Swedsoft, FSFE and BRG. Our sponsors Semcon, Rebel Alliance, Blackduck Software, Capture Innovation and Qamcom. And all the visitors. Without anyone of these pieces, the puzzle would not come together.

I’m already looking forward to seeing you next year again!

new QtSensor IoT plugins!

I've said it before and I will say it again... one thing I am tired of hearing about, is that people think Qt is only for UI applications.
WRONG!
Qt is great for IoT as well! even without a UI. (IoT is today's buzzword for 'embedded', which really isn't embedded, just small) and you cannot have IoT without sensors!

I just submitted a MR to QtSensors to add support for the SenseHAT sensor board for raspberry pi:

https://codereview.qt-project.org/#/c/193456
For raspberry pi, you will need RTIMULib installed on your rpi (and dev package to compile QtSensors). It's in the default repo, so you don't actually need to compile RTIMULib yourself.

Even though this is submitted for dev branch and should be available in Qt Sensors 5.10, this will compile and work for the Qt 5.3 that comes with the raspbian distribution.

As well, if my spare time allows, I will also get my Matrix Creator QtSensor plugin into shape to submit as well.

I also have planned getting the TI SensorTag code I wrote shoved into a QtSensor plugin. What's special about the SensorTag is that it has (buzzword alert) wireless sensors! This is a bit more tricky as it will use and be dependent on Qt's QLowEnergyService but will work nonetheless. This plugin doesn't run on the device, but requires a host machine which has bluetooth.

Qt from git on the Tinkerboard (with Wayland)

The Asus Tinkerboard is a nice little board for Embedded Linux (or Android, for that matter), based on the Rockchip RK3288 SoC including a quad-core ARM Cortex-A17 CPU and a Mali-T760 MP4 (T764) GPU. Besides being quite powerful, it has the advantage of being available locally in many countries, avoiding the need to import the boards from somewhere else. It has its own spin of Debian, TinkerOS, which is what we are going to use here. This is not the only available OS/distro choice, check for example the forums for other options.

We are going to set up the latest qtbase and qtdeclarative from the dev branch, and, to make things more interesting, we are going to ignore X11 and focus on running Qt applications via eglfs with the DRM/KMS backend. This is fairly new for Qt on Mali-based systems: in the past (for example, on the ODROID-XU3) we have been using the fbdev-based EGL implementation. Additionally, Wayland, including Qt-based compositors, is functional as well.

tinkerboard_1

First Things First

qtbase/dev recently received a patch with a simple device spec for the Tinkerboard. Make sure this is part of the checkout of the qtbase tree you are going to build.

As usual, we are going to cross-compile. The steps are pretty similar to the Raspbian guide in the Wiki. I have been using this TinkerOS 1.8 image as the rootfs. To get a suitable ARM (32-bit) cross-compiler for x64, try this Linaro toolchain.

When it comes to the userspace graphics drivers, I have been using the latest “wayland” variant from the Firefly RK3288 section at the Mali driver page. Now, the TinkerOS image does actually come with some version/variant of the binary drivers in it so this step may or may not be necessary. In any case, to upgrade to this latest release, get malit76xr12p004rel0linux1waylandtar.gz and copy the EGL/GLES/GBM/wayland-egl libraries to /usr/lib/arm-linux-gnueabihf. Watch out to have all symlinks adjusted.

As the final preparation step, let’s disable auto-starting X: systemctl set-default multi-user.target.

Sysroot, Configure, Build

From this point on, the steps to create a sysroot on the host machine and to build qtbase against it are almost completely the same as in the earlier Wiki guides for the RPi. Feel free to skip reading this section if it all looks familiar already.

  • Install some development headers and libraries on the target: sudo apt-get build-dep qt4-x11 libqt5gui5 wayland weston.
  • Create a sysroot on the host:
    mkdir -p ~/tinker/sysroot/usr
    rsync -e ssh avz linaro@...:/lib ~/tinker/sysroot
    rsync -e ssh avz linaro@...:/usr/include ~/tinker/sysroot/usr
    rsync -e ssh avz linaro@...:/usr/lib ~/tinker/sysroot/usr
    

    (NB. this is a massive overkill due to copying plenty of unnecessary stuff from /usr/lib, but will do for now)

  • Make all symlinks relative:
    cd ~/tinker
    wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
    chmod +x sysroot-relativelinks.py
    ./sysroot-relativelinks.py sysroot
    
  • Configure with -device linux-tinkerboard-g++:
    ./configure -release -opengl es2 -nomake examples -nomake tests -opensource -confirm-license -v \
    -device tinkerboard -device-option CROSS_COMPILE=~/tinker/toolchain/bin/arm-linux-gnueabihf- \
    -sysroot ~/tinker/sysroot -prefix /usr/local/qt5 -extprefix ~/tinker/qt5 -hostprefix ~/tinker/qt5-host
    

    Adjust the paths as necessary. Here the destination on the target device will be /usr/local/qt5, the local installation will happen to ~/tinker/qt5 while the host tools (qmake, moc, etc.) go to ~/tinker/qt5-host.

  • Then do make and make install as usual.
  • Then rsync qt5 to /usr/local on the device.

Watch out for the output of configure. The expectation is something like the following, especially when it comes to EGLFS GBM:

EGL .................................... yes
  ...
  OpenGL:
    Desktop OpenGL ....................... no
    OpenGL ES 2.0 ........................ yes
    OpenGL ES 3.0 ........................ yes
  ...
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... yes
  ...
QPA backends:
  ...
  EGLFS .................................. yes
  EGLFS details:
    ...
    EGLFS GBM ............................ yes
    ...
  LinuxFB ................................ yes
  VNC .................................... yes
  ...

Action

Build and deploy additional Qt modules as necessary. At this point QWindow, QWidget and Qt Quick (QML) applications should all be able to run on the device.

Few notes:

  • Set LD_LIBRARY_PATH, if needed. If the Qt build that comes with the system is still there in /usr/lib/arm-linux-gnueabihf, this is pretty much required.
  • When using a mouse, keyboard or touchscreen, make sure the input devices have sufficient permissions.
  • Enable logging by doing export QT_LOGGING_RULES=qt.qpa.*=true.

As proven by the logs shown on startup, applications will use the eglfs_kms backend which is good since it gives us additional configurability as described in docs. The OpenGL ES implementation seems to provide version 3.2 which is excellent as well.

One thing to note is that the performance may suffer by default due to not running at high enough frequency. So if for instance the qopenglwidget example seems to get stuck at 20 FPS after startup, check this forum thread for examples on how to change this.

Wayland

Yes, QtWayland just works. Here is the minimal-qml compositor example with some clients:

tinkerboard_2

One thing to note is that the default egl_platform.h leads to a build failure in qtwayland. To circumvent this, add a cast to EGLNativeWindowType in the problematic eglCreateWindowSurface call.

That’s all for now, have fun with the Tinkerboard!

The post Qt from git on the Tinkerboard (with Wayland) appeared first on Qt Blog.

QStringView Diaries: Masters Of The Overloads

The last blog post in this series described how to use string-views. This post is about how to design one. In particular, it’s about QStringView‘s constructors. They evolved through a rapid succession of changes. These changes either fixed ambiguities between QString and QStringView overloads, or improved performance. And they all have the same solution: std::enable_if, the Swiss Army Knife for overload control.

This post will take you from where we naïvely started to where we made the impossible possible: overloading a function for arrays and pointers.

continue reading

The post QStringView Diaries: Masters Of The Overloads appeared first on KDAB.

Styling Qt Quick Controls with Photoshop (research)

The Qt Quick Controls 2 undoubtedly have a great look and feel out-of-the box. But if the available styles don’t suit your needs, you can customize the look and feel by defining your desired style in QML.

Styling without coding QML?

However, we at Qt are wondering: what if you want to have your Qt Quick Controls 2 to be styled by a graphic designer? A designer certainly masters tools like Photoshop, Illustrator, SketchApp or similar, and may want to use these tools directly for that styling task without coding QML. Also according to Qt users’ feedback, a repeatable workflow involving a design tool and automatic styling of the application would be very appreciated.

Plan to support image based styling

Qt will support such a workflow with an upcoming version of Qt. The effort can be split in two major tasks:

  1. Adding support for image based styling in Qt Quick Controls 2. That feature will scan through a directory of images and apply them to the controls according to a file naming convention like “control-subitem-state.png”.
    The feature implementation is in progress. One nice extra feature worth mentioning is the support of Nine-patch images which are certainly known by Android developers and which are supported by a few tools out there.

  2. Creating “template” style documents first for Photoshop (and then for others) which have the required structure (e.g. special layer names) to export the image elements with the right names. Style designers can take these templates as a starting point. One promising option for exporting is the built-in Asset Exporter of Photoshop, perhaps with custom extensions to it. We are however also considering other options.

Research implementation

In order to try out how such envisioned workflow feels like and in order to get early feedback by Qt users, we implemented the following example project. An included Photoshop document can be used to define the style of a few Controls. The style images get exported by the Asset exporter and land in the resources of the example application. In order to be able to develop this example under Qt 5.8 and 5.9 which do not yet contain image based styling and Nine-patch images, the example includes its custom image style and assumes a fixed border size for the border images.
This means you can clone the example right now from the git repo or download the zipped sources.

We demonstrated the example at the Embedded World 2017 and got quite positive feedback from interested users. A film crew was also there and filmed me performing my demonstration.

The research implementation in pictures

The style in Photoshop
A designer can work with the provided style template and tweak it in order to meet the desired look.

The style in Qt Quick Designer
The Qt Quick Designer tool in the Qt Creator IDE provides a preview of the style while the form is being edited.

targetdevice
The launched application (in this example on an embedded device) is using the style.

Items left to be researched…

  1. Some styling data like font faces, text colors, etc. should also be possible to be defined in the design tool and be exported as metadata in conjunction with the image files. In the case of Photoshop, there are a few options to achieve we have in mind. We still need to evaluate these options.

  2. How to generate Nine-patch images. Also here, we see a few options worth to be tried out.

What do you think of the plan? Please leave a comment below to let us know 🙂 Thank you for reading.

The post Styling Qt Quick Controls with Photoshop (research) appeared first on Qt Blog.

Qt World Summit 2017 Call for Presentations

QtWS17 CfPBuild for Tomorrow – Deliver Today

The Qt World Summit 2017 in Berlin, Germany this October is where the Qt community comes together from all around the world. This year, the theme of the event is “Build for Tomorrow – Deliver Today”.

The Call for Presentations is Now Open!

However please read through this guide before running off to submit your presentation.

Key Dates

  • The call is open now!
  • The call will close on 30.5.2017.
  • The authors of accepted topics will be informed in early June.
  • The list of accepted topics will be publicly available in mid June.
  • Full presentations / slide submissions must be made by 15.9.2017

Themes and Focus areas

As the theme for Qt World Summit 2017 suggests, the focus of the event will be on the future of software. Recently, Qt received a significant contribution from NVIDIA, and the Qt3D module has seen a lot of improvement. In line with this, we are emphasizing 3D graphics and user interfaces as one main area in our call for presentations.

In the past year Qt has seen strong growth in the automotive segment and embedded devices overall. We are also looking for presentations that dive into all the phases of an embedded devices’ life-cycle, and we would like to hear your views on how Qt is a part of the innovation happening across a variety of industries.

Qt is a cross platform framework, we are also excited about what you have to say about application development, a strong area for Qt. The tooling and SDK in Qt has always been an important part of our story, so that is included in the call.

Software ecosystems are still an important trend in development. Qt can be used to enable your ecosystem or as part of your SDK.

In addition, other areas of interest include automation systems, medical systems and multi-screen applications.

To summarize the above, we are calling for presentations on:

  • Future of software with Qt
  • 3D User interfaces and Graphics, including AR and VR
  • Automotive solutions
  • Application development and Qt enabling application ecosystems
  • Tools, methods and processes for the embedded device life-cycle
  • Automation systems

Did we miss something? The latest advancements and improvements in Qt are also welcome as always. You can also submit presentations on any topic related to Qt.

Business track

This year we will be hosting a business track, with presentations that demonstrate the business aspects of Qt in software development.

  • Cases and examples of Qt in use
  • Time to market
  • Software life-cycle
  • Development team setup and composition
  • Ecosystems from the business aspect

Program committee and selection criteria

The Program committee includes members from The Qt Company and Qt Partners. The committee will review all submissions and jointly select presentations for the Qt World Summit.

There are many ways to write an abstract, but here are some tips for an easy to read, easy to understand abstract that is sure to win a slot on the Qt World Summit agenda:

  • Show a clear intent and purpose
  • Make clear what the value to the intended audience is
  • Keep in mind the summit’s themes and focus
  • Offer something unique and unexpected, yet relevant is to the event’s focus areas

The committee will make their decision based on the outlined themes of the event. The committee will also make sure that the selected presentations support a varied and overall diverse spectrum of interesting presentations – both in terms of technical level and focus areas to provide value for event participants.

Session Length

You may propose either a 25 or 50 minute session.

Audience

Topics should be of interest to all attendees. The Qt World Summit attracts people from all corners of the Qt community. This year, we can expect technology directors, developers and engineers, as well as business decision makers, product and project managers will be attending the event.

Speaker Benefits

As a speaker, you will receive a Free Access -pass to the Qt World Summit. This is a great opportunity to spread your mindshare and have a community of industry leaders and important software developers hear your message. We will be recording the presentations; speaking at the Qt World Summit will give you an audience that goes beyond the crowd attending your presentation in Berlin. The material from your talk will also be made available to all of the attendees after the event.

We will share your contact and professional details on the Qt World Summit web pages, giving you a large platform to network with anyone interested in your expertise and/or offering.

Submit Your Talk Today!

https://www.surveymonkey.com/r/QtWS17

For more information of if you have any questions, please contact qtws@qt.io.

The post Qt World Summit 2017 Call for Presentations appeared first on Qt Blog.

Performance regression testing of Qt Quick

by Eskil Abrahamsen Blomfeldt (Qt Blog)

We recently added a new toy to The Qt Project, and I wanted to give an overview on what it is and how it can be used.

Grafana showing results of running benchmarks

Grafana showing results of running benchmarks

qmlbench testing

The new toy is automated performance testing, and the background (long story short) is that in order to avoid regressions in performance, automated testing is required. This is no different from avoiding regressions in functionality, and it may sound obvious. But while we have many benchmarks in Qt, we have unfortunately only been running them manually, and, as a result, regressions have snuck into the released product from time to time.

This year, The Qt Company decided to invest into fixing the problem, and I was given the task to set up performance testing of Qt Quick and the scene graph. The plan is to add benchmarks for all areas of Qt to the same system, but in order to get the infrastructure in place first, we decided to use Qt Quick as the pilot project.

I decided to go with the tool that Robin Burchell and Gunnar Sletta wrote for this, recently contributed to The Qt Project: qmlbench.

The tool is designed to measure the performance of Qt Quick primitives and functionality, and it has a suite of QML files that are intended for automated testing.

To be able to see how performance evolves over time and to detect even smaller regressions, we decided to go with a graph approach that we manually monitor for changes. While we are still working to reduce it as much as possible, there will always be a bit of noise and fluctuation in the benchmarks, due to the hardware and operating systems themselves not being 100% predictable.

The resulting graphs can be seen in testresults.qt.io.

And the news are good: Qt 5.9 is a great improvement on Qt 5.6 (I expect around 15% on average when it is released) and the tool has already detected performance regressions which we have subsequently fixed. Lets go into some more detail.

How to use the UI

When you first look at the page linked above, there will be a lot of information at once, but luckily it is easy to change the view to only show what you are interested in.

Say for instance that I only want to see the results of a single benchmark, e.g. “changing_over_isolated_with_clip_rotated”. I can do that by using the “benchmark” selector in the top left corner.

select benchmark

In the same row, you can also select which machine you want to see results for. The currently available ones are “eskil_linux_foucault”, which is a Ubuntu desktop machine with an NVIDIA Quadro graphics card, and “eskil_linux_tx1” which is an arm-based NVIDIA Jetson TX1, also running Ubuntu.

In the view of the graphs themselves, you can turn on and off data sources by clicking on the labels (hold shift to select multiple). By default, you will see the benchmark results and the coefficient of variation for each branch. On desktop, it is currently running for 5.6, 5.8, 5.9, dev and v5.8.0. The last one is there as a control, to be able to exclude changes to qmlbench itself as well as OS and hardware related issues. On the TX1, we are only running for 5.6 and 5.9 at the moment, given the time it takes for a single test run on that hardware.

selectsources

In the screenshot above, I have disabled everything except the 5.6 and 5.9 benchmark results.

Finally: In the top right corner, you can select the time resolution of the current view. You can also zoom in on an area of a graph by clicking and dragging over the area. All the different tables and graphs will adapt automatically to the currently selected time interval.

This was just a very quick overview of Grafana. Consult the full documentation for more information.

How to use the graphs

The main way to use the graphs is to monitor them and look for changes that persist over time. Note that higher is better for these benchmarks, as they are counting how many frames can be drawn during a predefined time period (20 seconds) for a predefined test size. There is also a table that shows the median in the current interval, for an easy way to compare branches and detect regressions/improvements.

Also note that the rendering caps at 60 fps, so the maximum result we can get is 1200 frames per 20 seconds. So graphs will cap at this level and we will not get much useful information from them before we increase the complexity of the scenes they are rendering.

In addition to the performance data, you also have access to the “coefficient of variation” for each test run. The scale of the CoV is on the right side of the graph view. When running the benchmark, we will do five runs in sequence and report the average of this to the database. This is to avoid always running on cold data and it decreases the fluctuations in the graphs. The CoV is based on the standard deviation of these datasets of five results. It can give you an idea of the stability of the test results, though there are some very stable test that still report a high CoV, such as the “sum10k.qml” test. For some reason which we have yet to figure out, the first run will always be around 230 frames on that particular machine and then all the subsequent runs will be 440. So the average is stable, but the CoV is through the roof. Since this is not reproducible anywhere else, Robin suggested the machine is haunted, which is so far our best guess.

If you look at each of the graphs, you will see that for most of them the “5.9” line is above the “5.6” line, which is good, since it means performance is improving. On average, I expect that Qt 5.9 will give approximately 15% better performance than Qt 5.6. If you look specifically at any of the layout tests, you will see that you can get around 50% performance improvement on your Qt Quick layouts just by upgrading to Qt 5.9 from Qt 5.6.

Graphs showing 53% performance improvement on creation of column layouts.

Graphs showing 53% performance improvement on creation of column layouts in Qt 5.9 compared to Qt 5.6.

The main objective of having this tool, however, is to detect and fix regressions, and there was one test that worried us: the “changing_over_isolated_with_clip_rotated” test case.

This test verifies that we can isolate a subtree in the scene graph by using a clip node even if the clip is rotated, so that it is put into its own batch in the renderer. Thus changing it does not affect the other parts of the scene graph. If you look at the graph in Grafana, you will see that until very recently, we had a significant regression in that area. On April 25th, the regression was fixed, so it will never be released to users.

changing_over_isolated_with_clip_rotated

Now, if I saw this graph and wanted to find out what happened, there is another helpful tool which I haven’t yet talked about. You can enable it by checking the “annotations” checkbox on the top of the page. This will show, as events in the graphs, the SHA1s for the different modules we are testing at any given time. Note that this is still a bit of a work in progress: To avoid cluttering the graphs too much, we are only reporting the SHA1s for the eskil_linux_foucault machine. If there are several events at the same time, you will also have to zoom in a bit to be able to separate them. So the UI isn’t perfect, but it works when you need to dig for information.

If I do zoom in on the first result where performance has been improved, I will see that one of the updates was to Qt Declarative. I can hover over the event to see the SHA1 of the update.

annotation

By going to the git repository, I can easily find the diff between the two commits listed. If I do, I will see that one of them is Fix a performance regression noted by qmlbench by Robin Burchell.

So the system is working. If regressions pop up while the tool is running, we will be able to find the offending commit just as easily.

The future

What’s next you ask? We will of course continue to improve the qmlbench test set as well as the tool itself. We may also add more platforms to the farm when the need arises.

In addition, there are several other people in The Qt Company who are working on getting benchmarks for other parts of Qt into the same system. In the time to come, we will get unit benchmarks for different parts of Qt, startup time measurements, Qt Creator performance testing, QML engine testing, etc. into the same system. Look for updates here and on the main benchmark home page.

The post Performance regression testing of Qt Quick appeared first on Qt Blog.

Cutelyst 1.6.0 released, to infinity and beyond!

Once 1.5.0 was release I thought the next release would be a small one, it started with a bunch of bug fixes, Simon Wilper made a contribution to Utils::Sql, basically when things get out to production you find bugs, so there were tons of fixes to WSGI module.

Then TechEmpower benchmarks first preview for round 14 came out, Cutelyst performance was great, so I was planning to release 1.6.0 as it was but second preview fixed a bug that Cutelyst results were scaled up, so our performance was worse than on round 13, and that didn't make sense since now it had jemalloc and a few other improvements.

Actually the results on the 40+HT core server were close to the one I did locally with a single thread.

Looking at the machine state it was clear that only a few (9) workers were running at the same time, I then decided to create an experimental connection balancer for threads. Basically the main thread accepts incoming connections and evenly pass them to each thread, this of course puts a new bottleneck on the main thread. Once the code was ready which end up improving other parts of WSGI I became aware of SO_REUSEPORT.

The socket option reuse port is available on Linux >3.9, and different from BSD it implements a simple load balancer. This obsoleted my thread balancer but it still useful on !Linux. This option is also nicer since it works for process as well.

With 80 cores there's still the change that the OS scheduler put most of your threads on the same cores, and maybe even move them when under load. So an option for setting a CPU affinity was also added, this allows for each work be pinned to one or more cores evenly. It uses the same logic as uwsgi.

Now that WSGI module supported all these features preview 3 of benchmarks came out and the results where still terrible... further investigation revealed that a variable supposed to be set with CPU core count was set to 8 instead of 80. I'm sure all this work did improve performance for servers with a lots of cores so in the end the wrong interpretation was good after all :)

Preview 4 came out and we are back to the top, I'll do another post once it's final.

Code name "to infinity and beyond" came to head due scalability options it got :D

Last but not least I did my best to get rid of doxygen missing documentation warnings.

Have fun https://github.com/cutelyst/cutelyst/archive/v1.6.0.tar.gz