Qt on Android: How to use Android Toast

To get you started on this, we’ll be using KDAB’s Android utils with the humble Toast.
Toasts are small popups which are used to show the user some feedback. Check Google’s API guide for more info about toasts.

The easiest way to show a toast is to use Toast.makeText(Context context, CharSequence text, int duration) static method.
This method needs 3 params:

  • the context (we’ll use the activity)
  • the text to show
  • and the duration: one of LENGTH_SHORT (0) and LENGTH_LONG (1).

Then we just need to call the show method.

Of course all the calls MUST happen on the Android UI thread.

As usual we’re going to make use (abuse) of QtAndroidExtras and KDAB’s Android utils (check this article to see how to add them to your project).

Let’s create a simple function to show the toast:


enum Duration {
    SHORT = 0,
    LONG = 1
};

void showToast(const QString &message, Duration duration = LONG) {
    // all the magic must happen on Android UI thread
    KDAB::Android::runOnAndroidThread([message, duration] {
        QAndroidJniObject javaString = QAndroidJniObject::fromString(message);
        QAndroidJniObject toast = QAndroidJniObject::callStaticObjectMethod("android/widget/Toast", "makeText",
                                                                            "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;",
                                                                            QtAndroid::androidActivity().object(),
                                                                            javaString.object(),
                                                                            jint(duration));
        toast.callMethod<void>("show");
    });
}


Yep, it’s that simple!
Now let’s take a closer look at the code:
  • We’re using KDAB::Android::runOnAndroidThread to run everything on the Android UI thread.
  • We’re capturing message and duration params as values not as references, because as we’ve seen in a previous article KDAB::Android::runOnAndroidThread is (most of the time) asynchronous.
  • We’re using QAndroidJniObject::fromString to convert a QString to a QAndroidJniObject string object.
  • We’re using QAndroidJniObject::callStaticObjectMethod to call the makeText static method that returns a Toast java object. We need to pass the following parameters:
    • “android/widget/Toast” is the fully qualified class name.
    • “makeText” is the static method name
    • “(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;” – is the method signature. The method returns Landroid/widget/Toast; object and expects 3 arguments:
      • Landroid/content/Context; – a Content object
      • Ljava/lang/CharSequence; – a CharSequence object
      • I – an int
    • QtAndroid::androidActivity().object(), javaString.object(), jint(duration) are the makeText arguments.
  • after we get the toast object, we call show method and we’re done.


Enjoy!

showToast(QLatin1String("Hello from Qt"));


The post Qt on Android: How to use Android Toast appeared first on KDAB.

KDAB Training Day at QtCon

Berlin, September 1-4

KDAB is offering eight fantastic trainings at QtCon, each for just €250 a day, so incredibly good value.
Here’s what you can choose from, including three completely new courses:

  1. Introduction to Qt 3D – with Dr Sean Harmer
  2. Basic and Modern CMake – with Andreas Hartmetz
  3. Beyond code – Improved Quality through User Centric Development – with Björn Balazs
  4. Debugging and Profiling Qt applications – with Milian Wolff
  5. Introduction to QML – also known as Qt Quick – with Kevin Funk and Jesper Pedersen
  6. What’s new in C++11/C++14 – with Thomas McGuire
  7. Introduction to Modern OpenGL with Qt – with Giuseppe D’Angelo
  8. Introduction to Testing Qt applications with Squish – with Florian Turck

Abstracts

1. Introduction to Qt 3D – Dr Sean Harmer

Target Audience: Developers or Managers wishing to get an idea of what Qt 3D is about and learn how to make some attractive applications with 3D content in the process.

Prerequisite: A basic understanding of QML would be useful. No prior OpenGL or 3D experience is required.

Qt 5.7 introduces the powerful new Qt 3D module that can be used to integrate 3D content into your Qt applications using C++ or QML. In fact, Qt 3D provides an extensible framework for soft realtime simulations, of which rendering is just one aspect. This 1 day training will introduce you to Qt 3D’s features and APIs, show what you can achieve with them, and how Qt 3D can be extended by the user and by the Qt 3D authors in the future.

Along the way we will introduce the Qt 3D renderer and input systems and how they are built on top of a flexible, highly threaded, Entity Component System (ECS) architecture that scales very well and is ripe for future additions. You will learn:

  • How to construct a basic Qt 3D application
  • About Transform hierarchies and Entities and Components ot make a scene graph
  • How to display 3D graphical content using geometry, materials, textures
  • How Qt 3D maps onto the graphics pipeline
  • How to extend Qt 3D to use your own custom geometry
  • How to write custom materials and shaders
  • How to completely control the Qt 3D renderer dynamically at runtime using the Frame Graph
  • How to integrate Qt 3D with Qt Quick to provide a 2D user interface
  • How to handle advanced input with Qt 3D
  • Future plans for Qt 3D and how to extend it yourself

About the presenter

Dr. Sean Harmer
Senior Software Engineer at KDAB. Sean has been developing with C++ and Qt since 1998. and in a commercial setting since 2002. He holds a PhD in Astrophysics along with a Masters in Mathematics and Astrophysics. Sean has a broad range of experience and is keenly interested in scientific visualization and animation using Qt and OpenGL. 


2. Basic and modern CMake – Andreas Hartmetz

Target Audience: C and C++ Developers

Prerequisite: Experience with build systems
(well I guess – otherwise trainees will not know what problems even need
solving, so they won’t understand what the solutions are good for)

The best thing a build system can do is not get into the way.

CMake is the de facto standard build system for C and C++ outside of frameworks that require their own. It has earned this place by supporting the situations and special cases that arise in real projects.
CMake even has strong support for building Qt applications, and it’s a good alternative if you hit limitations in qmake.

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

About the presenter

To follow


3 . Beyond code – Improved Quality through User Centric Development – Björn Balazs

Target Audience: Developer, Development Lead, Product Manager, Manager, Decision Maker interested in learning how users can be involved to boost a products’ success

Prerequisite: Being part of a product development team

Users ultimately decide about the success of your product – at the latest when they are supposed to use it. But, fear not: With this training we provide you with strategies for turning your users into allies early in the development process. These strategies will not only lead to better customer satisfaction, but also help to improve the development process itself.

Wondering how your product can benefit from the ideas behind Usability, User Centered Development, Design Thinking or Interaction Design?

With this introductory training you will not only understand the theory, but you will also take away tools and strategies you can directly introduce to your product development team back home. We will of course put a special focus on the challenges and opportunities that developing with Qt & QtQuick Technologies bring to the process.

Some Topics covered:

  • ISO 9241-210 or What is a User Centered Development Process?
  • Personas: Making Users actionable in the Development Process
  • What do users want? Getting User Feedback right.
  • Usability Testing: Guerilla vs. The Laboratory
  • Prototyping and How Qt can help.

About the presenter

Björn Balazs
Björn is a Senior Experience Engineer at KDAB in Berlin. He has specialized in Usability and User Experience since 1999 and holds a Diploma in Psychology. A longtime member of the KDE visual design group, Björn has worked for many free software projects. For the past ten years, he has regularly given trainings on user-centric development. Languages: German, English.


4. Debugging and Profiling Qt development – Milian Wolff

Target audience: Developers who want to find and fix problems

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

This training gives an introduction to various tools, which help developers and testers in finding bugs and performance issues.

The tools presented cover a wide range of problems, from general purpose debugging and CPU profiling to Qt specific high-level analyzers. Often, it is relatively simple to run a tool, but interpreting the results, or even just using some of the more advanced tools, requires deep technical knowledge.
The most important tools on all major platforms that Qt supports, i.e. Linux, Windows, Mac OSX, iOS and Android, will be covered:

Debugging:

  • General purpose debuggers: GDB, LLDB, Windows debugging tools
  • Memory error detectors: valgrind’s memcheck, Dr memory, AddressSanitizer
  • OpenGL: apitrace
  • Various Qt built-in features for logging, QML
  • GammaRay to investigate internals of Qt Applications

Profiling:

  • CPU: valgrinds’s callgrind, Linux perf, Intel VTune Amplifier, Instruments, Visual Studio
  • Heap memory: valgrind’s massif, heaptrack, Instruments, Visual Studio
  • OpenGL: apitrace, NVidia nSight, AMD CodeXL, Vivante vProfile

Testing:

  • Qt TestLib: unit tests and benchmarks
  • Static code analysis
  • Code coverage

About the presenter

Milian Wolff
Software engineer at KDAB’s Berlin office, Milian has a special interest in tooling and profiling. He created the Massif-Visualizer and heaptrack, which are now used regularly to improve the performance of both C++ and Qt applications. These days, Milian applies this knowledge to improve code base performance for KDAB’s customers. He is the co-maintainer of the KDevelop IDE and in 2015 won their Akademy Award for his ongoing work there. He has a Masters Degree in Physics. Languages: English, German.


5. Introduction to QML – also known as Qt Quick
– Kevin Funk and Jesper Pedersen

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

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

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

About the presenters

Kevin Funk
Software engineer at KDAB, Kevin has actively developed with Qt since 2006 and has a special interest in tooling and profiling. An active contributor to KDAB’s GammaRay analyzer, state machine tooling, Kevin is responsible for the Continuous Integration System within KDAB. He’s one of the lead developers of the KDevelop IDE, and is pushing for cross-platform success inside KDE. Kevin holds a Masters Degree in Computer Science.

Jesper Pedersen
Senior Software Engineer at KDAB. Jesper has actively developed with Qt since 1998 and is the mind behind numerous KDE programs and components, as well as the main author of the course material we use for the Qt courses. He holds an MSc in Computer Science and has taught more than 70 Qt classes for companies such as Boeing, IBM, and Veritas. 


6. What’s new in C++11/C++14? – Thomas McGuire

Target Audience: C++ developers who want to upgrade their C++ skills

Prerequisite: Knowing the basics of C++ (the old standard) is a requirement, though more advanced topics will be explained as needed. Knowing the basics of Qt is beneficial, but not required.

This training is targeted at people who are interested to combine the new features of C++11/C++14 with Qt5 (and, to a lesser extent, Qt 4.8). It will teach you all about the new C++11/C++14 features, but also throws in Qt-specific information, including how to structure your code so that a simple recompile with a C++14 compiler will make your applications both faster and use less memory.

About the presenter

Thomas McGuire
Software Engineer at KDAB. Thomas has actively developed with Qt since 2006 and is now a contributor and approver in the Qt project. He joined KDAB in 2008, where his main responsibilities are working on customer projects, on-site consulting and holding trainings in Qt and C++11/14. Thomas has contributed to the KDE project, mainly to the KDE PIM applications and libraries, and was maintainer of the KMail application. He has been a speaker at conferences like KDE’s Akademy and Qt Developer Days. Thomas holds an MSc in Computer Science.


7. Introduction to Modern OpenGL with Qt
– Giuseppe D’Angelo

Target Audience: Developers interested in learning the basics of OpenGL.

Prerequisite: A basic level of linear algebra will be assumed for this course (multiplying a matrix and a vector). Mathematics will be kept to a bare minimum so as not to get in the way of eye candy!

OpenGL is a central part of QtQuick2 in Qt 5 and also plays a key role in displaying the main content of many widget-based applications.

OpenGL has been around for many years and in recent times has evolved to shed much of its legacy baggage and better expose the underlying hardware. Modern OpenGL allows us to take full advantage of the enormous power and parallel processing power of today’s GPUs. Maximizing performance of OpenGL rendering requires us to understand how GPUs work and how to efficiently feed them with data.

Qt provides a number of classes to make life easier when working with modern OpenGL. This training will show you how to do the basic tasks associated with OpenGL rendering and will go on to show how to use Qt and OpenGL to achieve a number of rendering effects and algorithms. You will also learn how to write custom QtQuick2 items using the OpenGL and scene graph APIs.

About the presenter

Giuseppe D’Angelo
Software Engineer at KDAB. Giuseppe is a long time contributor to Qt, having used Qt and C++ since 2000, and he is an Approver in the Qt Project. His contributions in Qt range from containers and regular expressions to GUI, Widgets, and OpenGL. A free software passionate and UNIX specialist, before joining KDAB, he organized conferences on opensource around Italy, especially about Perl. He holds a BSc in Computer Science.


8. Introduction to Testing Qt GUI Applications with Squish – Florian Turck

Target Audience: Testers, Developers and Managers interested in how to automate
testing of Qt applications

Prerequisite: Basic scripting skills and knowing the basics of Qt are a benefit for this training. Bring your laptop and request a free evaluation license and download in advance through http://www.froglogic.com/squish/evaluate.php

While unit testing is established to test components, integration and system tests verify that the overall system works as expected. Squish is the tool for automating these blackbox tests in the world of Qt.

The presenter will introduce you to the automated functional testing of user interfaces based on Qt. Besides getting to know the record and playback GUI testing tool Squish, additional topics range from best practices for test design over test refactoring to Behaviour Driven Testing.

This training includes theoretical modules and live demonstrations, but you are invited to join working on practical exercises – bring your laptop to participate.

About the presenter

Florian Turck – froglogic
Florian Turck is a froglogic Technical Sales Engineer and Software Trainer. An ISTQB-certified tester, he has conducted dozens of Squish trainings for various companies and provides consulting services to prospects and customers.

The post KDAB Training Day at QtCon appeared first on KDAB.

QtWS2016 – Call for Papers Extended, Website and Registration Open

Due to several requests, we’ve decided to extend the deadline for Qt World Summit 2016 Call for Papers until Friday June 3rd. So, now you have all the needed time to really polish your submission or even enough to start a completely new one!

Last year’s magnificent Qt World Summit 2015 gathered around 850 attendees all-around the Qt world in Berlin and more than 2000 people online. This is your chance to present, network and join that awesome crew! For Qt World Summit 2016, which is held October 18th-20th in San Francisco, CA, we accept high-quality talks all the way from industry-related business or technology strategy talks to hands-on technical Qt talks. *This* is your place to show your work or ideas around Qt for the relevant audience.

So, again, you have two more weeks to submit your abstract. Check out our submission themes, categories and speaker benefits from the call for speakers page.

Oh, and while we’re at it, check out the rest of the just-opened Qt World Summit web page as well–most importantly:

Registration for Qt World Summit 2016 is now open!

We are offering 2-day Conference tickets with a go-o-o-o-d discount for those who sign up early, so make sure to book your ticket soon.*

Do you wanna go?

 

*Three-Day Tickets / Training tickets are going to be available at the end of May

The post QtWS2016 – Call for Papers Extended, Website and Registration Open appeared first on Qt Blog.

Generating Python Bindings with Clang

Python Bindings

Python provides a C API to define libraries which can be imported into a python environment. That python C interface is often used to provide bindings to existing libraries written in C++ and there are multiple existing technologies for that such as PyQt, PySide, Boost.Python and pybind.

pybind seems to be a more modern implementation of what Boost.Python provides. To create a binding, C++ code is written describing how the target API is to be exposed. That gives the flexibility of defining precisely which methods get exposed to the python environment and which do not.

PyQt and PySide are also similar in that they require the maintenance of a binding specification. In the case of PySide, that is an XML file, and in the case of PyQt that is a DSL which is similar to a C++ header. The advantage both of these systems have for Qt-based code is that they ship with bindings for Qt, relieving the binding author of the requirement to create those bindings.

PyKF5 application using KItemModels and KWidgetsAddons

PyKF5 application using KItemModels and KWidgetsAddons

Generated Python Bindings

For libraries which are large library collections, such as Qt5 and KDE Frameworks 5, manual binding specification soon becomes a task which is not suitable for manual creation by humans, so it is common to have the bindings generated from the C++ headers themselves.

The way that KDE libraries and bindings were organized in the time of KDE4 led to PyQt-based bindings being generated in a semi-automated process and then checked into the SCM repository and maintained there. The C++ header parsing tools used to do that were written before standardization of C++11 and have not kept pace with compilers adding new language features, and C++ headers using them.

Automatically Generated Python Bindings

It came as a surprise to me that no bindings had been completed for the KDE Frameworks 5 libraries. An email from Shaheed Hague about a fresh approach to generating bindings using clang looked promising, but he was hitting problems with linking binding code to the correct shared libraries and generally figuring out what the end-goal looks like. Having used clang APIs before, and having some experience with CMake, I decided to see what I could do to help.

Since then I’ve been helping get the bindings generator into something of a final form for the purposes of KDE Frameworks, and any other Qt-based or even non-Qt-based libraries. The binding generator uses the clang python cindex API to parse the headers of each library and generate a set of sip files, which are then processed to create the bindings. As the core concept of the generator is simply ‘use clang to parse the headers’ it can be adapted to other binding technologies in the future (such as PySide). PyQt-based bindings are the current focus because that fills a gap between what was provided with KDE4 and what is provided by KDE Frameworks 5.

All of that is internal though and doesn’t appear in the buildsystem of any framework. As far as each buildsystem is concerned, a single CMake macro is used to enable the build of python (2 and 3) bindings for a KDE Frameworks library:


  ecm_generate_python_binding(
    TARGET KF5::ItemModels
    PYTHONNAMESPACE PyKF5
    MODULENAME KItemModels
    SIP_DEPENDS
      QtCore/QtCoremod.sip
    HEADERS
      ${KItemModels_HEADERS}
  )

Each of the headers in the library are parsed to create the bindings, meaning we can then write this code:


  #!/usr/bin/env python
  #-*- coding: utf-8 -*-

  import sys

  sys.path.append(sys.argv[1])

  from PyQt5 import QtCore
  from PyQt5 import QtWidgets

  from PyKF5 import KItemModels

  app = QtWidgets.QApplication(sys.argv)

  stringListModel = QtCore.QStringListModel(
    ["Monday", "Tuesday", "Wednesday",
    "Thursday", "Friday", "Saturday", "Sunday"]);

  selectionProxy = KItemModels.KSelectionProxyModel()
  selectionProxy.setSourceModel(stringListModel)

  w = QtWidgets.QWidget()
  l = QtWidgets.QHBoxLayout(w)

  stringsView = QtWidgets.QTreeView()
  stringsView.setModel(stringListModel)
  stringsView.setSelectionMode(
    QtWidgets.QTreeView.ExtendedSelection)
  l.addWidget(stringsView)

  selectionProxy.setSelectionModel(
    stringsView.selectionModel())

  selectionView = QtWidgets.QTreeView()
  selectionView.setModel(selectionProxy)
  l.addWidget(selectionView)

  w.show()

  app.exec_()

and it just works with python 2 and 3.

Other libraries’ headers are more complex than KItemModels, so they have an extra rules file to maintain. The rules file is central to the design of this system in that it defines what to do when visiting each declaration in a C++ header file. It contains several small databases for handling declarations of containers, typedefs, methods and parameters, each of which may require special handling. The rules file for KCoreAddons is here.

The rules file contains entries to discard some method which can’t be called from python (in the case of heavily templated code for example) or it might replace the default implementation of the binding code with something else, in order to implement memory management correctly or for better integration with python built-in types.

Testing Automatically Generated Python Bindings

Each of the KDE Frameworks I’ve so far added bindings for gets a simple test file to verify that the binding can be loaded in the python interpreter (2 and 3). The TODO application in the screenshot is in the umbrella repo.

The binding generator itself also has tests to ensure that changes to it do not break generation for any framework. Actually extracting the important information using the cindex API is quite difficult and encounters many edge cases, like QStringLiteral (actually includes a lambda) in a parameter initializer.

Help Testing Automatically Generated Python Bindings

There is a call to action for anyone who wishes to help on the kde-bindings mailing list!


Five Reasons to Integrate Customized Qt SDKs for Your Business – Webinar

Developing various applications that take advantage of all the hardware and development resources available is not a trivial task, and succeeding in creating a positive Developer Experience (DX) and User Experience (UX) to grow your business is even more difficult. Learn how building customized Qt SDKs can help you utilize the full resources of developers and target hardware and software platforms. 
 
Register for our interactive webinar to kick-start your SDK strategy with experts from Qt, Esri and PubNub.  

Learn how to: 

  • Grow your business and multiply applications in your ecosystem 
  • Enhance the DX/UX and determine the performance you require 
  • Build your brand and show the ease of integration to your partners 
  • Save costs and enjoy faster time-to-market with extensible features
  • Increase performance and boost security 
Build your user experience from the home, car, workspaces and bring your brand in front of various application creators of various industries to your ecosystem with a powerful framework that will grow your business. 
 
Panelists: 
  • Alistair Adams, Automotive Program Manager, The Qt Company
  • Michael Tims, Software Engineer, Esri
  • Jonas Gray, Head of Strategy, PubNub
 This webinar will be 30 minutes followed by a panel discussion with Qt SDK makers and Q&A.  
Ready to develop an Qt SDK and want to skip this step? Watch how on-demand: “Building Performant SDKs for Embedded Devices”

The post Five Reasons to Integrate Customized Qt SDKs for Your Business – Webinar appeared first on Qt Blog.

Did the Auto Industry’s iPhone Moment Just Happen?

I was present at the 2007 MacWorld Expo where the iPhone was announced. Ever the master marketer, Steve Jobs orchestrated a live demo, placing a call to Apple’s VP of Marketing as he was walking down the aisle of the packed auditorium. Afterward, in the large Apple booth on the exhibit floor, there were two suspended models of iPhones rotating in plexiglass cases: you couldn't touch them, you couldn't hold them, you couldn't make calls on them like Steve Jobs had done from the stage.

Left Out in the Kold: The User Experience of Keurig

One of the perks of being a technology company, is we get lots of fun toys around the office. For example, we’ve had a few Keurig coffee machines in our office kitchen for several years now.  They are quick, simple to use and produce adequate caffeinated beverages to feed our morning addictions. So when I heard that ICS had acquired a Keurig®-KOLD™ machine, I immediately headed for the kitchen to see how it compared to its warm-blooded sibling.

(Note:  We’re based in Boston; we have ‘soda’, not ‘pop’.  Just go with it.)

QtCon Call for Papers Extended!

Berlin, September 1-4

The Call for Papers is extended to May 22nd!!

What have you been working on lately that you’d like to share at a QtCon talk? The Qt Community of developers wants to hear from you! Submit your proposal by May 22nd and get a chance to contribute to this one-off, unique Event in Berlin.< />

Find out more and submit your papers here QtConInfo_v4_wee

The post QtCon Call for Papers Extended! appeared first on KDAB.

Qt @ NXP FTF 2016

The Qt Company is a Silver Sponsor with Adeneo Embedded at NXP FTF Technology Forum 2016 where inspiration, training, ecosystem and expertise you need will be provided to boldly face the challenges and opportunities from new markets and ever-changing technologies. 
 
NXP FTF Technology Forum 2016
May 16-19, 2016
JW Hotel, Austin
 
The Qt Company, Adeneo Embedded & Toradex in our technical talks during the show: 
 
Technical Talks:
 
“Performance Driven GUI Development on Low-Cost Hardware” – provided by The Qt Company on Monday, May 16 at 3:15 PM, 205 – Level 2
 
Learn how Qt for Device Creation may be used to create advanced user interfaces in a few simple steps. Qt is a cross-platform C++ framework that offers tools to create modern and fluid user experiences. The Qt framework may utilize the OpenGL ES capable i.MX6 or perform simplified rendering for the new i.MX7. We will take a look at Qt and use Qt for Device Creation to develop a GUI application optimized for projects requiring low power and real-time tasks which are suitable for wide-range of industrial applications, while keeping advanced security features to be used in IoT applications—all with confidence and convenience. Attendees will discover how easily it is to enable a low power device with performant GUI effects. This evolution requires virtually no changes to the software or hardware — made possible by the Qt Framework and standardized pin-compatible computer modules from Toradex.
“A Detailed Look on the Heterogeneous i.MX7 Architecture” – provided by Adeneo Embedded on Monday, May 16 at 3:15 PM, Griffin Hall 4 – Level 2
 
This presentation will demonstrate the capabilities of the new i.MX7 System-on-Chip, a hybrid solution containing a Cortex A7 processor and a Cortex M4 processor. Particular attention will be given to the hardware modules and software counterparts allowing both cores to communicate with each other. This hybrid architecture will be highlighted through various potential use cases/product scenarios and a Qt powered application running on top of Linux along with FreeRTOS will be showcased, focusing on asymmetric processing.
 “A Balancing Robot Leveraging the Heterogeneous Asymmetric Architecture of i.MX 7 with FreeRTOS & Qt” – provided by Toradex on Monday, May 16 at 2:00 PM, Lone Star Ballroom C – Level 3
 
This technical lecture presents how Toradex built a balancing robot demo application using the new i.MX 7’s heterogeneous asymmetric architecture. i.MX 7 features a secondary Cortex-M4, which can be used for real-time or low-power applications. We will discuss how to make use of the secondary core with a FreeRTOS based firmware implementing the closed loop controller to keep the robot balanced upright. On the powerful main CPU complex, a dual Cortex-A7, Linux is running a Qt based user interface. We will go into details about the rpmsg/OpenAMP based messaging offerings provided by NXP. The robot demo application makes use of rpmsg to communicate between the two independently running processor cores and operating systems.
 
Please Contact us if you’re in Austin during this time or have any comments. 
See you in Austin!

The post Qt @ NXP FTF 2016 appeared first on Qt Blog.

How to Integrate V-Play Plugins: The Quick Guide

V-Play Plugins are the best way to improve your mobile app or game. The range includes tools for monetization, gathering analytics, and increasing user engagement and retention. V-Play Plugins have been available since V-Play 1.0 but the latest version of V-Play offers an updated approach to plugin integration.

It’s always been simple to add V-Play Plugins to apps and games. Thanks to QML, you were able to integrate plugins for multiple platforms with a single code snippet. The problem with the old integration method was linking your app or game to V-Play plugins only when needed. Until recently, V-Play Plugins were a part of standalone repositories and you could only add them on premise.

What’s New with V-Play Plugins?

The latest release of V-Play offers a new approach to V-Play Plugins integration that saves you both time and code. This has been achieved using a number of different platform-specific concepts.

plugins unselected

All V-Play Plugins are now included in the V-Play Engine Core. You can select the plugins you wish to include and then generate a license key here. You’ll be all done in two steps!

This direct integration removes the need to make extra downloads or include additional repositories in your project. It also makes it easier to toggle the functionality of plugins in your project on or off. This makes it easier to test apps and games using V-Play Plugins during development.

Benefits of the New Plugin Integration

Integration is now easier on both major mobile platforms. For adding V-Play Plugins to Android apps and games, V-Play makes use of the Gradle build system. Now you just have to add a single line of code to your build.gradle file and dependencies. This will cause changes to the AndroidManifest file to be added automatically for you.

For example, the Push Plugin can now be added to apps and games by adding a single line of code to your build file. This replaces the 7 manual steps it used to take to enable Push Notifications. If you want to disable the Push Plugin while building your app, you just need to remove the line of text from the build file. There’s no need to change the code!

The update to V-Play Plugins has added benefits, besides the ease of integration. When supported and enabled correctly, you’ll now receive more detailed console output. Just as if the native library integrations were found.

Plugin Integration for Android

Let’s take a look at how to add the Flurry Analytics Plugin to an Android app as an example.

  • Set up a Flurry user account at http://www.flurry.com/sign-up or login to your existing account. Then open your Flurry dashboard (https://dev.flurry.com/home.do) and add a new application.
  • This will create a unique application key which you’ll insert into the following code snippet, so “<flurry-api-key>” becomes, for example “RN3KB3WDNV86MDM2QM75”.
  • The following code snippet will add an event called App Started to your app. Copy and paste it into your app:

import VPlayPlugins 1.0

 Flurry {
   id: flurry

   // From Flurry Dashboard
   apiKey: ""

   Component.onComplete: {
     flurry.logEvent("App started");
   }
 }

  • You only need to add the following code to your build.gradle file to get the plugin working on Android devices:

dependencies {
compile 'net.vplay.plugins:plugin-flurry:2.+'
}

This is the line of code that you can add and remove from your project to toggle the plugin on and off. You’ve now successfully added analytics to your mobile app in 4 easy steps!

Plugin Integration for iOS

On iOS, you just need to copy the native framework into your iOS subfolder and copy/paste a few lines of code to your project file. Let’s enable the Flurry Analytics Plugin for iOS devices too.

  • Complete the first two steps from the “Plugin Integration for Android” guide: create a Flurry account and an API key
  • The next step is to download the V-Play PluginDemo from https://github.com/v-play/PluginDemo/archive/master.zip and unzip it.
  • Copy libFlurry.a from the ios subfolder of the unzipped PluginDemo folder to the sub-folder called ios within your project directory.
  • Add the following lines of code to your .pro file:

ios {
   # Flurry SDK
   LIBS += -L$$PWD/ios
   LIBS += -lFlurry
   QMAKE_LFLAGS += -Wl,-force_load,$$PWD/ios/libFlurry.a

   # Flurry dependencies
   LIBS += -framework Security
   LIBS += -framework SystemConfiguration
 }

That’s it! You’ve now added your Flurry Plugin for analytics to your cross-platform app.

You can find the integration guides for all other plugins on the Plugin page.

Easier License Integration

Previous to the latest update to V-Play Plugins, you had to add a license key for every plugin you wanted to include in your app or game. This sometimes led to issues using plugins in parallel.

Now you can select the plugins you want to add and create a new license key online. If you forget to include a plugin in your license key, the log output will notify you.

Generate Plugin Licenses Now

plugins screener

Select the V-Play Plugins fyou want to include in your app or game by ticking the boxes and then hit the “Generate License Key” button below. It’s never been easier to add plugins to your V-Play project!

These plugins are only available with the V-Play Indie & Enterprise licenses. You can try out the plugins in a demo project on GitHub. Check out the individual documentation for each plugin to find the demo projects.

The Quick Guide

For the full guide on how V-Play Plugin integration works, you can check out the documentation of the plugin you’re interested in, like the Flurry Analytics Integration guide.

For another quick example, follow these steps to integrate the Facebook plugin into your app or game for both Android and iOS devices:

  • Create a new license key
  • Add the Facebook component to your code

import VPlayPlugins 1.0

 Facebook {
   appId: "xxxxxxxxxxxxxxxx"
   readPermissions: [ "email", "user_friends" ]
   publishPermissions: ["publish_actions"]

   Component.onCompleted: {
     openSession()
   }
 }

  • Open your build.gradle file and add the following lines of code to the dependencies block:

dependencies {
   compile 'net.vplay.plugins:plugin-facebook:2.+'
 }

  • Copy the FacebookSDK.framework and Bolts.framework from the ios subfolder to a sub-folder called ios within your project directory.
  • Add the following lines of code to your .pro file:

ios {
   # Facebook framework
   LIBS += -F$$PWD/ios
   LIBS += -framework FacebookSDK
   QMAKE_LFLAGS += -Wl,-force_load,$$PWD/ios/FacebookSDK.framework/FacebookSDK

   # Facebook dependencies
   LIBS += -framework Security
   LIBS += -framework SystemConfiguration
 }

  • That’s it!

If you’ve already used V-Play Plugins in your app or game or with older versions than V-Play 2.8.3, you can check out our migration guide.

Get the Most from V-Play Plugins

The complete range of V-Play Plugins is available to all V-Play Indie & Enterprise users.

It includes tools for analytics, such as Google Analytics, Flurry, Infinario, and HockeyApp. You can also use V-Play Plugins to monetize games and apps using Chartboost, AdMob and Soomla In-App Purchases. It also includes social and user engagement plugins like Facebook, One Signal and Parse Push notifications.

Testing the Plugins

You can test all the new plugins in a simple app live on Google Play. The app will also be live on the App Store soon so you can see the plugins in action.

Google_Play_Badge-1

itunes download button

For the full source code of this sample app, including all V-Play Plugins, you can check out this GitHub sample.

1 Plugins  4 Chartboost_Interstitial  5 Soomla

Get Source Code for Plugin Integration Sample with All Plugins

Easier Plugin Integration and Migration

The new V-Play Plugins update makes it easier than ever to integrate these features into your app or game. Make sure you’re getting the most from your apps and games by integrating V-Play Plugins.

Don’t forget to Like and Retweet this article and share it with your friends and colleagues!

More Posts like This

How to Make a Game like Super Mario Maker with Our New Platformer Level Editor

Platformer Level Editor

16 Great Sites Featuring Free Game Graphics for Developers

game graphics

The 13 Best Qt, QML & V-Play Tutorials and Resources for Beginners

tutorials capture

21 Tips That Will Improve Your User Acquisition Strategy

User Acquisition

 

The post How to Integrate V-Play Plugins: The Quick Guide appeared first on V-Play Engine.

Qt Creator 4.0.0 released

We are happy to announce the release of Qt Creator 4.0.0. Starting with this release, we are making the Clang static analyzer integration, extended QML profiler features and auto test integration (experimental) available under open source. The previously commercial-only connection editor and path editor of Qt Quick Designer were already open sourced with Qt Creator 3.6.0. Qt Creator is now available under commercial license and GPLv3 (with exceptions). The exceptions ensure that there are no license restrictions on generated code, and that bridging to 3rd party code is still possible. You can read more about this change in the blog post announcing it.

New Theme and QML Flame Graph

New Flat Theme and QML Flame Graph

Users of CMake will find that we improved the workflow for CMake-based projects. CMake is now triggered automatically when necessary, and kit settings like the used Qt version or tool chain are automatically configured. Projects mode now features a UI to change the CMake configuration for a build directory. You can also change the CMake configuration that is common to all projects that use the same kit. Qt Creator will no longer create CMake build directories before the project is built. This makes for a much tidier work environment, especially when users only want to study source code using the CMake build system.

The Clang code model is now automatically used if the (experimental) plugin is turned on. We added customizable configurations for warnings, which you can also specify per project.

On the debugging side we fixed multiple issues that appeared with the new LLDB included in Xcode 7.3 on OS X. You’ll also find more pretty printers for standard types, as well as many bug fixes.

If you wonder where Analyze mode has gone: It was merged with Debug mode. In the new, unified Debug mode you now find the Debugger, Clang Static Analyzer, Memcheck, Callgrind and QML Profiler tools. The QML Profiler adds a new visualization of statistics: The Flamegraph. In this view, the horizontal bars show the amount of time all invocations of a function took, and vertical nesting on top shows which functions were called by which other ones, making for a very concise overview.

In Qt Quick Designer you can now move the canvas by dragging with the left mouse button while the space key is pressed. It adds support for the new Qt Quick Controls 2 and received many bug fixes. Please also head over to the post and video about Qt Quick Designer and Qt Quick Controls 2 that we recently published on our blog.

Qt Creator now also has a new, flat theme, which is based on the concept that Diana presented a year ago. It is default for everyone who hasn’t ever changed the theme in Qt Creator. The old theme is also still available as “Classic” in Tools > Options > Environment > Interface.

You find a more detailed list of improvements in our change log.

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.0.0 released appeared first on Qt Blog.

New Company: Edge Security

I've just launched a website for my new information security consulting company, Edge Security. We're expert hackers, with a fairly diverse skill set and a lot of experience. I mention this here because in a few months we plan to release an open-source kernel module for Linux called WireGuard. No details yet, but keep your eyes open in this space.

Qt Installer Framework 2.0.3 released

We are happy to announce that the Qt Installer Framework 2.0.3 is released.

2.0.3 is a bug fix release, mainly fixing compiling issues. The Installer Framework requires Qt5.5 or later versions to compile. Please see ChangeLog for further details.
Sources and precompiled binaries for the Installer Framework are available at download.qt.io (open source) or in your Qt Account.

The post Qt Installer Framework 2.0.3 released appeared first on Qt Blog.

Qt for Start-Ups – Get it Cheap While You Still Can!

With Qt 5.6 we introduced the possibility for start-ups and small companies to acquire full commercial licenses for Qt for Application Development with a reduced price. As an initial launch offer the start-up license tier is available as low as $49/month for an annual subscription, with the regular price being $79/month for annual billing or $99/month for more flexible, month-to-month billing.

The limited-time offer is now nearing its end and this is your last chance of purchasing the start-up license with this campaign price before the campaign will end next Thursday 19.5.

So, *now* is the time to get your fully commercially-licensed Qt for Application Development for Start-ups using the promo code StartUpIntro through our web shop.

Read more about the start-up licensing option and start creating your cross-platform desktop and mobile apps with Qt today!

Qt_Start-Up_Plan_SoMe1

The post Qt for Start-Ups – Get it Cheap While You Still Can! appeared first on Qt Blog.

C++, Qt and Treefrog to build user facing web applications

In the past I have written about my usage of Tufao and Qt to build REST services. This time I am writing about my experience of using the TreeFrog framework to build a full web application.

You might wonder why one would want to build such a thing in a statically and compiled language instead of something more dynamic. There are a few reasons for it:

  • Performance: The application is intended to run on our sysmoBTS GSM Basestation (TI Davinci DM644x). By modern standards it is a very low-end SoC (ARMv5te instruction set, single core, etc, low amount of RAM) and at the same time still perfectly fine to run a GSM network.
  • Interface: For GSM we have various libraries with a C programming interface and they are easy to consume from C++.
  • Compilation/Distribution: By (cross-)building the application there is  a "single" executable and we don't have the dependency mess of Ruby.
The second decision was to not use Tufao and search for a framework that has user management and a template/rendering/canvas engine built-in. At the Chaos Computer Camp in 2007 I remember to have heard a conversation of "Qt" for the Web (Wt, C++ Web Toolkit) and this was the first framework I looked at. It seems like a fine project/product but interfacing with Qt seemed like an after thought. I continued to look and ended up finding and trying the TreeFrog framework.

I am really surprised how long this project exists without having heard about it. It is using/built on top of Qt, uses QtSQL for the ORM mapping, QMetaObject for dispatching to controllers and the template engine and resembles Ruby on Rails a lot. It has two template engines, routing of URLs to controllers/slots, one can embed any C++ in the template. The documentation is complete and by using the search on the website I found everything I was searching for my "advanced" topics. Because of my own stupidity I ended up single stepping through the code and a Qt coder should feel right at home.

My favorite features:
  • tspawn model TableName will autogenerate (and update) a C++ model based on the table in the database. The updating is working as well.
  • The application builds a libmodel.so, libhelper.so (I removed that) and libcontroller.so. When using the -r option of the application the application will respawn itself. At first I thought I would not like it but it improves round trip times.
  • C++ in the template. The ERB template is parsed and a C++ class will be generated and the ::toString() method will generate the HTML code. So in case something is going wrong, it is very easy to inspect.

If you are currently using Ruby on Rails, Django but would like to do it with C++, have a look at TreeFrog. I really like it so far.

Release 2.8.3: New V-Play Game Center Plugin and Bug Fixes

V-Play 2.8.3 is now available for download and as a free update to all V-Play users. This update introduces the new V-Play Game Center Plugin and a number of minor bug fixes. The V-Play Game Center Plugin is included in the V-Play Indie License and is the perfect extension to the V-Play GameNetwork.

Update Now!

If you’re not an existing V-Play user, you can download the SDK for free.

V-Play GameCenter Plugin

The V-Play Game Center Plugin creates a social gaming network for your V-Play games. The Apple Game Center is a widely used gaming service that comes pre-installed on all iPhones and iPads. With this new plugin, you can take advantage of the highscores, leaderboards and achievements supplied by the Apple Game Center.

Even more, you can connect the Apple Game Center with the V-Play Game Network to get synchronized leaderboards and achievements across multiple platforms. This means your players can use their familiar iOS game service and compare their progress with players on other platforms like Android or PC.

This multi-platform support is available with just a single API call from the V-Play Game Network: a call of reportScore() or incrementAchievement() automatically posts to both gaming services. This allows your cross-platform game to grow a community open to both Android and iOS users alike.

These features make it a valuable tool for increasing player engagement in your game. You can find out how to integrate the V-Play Game Center Plugin into V-Play Game Network here.

Bug Fixes

V-Play 2.8.3 features fixes for a number of minor bugs. These changes affect both app and game development.

  • It’s no longer required to change the AndroidManifest.xml file for existing projects if you don’t use plugins in your project, as it was with update 2.8.2.
  • Fixes a possible error output that module “QtQuick.Dialogs” could not be loaded if using V-Play Game Network components.
  • A memory leak in the Chartboost Plugin has been fixed

How to Update

Test out these new features by following these steps
Step 1

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.8.3 as described in the V-Play Update Guide

If you haven’t installed V-Play yet, you can do so now with the latest installer from here.

Step 2

The V-Play Sample Launcher allows you to quickly test and run all the open-source examples and demo apps & games that come with the V-Play SDK, from a single desktop application.

After installing V-Play, you can start the V-Play Sample Launcher from the application shortcut in your V-Play SDK directory.

V-Play Sample Launcher

Now you can explore all of the new features included in V-Play 2.8.3!

More Posts like This

How to Make a Game like Super Mario Maker with Our New Platformer Level Editor

Platformer Level Editor

16 Great Sites Featuring Free Game Graphics for Developers

game graphics

The 13 Best Qt, QML & V-Play Tutorials and Resources for Beginners

tutorials capture

21 Tips That Will Improve Your User Acquisition Strategy

User Acquisition

 

The post Release 2.8.3: New V-Play Game Center Plugin and Bug Fixes appeared first on V-Play Engine.

Eight Golden Rules: Rule 8 - Reduce Short Term Memory Load

A regrettable consequence of getting older is that both our senses and our memory tend to be less acute.  While I scoffed at this notion when I heard about it in HCI class back in my 20s, it is now a fact of my daily life.  The National Institute of Health (NIH) describes how changes in our brains as we get older may cause us to take longer to learn new concepts or remember information.

Media Manager for Automotive Infotainment (Part 4)

Media Manager Architecture - From Indexing Media to Playing

In the first two parts of our blog series, we examined some of the functional requirements of our Media Manager. We also showed a solution for indexing of media. In today’s installment, we explain the core architecture of the media manager and how indexed media information can be presented to our end users.

To summarize, we want the Media Manager to have a few important capabilities:

foss-north – Schedule available

Just a short update on foss-north – the schedule is up. We have a whole list of speakers that I’m super excited about and tickets are selling well. I still don’t know what to expect, but more than 1/3 of the tickets are gone and the sales numbers are actually even better for the full priced tickets than the early birds.

Speakers will cover everything from design, methodology, licensing, embedded tech, networking, IoT, start-ups, innovation – a broad spectrum demonstrating the versatility of free and open source.

To sum things up – it looks like we might actually pull this off and I still can treat my family with a vacation instead of paying for unused catering ;-)

Release 2.8.2: Easier Plugin Integration & Debug Menu Improvements

V-Play 2.8.2 is now available to all V-Play users for free. This update offers a range of improvements to the SDK to make plugin integration and testing simpler for developers. It also features a number of minor fixes for V-Play Apps components. You can update now to check out the improvements for yourself.

Update Now!

If you’re not an existing V-Play user, you can download the SDK for free.

V-Play Plugins

The release of V-Play 2.8.2 means a drastic improvement in the way 3rd party plugins are added to mobile apps and games.

Using V-Play Plugins before 2.8.2 required you to install the plugin libraries from an additional repository in the Maintenance Tool. Beginning with V-Play 2.8.2, plugins are part of V-Play Engine libraries. This reduces the necessary amount of code and time it takes to integrate plugins.

Plugins

With V-Play Plugins, you can monetize your app or game. Admob, Chartboost and Soomla allow you to advertise and enable in-app purchases.

Google Analytics is an industry-standard plugin for measuring user events. Flurry, Infinario and HockeyApp also allow you to gather data on user interactions.

The Facebook plugin and the V-Play Game Network allow you to increase retention by engaging users. All of the V-Play Plugins are available with the V-Play Indie License.

If you’re already using V-Play Plugins, you can check out our migration guide for using the new integration method. This migration guide is only for pre-existing V-Play Plugins users.

Debug Menu Improvements

V-Play recently added a Debug Menu that enables quick UI and UX testing. V-Play 2.8.2 has improved this feature for both apps and games. The Debug Menu now reduces the application window for resolutions that don’t fit on screen.

In addition, the UI is now scaled to simulate the selected device.

update-271-menu-resolution-changer

The Debug Menu allows for better testing of games and apps during development builds: you can easily switch between different platforms and screen resolutions while testing on desktop machines.

You can choose between Desktop, iOS and Android themes and see the differences instantaneously, even when the app is running, without needing to re-run the app or have a real device for testing.

Fixes

V-Play 2.8.2 includes two fixes:

  • A Sample Launcher issue with Theme initialization when running app demos.
  • A bug on Android 4 devices that caused the home button to stop working.

How to Update

Test out these new features by following these steps
Step 1

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.8.2 as described in the V-Play Update Guide

If you haven’t installed V-Play yet, you can do so now with the latest installer from here.

Step 2

The V-Play Sample Launcher allows you to quickly test and run all the open-source examples and demo apps & games that come with the V-Play SDK, from a single desktop application.

After installing V-Play, you can start the V-Play Sample Launcher from the application shortcut in your V-Play SDK directory.

V-Play Sample Launcher

Now you can explore all of the new features included in V-Play 2.8.2!

More Posts like This

How to Make a Game like Super Mario Maker with Our New Platformer Level Editor

Platformer Level Editor

16 Great Sites Featuring Free Game Graphics for Developers

game graphics

The 13 Best Qt, QML & V-Play Tutorials and Resources for Beginners

tutorials capture

21 Tips That Will Improve Your User Acquisition Strategy

User Acquisition

 

The post Release 2.8.2: Easier Plugin Integration & Debug Menu Improvements appeared first on V-Play Engine.

Qt World Summit 2016 | Call for Speakers – We need your best work!

QtWS16_Blog_1280x480

It is the time of the year again when the #1 Qt event of the year, Qt World Summit, is a approaching and Call for Papers is now open. Qt World Summit 2016 is held October 18-20, 2016 in San Francisco, CA.

At the Qt World Summit, we celebrate the synergy of Qt, the ecosystem, and technology. We are passionate about enabling innovation, interactivity, enhanced user experiences, IoT, application development, device creation and visualization (to name a few!), and keen on the points of connection and collaboration among the disciplines. For more than 12 years, our conference has served as a hub, bringing together technology innovators, industry experts, creative startups, and device creators who continue to inspire, educate, and show innovative approaches to various communities within application development and device creation techniques–as well as the latest trends around the Qt roadmap, API offerings, tips’n’tricks and hands-on tutorial sessions!

Qt World Summit 2016 will continue to build on this legacy while striving to create stronger ecosystem among our existing, converging and emerging communities. We are determined to render the exponential potential that arise when software systems, ideas, and techniques intertwine.

To do this, we need your best work! Qt World Summit 2016 offers a variety of opportunities for you to present, network, and be an integral part of the conference. Now, we are seeking submissions along the main themes of the conference:

  • Creating Connected Devices and Internet of Things
  • Things getting smaller
  • Next generation graphics approaches
  • The future of user interfaces and 3D
  • Software as a differentiator – Industries being revolutionized by software: Automotive, Medical/Health, Consumer Electronics,  Industrial Automation, Aerospace/Defense and more
  • Software solution for multi-platform development – desktop, mobile and embedded

For these themes, we are looking for inspiring strategy and industry talks (Technology Strategy) as well as more hands-on technical talks (Qt for Application Development and Device Creation).

For the full details of the themes, submission categories and instructions, please view the Qt World Summit 2016 Call for Speakers document and Submit your talks here.

From mission-critical work to newly developed technologies, lecture-based workshops to consumer electronics project strategies, real-time operating systems to experiential installations, mobile applications to innovative animations and visual effects, submissions will be reviewed and evaluated by our experts from a plethora of specializations.

Of course, there are deadlines! Qt World Summit Call for Papers deadline is May 20th, and we don’t want to miss your submission. Feel free to contact Qt World Summit 2016 program chairs regarding the submission process. We’ll be happy to hear your questions, comments, or ideas.

Contact qtws@qt.io if you have any questions.

That being said, on behalf of the Qt World Summit 2016 program committee, I invite you to contribute and to join us this fall in beautiful San Francisco, California for another educational, stimulating, and memorable gathering of the worldwide Qt ecosystem. With you, we hope to shape and imagine the exponential potential of our future.

I look forward to seeing you (talk!) at #QtWS16!

And again, submit your talk here!

 

The post Qt World Summit 2016 | Call for Speakers – We need your best work! appeared first on Qt Blog.

Fast-Booting Qt Devices, Part 2: Optimizing Qt Application

Welcome back to the fast-boot blog post series! Last week we covered the fast-boot demo that showed you a video of an i.MX6 board booting under 2 seconds. In this blog post we will cover how the Qt QML cluster application was optimized.

The original demo shown in Qt World Summit 2015 was designed in PC environment and the startup time was not addressed with the initial design. Design already incorporated usage of Loaders so that some parts of the UI were asynchronously loaded but the startup sequence was not thought at all. So, to begin the optimization for the startup we first needed to think of the use case: What is it that we want the user to see first? We selected that the first thing the user must see is the frame of the cluster after which we load and animate the rest of the objects to the screen.

In the cluster image below the red overlay marks the parts we decided that user must see when the application starts:

mask_layer_red

When looking at the application code we noticed that our dashboard was actually combination of multiple different mask images and some of these were fullscreen. So we combined all the visible parts into one single full screen image that gets loaded on top of the UI:

DashboardFrameSport-mask

 

To make the startup of the application as fast as possible we adjusted the internal design of the application as well. We separated the dashboard frame into it’s own QML file that gets loaded as a very first item. After cluster frame is loaded and drawn we enable the loader underneath to load rest of the UI.

frame_qml2

We also used the QML profiler in Qt Creator to find out what was taking time. Initially the demo used the original Qt Quick Controls that were designed for desktop. This caused the creation of these gauges take some extra time (note that, Qt Quick Controls are being redesigned for embedded use cases for Qt 5.7!) To solve this part for now, we replaced the gauges with images and created a fragment shader to color the parts of gauges that needs animation.

As a final touch we added the flip animation to gauges and fade in to the car to make startup feel more natural:

After these optimizations we got the Qt application to show the first frame under 300 milliseconds on the target device (from the time operating system kernel is loaded).

Optimizing Your Application: ‘Do’s and ‘Do not’s!

Finally, based on our experience, here is a summary of tips’n’tricks for optimizing your Qt Quick applications. In case you feel like you could use additional help, feel free to contact us or any of our Qt Partners and we’re happy to help you with your application!

Do:

  • Design your application to start fast from the beginning. Think what is it that you want the user to see first.
  • Make startup animations to allow parallel loading.
  • Use chain loading. Run only as many loaders as you have cores in your CPU (e.g two cores: two loaders running at the same time).
  • First loader should not be asynchronous. Trigger the rest of the loaders.
  • Create QML plugins that are loaded when required.
  • Connect to back-end services only when required.
  • Let the QML plugins start up non-critical services and close those down when not required anymore.
  • Optimize your png / jpg images.
  • Optimize your 3d models by reducing the amount of vertices and removing parts that are not visible.
  • Optimise the 3D model loading by using glTF.
  • Use Qt Quick Controls 2.0. These are designed for embedded use and the creation times are a lot better than in Quick Controls 1.0 for embedded use cases.
  • Limit the usage of clip & opacity.
  • Measure GPU limitations and take those into account when designing the UI.
  • Use Qt Quick Compiler to pre-compile the QML files.
  • Investigate if static linking is possible for your architecture.
  • Strive for declarative bindings instead of imperative signal handlers.
  • Keep property bindings simple. In general, keep QML code simple, fun and readable. Good performance follows.
  • When targeting multiple platforms and form factors, use file selectors instead of loaders and dynamic component instantiation. Don’t be shy to “duplicate” simple QML code and use file selectors to load tailored versions.

Do not:

  • Go overboard with QML. Even if you use QML, you don’t need to do absolutely everything in QML.
  • Initialize everything in your main.cpp.
  • Create big singletons that contain all the require interfaces.
  • Create complex delegates for Listviews.
  • Use Qt Quick Controls 1.0 for embedded.
  • Clip should be avoided altogether if possible. (98% of the use cases this should be possible).
  • Fall into the common trap of overusing Loaders. Loader is great for lazy-loading larger things like application pages, but introduces too much overhead for loading simple things. It’s not black magic that speeds up anything and everything. It’s an extra item with an extra QML context.
  • Overdo re-use. Maximum code re-use often leads to more bindings, more complexity, and less performance.

In the next part of the series, we will look more closely into the operating system side of the startup optimization. Stay tuned!

The post Fast-Booting Qt Devices, Part 2: Optimizing Qt Application appeared first on Qt Blog.

Qt Quick Designer and Qt Quick Controls 2

Qt 5.6 introduced the Qt Quick Controls 2 and they are already integrated in the upcoming release of Qt Creator 4.0.

We took this as a reason to create a video that shows how the new controls can be used to build a UI easily using Qt Creator and the integrated Qt Quick Designer.

The video shows how we create the UI of a simple home automation application for a touch device. Finally we run the software on a hardware with the boot2qt stack installed.

The UI uses the material style that comes with the Qt Quick Controls 2. We also show a couple of new features that help to maintain the split between .qml and .ui.qml files.

All these features are both in the free Open Source version and the commercial version of Qt Creator 4.0.

The post Qt Quick Designer and Qt Quick Controls 2 appeared first on Qt Blog.

The Swift Programming Language

The preferred programming language for developing on Apple platforms has been Objective-C (1), going back to the 1990s when Apple acquired the NeXTSTEP operating system from which OS X is derived. Like C++, Objective-C adds object-oriented programming support to the C programming language.

In 2014, Apple introduced the new Swift (2) language, which was characterized as "Objective-C without the C". Swift is now being promoted as the replacement for Objective-C and many developers are moving to it for application development on Apple platforms.

Creating Certified Systems with Qt

When there is a need to use Qt as part of a system requiring functional safety certification, it is typically best to analyze if the safety critical functionality can be separated. This approach allows the safety critical functionality to be implemented without the need to certify the complete software stack of the system.

In my earlier blog post I explained the fundamentals of functional safety as well as introduced some of the industry specific standards for functional safety. If you missed that, I recommend to read it first. In this second blog I will explain what certification of Qt would mean in practice and present two architectures for creating a functional safety certification for a Qt based system.

What about Certification of Qt for Functional Safety?

Qt has been used in various systems requiring certification, and a bit over a year ago we decided to investigate if and how Qt itself could be certified for functional safety. The analysis was mainly conducted against IEC 61508, which sets the baseline for industry specific standards on functional safety, and automotive ISO 26262. Two separate pre-studies were conducted by The Qt Company together with VTT Expert Services, who is a certification authority for various standards, including IEC 61508. Based on these pre-studies and analysis of IEC 61508 and ISO 26262 it was concluded that it is in essence possible to certify core parts of the Qt framework for functional safety. However, balancing the effort, cost and needed functional changes related to the certification effort, we believe that aiming to get safety certification of the Qt framework is not sensible or meaningful in technical nor business wise. Our aim is to make it easier than before to use Qt in certified systems, and to work with our customers to achieve the certificates they need.

It is possible to use Qt as an integral part of a system certified for functional safety, without changes to the Qt framework. When the safety critical functionality of the certified system is adequately separated, it is not necessary to certify other parts of the system software. Thus it is possible to create a certified system with Qt without certifying the Qt libraries. In the next chapters, I will cover how to achieve the needed functional safety with a system containing Qt and present two alternative system architectures for this purpose.

Using Qt in Safety Critical Systems

If a product, for example an embedded system, contains both certified and non-certified components, it is crucial to adequately separate these. If the safety critical software can’t be reliably separated from the other software, the whole system should be certified for functional safety. In practice it is typically much better choose a system architecture that separates safety critical functionality from the other functionality. Such separation is beneficial especially in cases when the system contains a complex UI and application functionality.

Leveraging a Real Time Operating System

One approach is to leverage a certified real-time operating system for separation of the certified and non-certified software. This is well feasible as Qt supports several real time operating systems that have a proven way to separate the safety critical and other functionality. This approach is especially good in applications where the unique capabilities of the used real time operating system are a good fit for the application’s needs, i.e. the needed functionality of the application is feasible with the chosen real-time operating system.

functional_safety_rtos

Figure 1. Using a certified RTOS to separate safety critical functionality.

With this architecture the real-time operating system provides the capability to separate safety critical and other processes. The overall system architecture leverages just one operating system kernel managing both safety critical and other processes. Typically, the real-time operating system can also provide a guarantee that certain functions get run when needed, a feature often beneficial in creation of systems that need certification. As the operating system fully separates the functionality which is not safety critical, certification is needed only for the safety critical parts. Many real time operating systems offer a certified or pre-certified kernel and toolchain, thus using these saves time and effort in system level certification.

Leveraging a Hypervisor

Another system architecture for separation of the non-certified components from the certified, safety critical, parts of the embedded system is to use a hypervisor. In this approach a hypervisor is leveraged to run two or more different operating systems. For example, one for safety critical functionality and one or more for the other parts of the system. Typically, a so called Type 1 or bare-metal hypervisor is a good approach for embedded systems that need to run a separate operating system for certified and non-certified functionality.

functional_safety_hypervisor

Figure 2. Using a certified hypervisor to separate safety critical functionality.

Certified functionality can run on a simple real time operating system that has sufficient capabilities to provide the needed safety functions. Non-certified functionality can run for example on embedded Linux, which offers the possibility to utilize all the capabilities of Qt. As the real time operating system does not need to run Qt or any other complex components, it can be simpler and more lightweight than in the architecture that leverages a real time operating system for separation (and to run Qt).

Having the certified parts as streamlined as possible benefits a lot, as it is easier to implement the requirements of safety critical software and there is no need to certify functionality that is not safety critical. Additionally, using a regular embedded Linux for the functionality that is not safety critical typically makes it easier to implement complex functionality, which can result in significant cost savings for the overall system.

Achieving Certified Graphics

In a Qt based system it is common that the UI functionality is provided by Qt. If there is no safety critical UI functionality, the approach for graphics is very straightforward: Qt can handle everything related to the display without impact to any of the safety critical functionality.

However, if the safety critical functionality includes some UI related items, for example a warning light or a message, it needs to be handled by the safety critical part of the system. This means that the architecture has to allow sharing of the screen between safety critical and regular UI components in a way that guarantees operation of the safety critical functionality.

One approach to achieve such co-existence in the display is to leverage hardware layers of the system to guarantee that the safety critical UI component is drawn to the topmost layer. With this approach the safety critical UI is visible despite of a possible failure condition in the other functionality, as any possible failure in other functionality does not overwrite it. Another possibility would be to handle all of the UI composition in the safety critical part of the system. Having composition completely done within the certified functionality slightly complicates the overall graphics architecture, but is a possibility.

If there is dynamic content mandating hardware acceleration required also for the safety critical functionality, usage of an OpenGL SC certified GPU software needs to be considered. Such approach makes the system design more complex, so it is always easier if the UI requirements of the safety critical functionality are limited. Selection of the architecture for safety critical user interface components depends on the capabilities of the used hardware and operating system, as well as the application use case.

If you are interested in discussing more on the creation of functional safety certified systems with Qt, please contact us.

The post Creating Certified Systems with Qt appeared first on Qt Blog.

Qt 5.7 Beta Released

Qt 5.7 Beta is now released and available for your feedback. There is a lot to review – new modules, leveraging C++11 features, and the new unified product structure, which is now the same for both commercial and open source versions.

Leveraging C++11

The core of Qt comes from its C++ foundation and the powerful native performance it offers you. We of course always want to ensure Qt is on top of the latest C++ developments, so that the framework continues to grow with your needs. Qt has supported the use of C++11 in application code for a long time. We also wanted to keep supporting C++98 compilers up to Qt 5.6, which meant that we needed to wait before fully leveraging C++11 features in the Qt framework libraries themselves.

Starting with Qt 5.7 all compilers are C++11 compatible, which allows us to start using new C++ functionality such as auto, lambda and many more in Qt itself. These features will also start to appear in the Qt API, where it makes sense to do so. For those who can’t move yet the long term supported Qt 5.6 provides full C++98 compatibility.

New Functionality

Our focus with Qt 5.6 is on Long-Term Support quality, so lots of new features and functionality will now be coming with Qt 5.7. The Qt Company and our valued contributors managed to do this by developing Qt 5.7 in parallel with completion Qt 5.6 LTS. Qt 5.7 provides a fully supported version of Qt Quick Controls 2 and Qt 3D. It also provides a technology preview of Qt Wayland Compositor, Qt SCXML, Qt SerialBus and Qt Gamepad modules. The Qt 5.7 Beta installers also pack in Qt Creator 4.0 RC.

For full list of all the goodies in Qt 5.7, please check the New Features of Qt 5.7 on the wiki.

Open-Source Licensing Change

As announced in January, Qt is adjusting the open-source licensing starting with the Qt 5.7 and Creator 4.0 releases. Most of the Qt framework will be licensed under your choice of LGPLv3, GPLv2 or our commercial license. In addition, many of the previously commercial only add-on libraries will be made available either under GPLv3 or LGPLv3. Qt Creator, as well as other tools and applications, will be licensed under GPLv3 (with exceptions to enable development of non-GPL applications) and our commercial license.

For more information about the license change, please check the License change FAQ and the blog post announcing the change.

Unified Product Structure

The open-source license change with Qt 5.7 allows us to unify the structure of Qt for Application Development product for both commercial and open-source users in that you will get the same features regardless of the license. One exception though is Qt Quick Compiler, which will only be available under commercial licensing in Qt 5.7. However, we aim to introduce a new built-in Qt Quick Compiler with Qt 5.8, which will be available for both commercial and open-source users. Our product offering for embedded users – Qt for Device Creation – continues to have exclusive functionality available only for commercial licensees.

Get Qt 5.7 Beta

The Qt Company has prepared convenient binary installers for the Qt 5.7 Beta, in the hopes that you will download, test and provide feedback so that we can deliver an awesome final product. To try out the new features you can download it from your Qt Account or from download.qt.io. For any issues you may find with the Beta, please submit a detailed bug report to bugreports.qt.io (after checking for duplicates). You are also welcome to join the discussions in the Qt Project mailing lists, development forums and to contribute to Qt.

The post Qt 5.7 Beta Released appeared first on Qt Blog.