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

KDAB on Qt: hotspot – a GUI for the Linux perf profiler


KDAB on Qt: New in Qt 5.10: recursive filtering for QSortFilterProxyModel

$
0
0

When using Qt’s model/view framework, filtering has always been very easy with QSortFilterProxyModel. To filter a list using text typed by the user in a line-edit, you have certainly been applying the standard recipe:

  1. instantiate the proxy;
  2. insert it between view and source model;
  3. connect the lineedit’s textChanged signal to the proxy’s setFilterFixedString slot; done!

But what if the model is a tree rather than a flat list?

Let’s use the tree below as an example. As you can …

The post New in Qt 5.10: recursive filtering for QSortFilterProxyModel appeared first on KDAB.

The Qt Company Blog: Qt Creator 4.4 Beta released

$
0
0

We are happy to announce the release of Qt Creator 4.4 Beta!

qtc_inline_annotations

Editing

This version of Qt Creator features inline annotations for warnings and errors from the Clang code model and for bookmark comments (Options > Text Editor > Display > Display annotation behind lines). This way, you can easily see the details of issues while you type, without the need to hover your mouse over underlined text or the marker on the left side.

C++

When you rename a symbol, you are now offered to also rename files with the same name. Just trigger the renaming and check “Rename N files” (where “N” will be the number of files with the same base name) in the search results panel before pressing the actual “Replace” button.

If you have the Clang code model enabled, this is now also used for the highlighting of the identifier at the text cursor, which was previously still using the built-in model in any case.

There have been many bug fixes as well. C++ and Qt keywords are no longer wrongly considered keywords in C files, the function signature hint will now work when completing constructors with the Clang code model, and many more.

CMake

We were pretty busy fixing issues already in the 4.3 line of Qt Creator, but there are some improvements in 4.4 as well. We added a filter to the CMake variables setting in build configurations, fixed that headers from the top level directory were not shown in the project tree when using server-mode and improved the handling of CMAKE_RUNTIME_OUTPUT_DIRECTORY in CMake project files.

Other changes

We removed the non-maintained support for Window CE, and changed the ClearCase integration to be disabled by default.

This is just a small selection of the changes and improvements done in 4.4. Please have a look at our change log for a more detailed overview.

Known Issues

QML Profiler can currently get into invalid state. Stopping the application before stopping profiling currently does not work.

Get Qt Creator 4.4 Beta

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

KDAB on Qt: clazy 1.2 released

$
0
0

In the previous episode we presented how to uncover 32 Qt best practices at compile time with clazy. Today it’s time to show 5 more and other new goodies present in the freshly released clazy v1.2.

New checks

1. connect-not-normalized

Warns when the content of SIGNAL(), SLOT(), Q_ARG() and Q_RETURN_ARG() is not normalized. Using normalized signatures allows to avoid unneeded memory allocations.

Example:

    // warning: Signature is not normalized. Use void mySlot(int) instead of void mySlot(const int) 

The post clazy 1.2 released appeared first on KDAB.

KDAB on Qt: hotspot – a GUI for the Linux perf profiler

KDAB on Qt: Clang Tidy, part 2: Integrate qmake and other build systems using Bear

$
0
0

Introduction

This article is part of a blog series about Clang Tidy. In the previous article we learned about the general usage of Clang Tidy to automatically refactor source code for projects using the CMake build system. In this particular episode we’ll discuss using Clang Tooling on projects using different build systems with the help of Bear.

Motivation: So you want to use Clang Tooling on your project — but what if your particular project of interest is using …

The post Clang Tidy, part 2: Integrate qmake and other build systems using Bear appeared first on KDAB.

KDAB on Qt: Qt 3D Short Presentation

$
0
0

Qt now provides a new module named Qt 3D. In this very short talk Giuseppe D’Angelo introduces some of the design ideas behind Qt 3D, discuss its use cases, and shows how simple it is to get 3D content in an application when using Qt 3D APIs.…

The post Qt 3D Short Presentation appeared first on KDAB.

KDAB on Qt: hotspot – a GUI for the Linux perf profiler


V-Play Game Engine: How to Add V-Play to your Qt Mobile App

$
0
0

If you have an existing Qt Mobile App, you can extend your Qt application with V-Play components to improve your mobile app experience. You can mix all of the V-Play and Qt components and have them combined in your project. And the best thing is, you do not need to rewrite your existing Qt application for this! Instead, you can mix the V-Play and Qt components freely in your mobile app. So if you need for example push notifications in your Qt app which uses Qt Quick Controls 2, you can use your existing code and simply add the Google Cloud Messaging (Firebase) push notification plugin by V-Play like this:

import QtQuick 2.0
import QtQuick.Controls 2.0
import VPlayPlugins 2.0

ApplicationWindow {

  GoogleCloudMessaging {
    onNotificationReceived: {
      console.debug("Received push notification: ", JSON.stringify(data))
    }
  }
}

 

This blog post is about the exact steps how you can add V-Play to your Qt Mobile App. Let’s get started.

How does V-Play Improve Qt?

The V-Play SDK for cross-platform apps and games comes with many components to make mobile development with Qt easier. V-Play extends Qt for mobile app development and offers for example:

  • Native look and feel for iOS and Android
  • Monetization with Ads and In-App Purchases
  • Analytics for User Behavior and Crash Reports
  • Push Notifications– triggered locally or by a server
  • Social Engagement with native sharing and Facebook integration
  • Gamification with Highscores, Achievements, Friend System and a Chat
  • Web Backend with cross-platform cloud data storage and syncing between multiple devices
  • Responsive Design for screen and device independence
  • Access to Native Device Features like native dialogs, the camera/image picker, phone contacts or content sharing

 

V-Play Apps Component Showcase iOSV-Play Apps Component Showcase Android

 

Note: To learn more about how V-Play improves Qt for mobile app developers and a comparison between Qt and V-Play, you can also see this page.

It is possible to use all V-Play features in your Qt Quick application, no matter if it is based on Qt Quick Controls 1 or Qt Quick Controls 2. It is even possible to use the V-Play components in your Qt Widget based app– you can contact us here if you’d like to get an example project how to do this.

All V-Play Components can be freely mixed with other QML Items in your mobile app. To make the learning curve easier, V-Play comes with many open-source demo and example projects you can use as a starting point for your own projects.

However, it is not only possible to create V-Play projects from scratch –you can even use V-Play Engine in your existing Qt Quick applications to take advantage of the included features in your Qt app. This article will guide you through all the important steps to successfully use V-Play in your Qt application:

 

Add V-Play to your existing Qt Installation

If you already have Qt 5 installed on your system you can add V-Play to that installation. Navigate to the root SDK folder of your Qt installation and open the executable called Maintenance Tool. Then follow these steps:

1. Choose the Add or remove components option so the Settings button is shown in the bottom left corner.

qt_install_vplay_1

2. Click the Settings button and in the Settings window, click on the Repositories tab.

qt_install_vplay_2

3. Choose the bottom section User defined repositories and click the Add Repository button. Then enter the URL for your development platform in the text box. It is either:

  • https://sdk.v-play.net/2/windows
  • https://sdk.v-play.net/2/macx
  • https://sdk.v-play.net/2/linux

qt_install_vplay_3

4. Next, confirm the V-Play installation repository with OK and proceed with the Add or remove components option by pressing the Continue button.

qt_install_vplay_1

5. V-Play Engine will now show up in addition to the available Qt modules. Make sure that it is checked in the Package Manager and proceed with the MaintenanceTool to install V-Play.
qt_install_vplay_4
Note: Each V-Play version is compatible with a certain Qt version. For example, the current version 2.12.1 uses Qt 5.9.0. If you are using an older or newer version of Qt at the moment, please also check and install the Qt Kits of the version that is compatible with V-Play at this point. V-Play will only be available with the Build Kits that use the correct Qt version. Please have a look at the V-Play Update Guide to view recent changes and Qt version updates of V-Play, and to find out which Qt version is currently used by the latest V-Play version.

Alternatively, you can also download the V-Play installer which comes with the supported Qt version. You can install side-by-side with Qt in a different directory, they will both work independently from each other then.

6. Choose Done when the installation has finished to close the installer.

qt_install_vplay_5

7. You can now open Qt Creator and log-in to your V-Play Account on the new welcome page, which was added by installing V-Play.

qt_install_vplay_6

8. If you do not own a V-Play Account yet, you can create a new account on the V-Play Website. Open the downloads page and choose Download to open the sign-up popup, which will guide you through the registration. As you already added V-Play to your Qt installation, you can skip the actual download after you’ve completed the sign-up.

qt_install_vplay_7

After you’ve successfully installed the V-Play SDK and logged into your V-Play account with Qt Creator, you can start using V-Play in your projects.

Integrate V-Play in your Qt Quick Project

To correctly link and initialize the V-Play components, some additional steps are required for each project that uses V-Play. First, open your Qt Quick Project with Qt Creator. You can then follow these steps to add V-Play:

1. Modify your .pro file configuration to link the V-Play SDK to your project

CONFIG += v-play

2. Open the main.cpp of your project and initialize V-Play

#include 
#include 
#include  // 1 - include VPApplication

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    VPApplication vplay; // 2 - create VPApplication instance

    QQmlApplicationEngine engine;
    vplay.initialize(&engine); // 3 - initialize V-Play

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    return app.exec();
}

3. In your main.qml, use V-Play GameWindow or App as your main ApplicationWindow (this is required for license validation and other checks)

import VPlay 2.0

GameWindow {
  licenseKey: ""
  // ...
}

Alternatively, you can also add a GameWindowItem as a child to your main window instead:

import VPlay 2.0

ApplicationWindow {
    // ...
    GameWindowItem {
      licenseKey: ""
    }
}

4. Add a new file qml/config.json to your project resources, and configure your correct application id and version:

{
    "title": "V-Play App",
    "identifier": "net.vplay.demoapp",
    "orientation": "auto",
    "versioncode": 1,
    "versionname": "1",
    "stage": "test"
}

5. When activating V-Play with a valid license key, the identifier and version of the config.json needs to match the actual app id and version of your mobile app. For Android apps, the identifier and version are configured in the AndroidManifest.xml:

If your application does not yet have an Android configuration, you can choose the Projects tab in Qt Creator, select the Android Kit, expand the Build Android APK section and choose Create Templates. This will create a default configuration within a new android subfolder of your project, which also includes the manifest.

6. For iOS, you can set the identifier and version in the Info.plist configuration of your app:

CFBundleIdentifiernet.vplay.demoappCFBundleVersion1

This configuration file is created by qmake when building for iOS. You can add the following qmake entry to your *.pro configuration to keep and use a custom iOS configuration for your project:

ios {
   QMAKE_INFO_PLIST = ios/Info.plist
}

Make sure to have the correct setting for all three configuration files. If everything looks good, you are ready to use V-Play in your QML application.

Use V-Play Components in your QML Code

Using V-Play in the QML files of your Qt Quick application is easy. All V-Play types are available as QML components and can be used just like any other Item in QML. Mixing V-Play types with Qt components like Qt Quick Controls 2 is also possible.

For example, if you like to add add an easy-to-use local storage to your application, simply add the V-Play import and use the Storage component of V-Play:

import VPlay 2.0

Storage {
  id: localStorage
  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This example saves a counter property in a local SQLite database. The code loads the previous counter value at app start and automatically stores the counter every time it is changed in the app.

It is even possible to use the WebStorage item instead, which utilizes the V-Play Game Network service to synchronize the stored data across devices of the same user:

import VPlay 2.0

VPlayGameNetwork {
  id: gameNetwork
  gameId: 
  secret: ""
}

WebStorage {
  id: localStorage

  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This is all the code required to include a simple cloud-based data storage.

Other V-Play Components offer the same ease-of-use, for an overview of all available types and features, please have a look at the online documentation of V-Play.

Access Native Device Features in your Qt App

Another big advantage of V-Play is the possibility to use native device features like the camera or confirmation and input dialogs – the NativeUtils component is all you need.

This example shares a custom text and url with the native share dialog on Android and iOS:

import VPlayApps 1.0

App {
AppButton {
  text: "Share!"
  onClicked: nativeUtils.share("V-Play is awesome!", "https://v-play.net")
}
}

Taking a photo with the camera and displaying the shot afterwards is just as simple:

// open camera on button click
AppButton {
  text: "Take Photo"
  onClicked: nativeUtils.displayCameraPicker("Take Photo")
}

// show image after photo was taken
Connections {
  target: nativeUtils
  onCameraPickerFinished: {
    if(accepted) {
      image.source = path
    }
  }
}

AppImage {
  id: image
  anchors.fill: parent
  fillMode: AppImage.PreserveAspectFit
  autoTransform: true
}

When working with dialogs, the V-Play Apps type NativeDialog is also available and offers a more convenient usage to trigger a dialog and handle the response:

AppButton {
   text: "Confirm Dialog"
   onClicked: NativeDialog.confirm("Please Confirm", "Confirm this action?", function(ok) {
     if(ok) {
       // confirmed
     }
     else {
       // not confirmed
     }
   })
 }

Integrate Third-party Services in your Qt Mobile App

V-Play Plugins allow to integrate leading third-party services for ads, analytics, push notifications and more. All native plugins are available to use in your Qt Quick application and offer a convenient way to fast-forward app and game development for iOS and Android.

Since V-Play 2.11.0 it is even possible to fully use V-Play including all monetization plugins with the free Personal Plan of V-Play. Adding services like Google AdMob, Chartboost or Soomla In-App Purchases has never been easier.

plugindemo-admob-android_opt

a. Native Plugin Integration in Qt

With a single import and QML Item, you can for example show an AdMob Banner in your app:

import VPlayPlugins 1.0

AdMobBanner {
  adUnitId: ""
  banner: AdMobBanner.Smart
  anchors.bottom: parent.bottom
}

To actually use the plugin with this simple approach on iOS or Android, a few more steps are required. For example, linking the Android Libraries for Google AdMob with your application requires the following gradle dependency:

allprojects {
  repositories {
      maven { url 'https://sdk.v-play.net/maven/' } // add V-Play repository
  }
}

dependencies {
  compile 'net.vplay.plugins:plugin-admob:2.+' // import admob plugin libraries
}

Just have a look at the plugin documentation of your desired plugin and view the integration steps for more information.

To also prepare the above example for iOS, first copy the GoogleMobileAds.framework from the ios subfolder of the V-Play Plugin Demo on GitHub to a sub-folder called ios within your project. Then add this setting to the qmake configuration in your *.pro file:

ios {
  VPLAY_PLUGINS += admob
}

A short extension to the Project-Info.plist configuration of your iOS app completes the iOS integration steps for using AdMob:

NSAppTransportSecurityNSAllowsArbitraryLoadsNSAllowsArbitraryLoadsForMediaNSAllowsArbitraryLoadsInWebContent

b. Plugin Activation

Monetization plugins are usable with the free version of V-Play. However, without having a valid V-Play License Key set, only trial-modes are available for all plugins. To be able to set the GameWindowItem::licenseKey with a valid key, let’s first create a new key for the app.

After signing in to your V-Play account, you can create as many keys as you want in the License Key Creation section of the Developers Dashboard. This is how it works:

  1. Choose the plugins you want to include in your license key:
    plugin-activation-license-1
  2. Click on “Generate License Key” and set the app identifier &version code of your application. You can see that the AdMob plugin was enabled in this license key:
    plugin-activation-license-2
  3. Copy the generated licenseKey to your GameWindowItem, GameWindow, App component.
    plugin-activation-license-3
  4. You can now fully use the AdMob plugin on both iOS and Android!

This approach is the same for every plugin and each license key you create allows to activate all the plugins you need. If you encounter any issues when using V-Play in your Qt applications, don’t hesitate to contact us at support@v-play.net or in the support forums.

 

 

More Posts Like This

 

Release 2.12.1: Visual Editor & Qt Quick Designer Improvements
V-Play Update 2.12.1: Qt Quick Designer Improvements

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

How to Make a Qt app

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

Release 2_11

WeAreDevelopers Conference App – Open Source & Live Now!

WeAreDevelopers

The post How to Add V-Play to your Qt Mobile App appeared first on V-Play Engine.

The Qt Company Blog: CI Performance, HW and SW changes

$
0
0

This time I’ll cover the topics performance as well as upcoming hardware and software changes.

Performance

You have all noticed that the CI system is behaving poorly to what comes to the performance. Sometimes autotests take over 30 times longer to run compared to a normal situation. Now why is that?

We actually have different kinds of bottlenecks. One is the bandwidth with which the virtual machines (VMs) store local data to their virtual hard drives. The servers on which our virtual machines run have no local hard drives. They instead store all their data on a centralized storage called the Compellent (https://en.wikipedia.org/wiki/Dell_Compellent). So when a VM wants to store data on its virtual hard drive, the host it runs on actually stores the data on the centralized storage.

We have several generations of hardware installed, and they have different speeds on their SAN interface with which they are connected to the Compellent. As your build picks up a server, it can be a new rack server, or it can be an older generation Blade (https://en.wikipedia.org/wiki/Blade_server). Also, all the other VMs on these servers share the same bandwidth, so depending on what the other builds do, your SAN connection can be affected. Sadly, our test of prioritization these VMs, didn’t produce expected results and really didn’t much at all.

These generations of hardware and type of hardware also affect the amount of other VMs the hardware can run simultaneously.  We have Mac mini’s running our macOS builds. Those generally run 1 VM per physical Mac mini. Then we have old Blades that run around 4 VMs per Blade. The latest additions to our hardware pool are dual socket 20 core CPU server racks. Those run up to 26 VMs simultaneously. Running more on the same hardware reduces costs for us, but also increases the odds of one build affecting the next.

Another bottleneck is the Compellent itself. The storage system has 120 + 10 spare hard drives spinning at 15K RPM. However great the IOPS performance is in that system, when we decide to start 200+ VMs in the CI, it goes down to its knees. And when it does that, all builds and autotest run are affected. You could think of this as you having 2 computers at home sharing the same spinning disk.

Now that all is grim and morbid, let’s continue with the good news.

Upcoming hardware changes

We’re replacing the current hardware stack with a completely new one. The parts have arrived and are being installed as I type right now. Not only did we acquire new hardware that is faster, but we also redesigned the building concepts so that they utilize the hardware differently. The new hardware can be easily expanded and we designed the system so, that we don’t produce bottlenecks even when expanding it.

Before I go in to details, I need to explain a bit how the CI systems generally works. So, heading off on a tangent here! When developer stages a commit in Gerrit (codereview.qt-project.org), the CI picks it (or multiple commits) up. The CI or Coin as the piece of software is figuratively called, generates work items based on the data received. If let’s say the commits was for QtDeclarative, Coin now produces work items for itself to handle that QtDeclarative build on top of circa 30 different target platforms. Each of these work items depend on QtBase to be built. So now Coin also creates these circa 30 work items for QtBase. As QtDeclarative is built on top of the current qt5.git’s QtBase, it means in normal situations that QtBase has already been built previously. These artifacts have been stored by Coin and can now be reused. So instead of rebuilding QtBase for QtDeclarative, Coin simply checks its storage and links the previous builds to the current one and promptly continues with building QtDeclarative. This is the major change in how we build Qt nowadays compared to old days with Jenkins where every build always rebuilt the entire stack up to its point. You may read more about it in this blog post.

Continuing into more details. Whenever Coin starts to build something, it needs a VM for the task. We have “templates” in vSphere that represent different operating systems. They are virtual machines that have operating systems installed in them along with some basic things set up like user accounts and SSHD etc. Then they have been shut down ready to be used. Now when a build needs a VM, it clones a template VM and launches the clone. The clone is actually only a linked clone. This means that we don’t really clone anything, but only create a new virtual machine that links or points to the original one. Now, when the new clone is powered on, it _reads_ from the original template, but all changes are _written_ to its own file called the ‘delta image’. This way a new virtual machine only takes up space that’s equal to the amount of data it has written.

Going back to the template again. I said that it only contained basic things like user accounts and SSHD. A build surely needs more than that. We need Visual Studios, MINGW, CMake, OpenSSH, XCodes, MySQL etc. installed as well. Those things are ‘provisioned’. In qt5.git we have a folder structure under /coin/provisioning that contains scripts that install these things. As there is no point in running them every time for every VM, we create yet another set of templates that contain these pre-installed. We call these TIER2 images (or templates) vs TIER1 images being the vanilla distros containing only the basic things enabling us to even use them.

TIER2 images work pretty much the same way as QtBase was a dependency for QtDeclarative. Each build we trigger checks the current configurations scripts from qt5.git and makes a SHA from the folder structure. This SHA is used in naming the TIER2 image. If the content we want to install has changed, we have to regenerate a new TIER2 image. This is called the provisioning and it’s triggered automatically if the requested TIER2 image doesn’t exist.

Now, let’s go back on track and talk about the hardware changes.

The new servers have local SSD drives that work as the storage for the VMs instead of a centralized storage. This removes the bottleneck of a SAN network and reduces latencies while at it. And while being SSD drives, they are faster by design to what the Compellent used to be with its rotating discs. We still have a Compellent, but this time it’s filled with SSD drives. While the VMs use local SSD drives on the hosts themselves to store data, reading is a more complicated thing.

The TIER1 and TIER2 images described earlier are still stored centralized on the Compellent. This saves us the transferring of the images to each server serving as the host for the VMs. These TIER2 images are cloned as normal, and then the read operations point to the source. This would cause the same situation as with the old system where everything is read from the Compellent, but we are relying on caches to work in our favor here. The TIER2 images are shared via NFS, and the host OS on the server is equipped with a 500 GB NFS cache. So, whenever something is read from the TIER2, it is in fact now read from the NFS cache that’s local. All this is obviously assuming that the data has been read once previously. In practice, if a TIER2 image gets updated, the data has to be read from the centralized storage once, and then it’s in cache for the rest of the builds. We also have to remember that not the entire TIER2 image is read whenever data is read. If a build requests openssh.so, only those blocks containing the file are read.

We also need the Compellent to provide us with redundancy for critical systems and a huge data storage for data that can’t be stored distributed. Critical systems include our own infrastructure and the storage is needed for all kinds of data including our release packages, install packages, distro ISO images etc. So even if we had a good mechanism to distribute the entire TIER1 and TIER2 load to the servers themselves, currently there is no need for it and the Compellent serves this need more than well right now.

The new hardware infrastructure will include new switches and firewalls as well. And all these are being set up in new premises, so everything is new. With this we will expect a few maintenance breaks during the upcoming months where services are being handed over from one site to the other. The down times should be relatively low, since all data is being transferred beforehand and not during the down times.

Software changes

Currently Coin is using VMware’s vSphere technology to create and run VMs. That’s about to change. Our new spinal cord will be based on OpenNebula (https://opennebula.org/). The swap to this new technology will come at the same time we switch to the new facility with the new hardware. We’ve been working hard to get the robustness and reliability up, matching or even exceeding the one provided by VMware’s products. With open source non-proprietary code we can go deep into the root causes of problems and fix drivers if that’s needed to make our VMs run smoothly without hick-ups. With OpenNebula being KVM based, we can expect new distro support to be available sooner as well. No longer do we need to fall back to saying a new macOS can’t be installed because VMware doesn’t support it. Let’s hope I can hold up to this promise or claim 😉

Performance wise the comparison between VMware and OpenNebula is a bit unfair since they use different underlying hardware, but we can say that builds aren’t going to get any slower by the looks of it.

We’re also working on getting all of our distros more provision scripted. This will make it a lot easier for anyone ( yes, this includes you ) to upgrade the software that’s being run on the VMs. Anyone can access qt5.git/coin/provisioning and modify / add scripts there. Normal code review procedures apply and TIER2 images get updated.

Internally we’ve had 3 different Jenkins instances in the past. We had one for CI that got replaced by Coin a year ago. The remaining two were for release package creation, Creator builds and few others, and the second one was for RTA standing for Release Test Automation where we verified the packages to really install something and examples working etc. Those two Jenkins instances are planned to be merged with Coin at some point in time, but for the time being they are going to stay there for a while. However, we’re improving the backend of how they receive their VMs. They currently compete with Coin in getting hardware resources. In the next weeks, this is going to be changed so that Coin creates these VMs. This takes away the race conditions between two back ends, but also gives our Jenkins instances “support” for OpenNebula VMs. Even if this does not show up directly to you as CI users, it should show up with slightly more reliable VM dedication, more effective cleanup of VMs, and at least from the technical perspective we should be more capable of producing packages faster.

 

The post CI Performance, HW and SW changes appeared first on Qt Blog.

V-Play Game Engine: How to Add V-Play to your Qt Mobile App

$
0
0

If you have an existing Qt Mobile App, you can extend your Qt application with V-Play components to improve your mobile app experience. You can mix all of the V-Play and Qt components and have them combined in your project. And the best thing is, you do not need to rewrite your existing Qt application for this! Instead, you can mix the V-Play and Qt components freely in your mobile app. So if you need for example push notifications in your Qt app which uses Qt Quick Controls 2, you can use your existing code and simply add the Google Cloud Messaging (Firebase) push notification plugin by V-Play like this:

import QtQuick 2.0
import QtQuick.Controls 2.0
import VPlayPlugins 2.0

ApplicationWindow {

  GoogleCloudMessaging {
    onNotificationReceived: {
      console.debug("Received push notification: ", JSON.stringify(data))
    }
  }
}

 

This blog post is about the exact steps how you can add V-Play to your Qt Mobile App. Let’s get started.

How does V-Play Improve Qt?

The V-Play SDK for cross-platform apps and games comes with many components to make mobile development with Qt easier. V-Play extends Qt for mobile app development and offers for example:

  • Native look and feel for iOS and Android
  • Monetization with Ads and In-App Purchases
  • Analytics for User Behavior and Crash Reports
  • Push Notifications– triggered locally or by a server
  • Social Engagement with native sharing and Facebook integration
  • Gamification with Highscores, Achievements, Friend System and a Chat
  • Web Backend with cross-platform cloud data storage and syncing between multiple devices
  • Responsive Design for screen and device independence
  • Access to Native Device Features like native dialogs, the camera/image picker, phone contacts or content sharing

 

V-Play Apps Component Showcase iOSV-Play Apps Component Showcase Android

 

Note: To learn more about how V-Play improves Qt for mobile app developers and a comparison between Qt and V-Play, you can also see this page.

It is possible to use all V-Play features in your Qt Quick application, no matter if it is based on Qt Quick Controls 1 or Qt Quick Controls 2. It is even possible to use the V-Play components in your Qt Widget based app– you can contact us here if you’d like to get an example project how to do this.

All V-Play Components can be freely mixed with other QML Items in your mobile app. To make the learning curve easier, V-Play comes with many open-source demo and example projects you can use as a starting point for your own projects.

However, it is not only possible to create V-Play projects from scratch –you can even use V-Play Engine in your existing Qt Quick applications to take advantage of the included features in your Qt app. This article will guide you through all the important steps to successfully use V-Play in your Qt application:

 

Add V-Play to your existing Qt Installation

If you already have Qt 5 installed on your system you can add V-Play to that installation. Navigate to the root SDK folder of your Qt installation and open the executable called Maintenance Tool. Then follow these steps:

1. Choose the Add or remove components option so the Settings button is shown in the bottom left corner.

qt_install_vplay_1

2. Click the Settings button and in the Settings window, click on the Repositories tab.

qt_install_vplay_2

3. Choose the bottom section User defined repositories and click the Add Repository button. Then enter the URL for your development platform in the text box. It is either:

  • https://sdk.v-play.net/2/windows
  • https://sdk.v-play.net/2/macx
  • https://sdk.v-play.net/2/linux

qt_install_vplay_3

4. Next, confirm the V-Play installation repository with OK and proceed with the Add or remove components option by pressing the Continue button.

qt_install_vplay_1

5. V-Play Engine will now show up in addition to the available Qt modules. Make sure that it is checked in the Package Manager and proceed with the MaintenanceTool to install V-Play.
qt_install_vplay_4
Note: Each V-Play version is compatible with a certain Qt version. For example, the current version 2.12.1 uses Qt 5.9.0. If you are using an older or newer version of Qt at the moment, please also check and install the Qt Kits of the version that is compatible with V-Play at this point. V-Play will only be available with the Build Kits that use the correct Qt version. Please have a look at the V-Play Update Guide to view recent changes and Qt version updates of V-Play, and to find out which Qt version is currently used by the latest V-Play version.

Alternatively, you can also download the V-Play installer which comes with the supported Qt version. You can install side-by-side with Qt in a different directory, they will both work independently from each other then.

6. Choose Done when the installation has finished to close the installer.

qt_install_vplay_5

7. You can now open Qt Creator and log-in to your V-Play Account on the new welcome page, which was added by installing V-Play.

qt_install_vplay_6

8. If you do not own a V-Play Account yet, you can create a new account on the V-Play Website. Open the downloads page and choose Download to open the sign-up popup, which will guide you through the registration. As you already added V-Play to your Qt installation, you can skip the actual download after you’ve completed the sign-up.

qt_install_vplay_7

After you’ve successfully installed the V-Play SDK and logged into your V-Play account with Qt Creator, you can start using V-Play in your projects.

Integrate V-Play in your Qt Quick Project

To correctly link and initialize the V-Play components, some additional steps are required for each project that uses V-Play. First, open your Qt Quick Project with Qt Creator. You can then follow these steps to add V-Play:

1. Modify your .pro file configuration to link the V-Play SDK to your project

CONFIG += v-play

2. Open the main.cpp of your project and initialize V-Play

#include 
#include 
#include  // 1 - include VPApplication

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    VPApplication vplay; // 2 - create VPApplication instance

    QQmlApplicationEngine engine;
    vplay.initialize(&engine); // 3 - initialize V-Play

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    return app.exec();
}

3. In your main.qml, use V-Play GameWindow or App as your main ApplicationWindow (this is required for license validation and other checks)

import VPlay 2.0

GameWindow {
  licenseKey: ""
  // ...
}

Alternatively, you can also add a GameWindowItem as a child to your main window instead:

import VPlay 2.0

ApplicationWindow {
    // ...
    GameWindowItem {
      licenseKey: ""
    }
}

4. Add a new file qml/config.json to your project resources, and configure your correct application id and version:

{
    "title": "V-Play App",
    "identifier": "net.vplay.demoapp",
    "orientation": "auto",
    "versioncode": 1,
    "versionname": "1",
    "stage": "test"
}

5. When activating V-Play with a valid license key, the identifier and version of the config.json needs to match the actual app id and version of your mobile app. For Android apps, the identifier and version are configured in the AndroidManifest.xml:

If your application does not yet have an Android configuration, you can choose the Projects tab in Qt Creator, select the Android Kit, expand the Build Android APK section and choose Create Templates. This will create a default configuration within a new android subfolder of your project, which also includes the manifest.

6. For iOS, you can set the identifier and version in the Info.plist configuration of your app:

CFBundleIdentifiernet.vplay.demoappCFBundleVersion1

This configuration file is created by qmake when building for iOS. You can add the following qmake entry to your *.pro configuration to keep and use a custom iOS configuration for your project:

ios {
   QMAKE_INFO_PLIST = ios/Info.plist
}

Make sure to have the correct setting for all three configuration files. If everything looks good, you are ready to use V-Play in your QML application.

Use V-Play Components in your QML Code

Using V-Play in the QML files of your Qt Quick application is easy. All V-Play types are available as QML components and can be used just like any other Item in QML. Mixing V-Play types with Qt components like Qt Quick Controls 2 is also possible.

For example, if you like to add add an easy-to-use local storage to your application, simply add the V-Play import and use the Storage component of V-Play:

import VPlay 2.0

Storage {
  id: localStorage
  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This example saves a counter property in a local SQLite database. The code loads the previous counter value at app start and automatically stores the counter every time it is changed in the app.

It is even possible to use the WebStorage item instead, which utilizes the V-Play Game Network service to synchronize the stored data across devices of the same user:

import VPlay 2.0

VPlayGameNetwork {
  id: gameNetwork
  gameId: 
  secret: ""
}

WebStorage {
  id: localStorage

  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This is all the code required to include a simple cloud-based data storage.

Other V-Play Components offer the same ease-of-use, for an overview of all available types and features, please have a look at the online documentation of V-Play.

Access Native Device Features in your Qt App

Another big advantage of V-Play is the possibility to use native device features like the camera or confirmation and input dialogs – the NativeUtils component is all you need.

This example shares a custom text and url with the native share dialog on Android and iOS:

import VPlayApps 1.0

App {
AppButton {
  text: "Share!"
  onClicked: nativeUtils.share("V-Play is awesome!", "https://v-play.net")
}
}

Taking a photo with the camera and displaying the shot afterwards is just as simple:

// open camera on button click
AppButton {
  text: "Take Photo"
  onClicked: nativeUtils.displayCameraPicker("Take Photo")
}

// show image after photo was taken
Connections {
  target: nativeUtils
  onCameraPickerFinished: {
    if(accepted) {
      image.source = path
    }
  }
}

AppImage {
  id: image
  anchors.fill: parent
  fillMode: AppImage.PreserveAspectFit
  autoTransform: true
}

When working with dialogs, the V-Play Apps type NativeDialog is also available and offers a more convenient usage to trigger a dialog and handle the response:

AppButton {
   text: "Confirm Dialog"
   onClicked: NativeDialog.confirm("Please Confirm", "Confirm this action?", function(ok) {
     if(ok) {
       // confirmed
     }
     else {
       // not confirmed
     }
   })
 }

Integrate Third-party Services in your Qt Mobile App

V-Play Plugins allow to integrate leading third-party services for ads, analytics, push notifications and more. All native plugins are available to use in your Qt Quick application and offer a convenient way to fast-forward app and game development for iOS and Android.

Since V-Play 2.11.0 it is even possible to fully use V-Play including all monetization plugins with the free Personal Plan of V-Play. Adding services like Google AdMob, Chartboost or Soomla In-App Purchases has never been easier.

plugindemo-admob-android_opt

a. Native Plugin Integration in Qt

With a single import and QML Item, you can for example show an AdMob Banner in your app:

import VPlayPlugins 1.0

AdMobBanner {
  adUnitId: ""
  banner: AdMobBanner.Smart
  anchors.bottom: parent.bottom
}

To actually use the plugin with this simple approach on iOS or Android, a few more steps are required. For example, linking the Android Libraries for Google AdMob with your application requires the following gradle dependency:

allprojects {
  repositories {
      maven { url 'https://sdk.v-play.net/maven/' } // add V-Play repository
  }
}

dependencies {
  compile 'net.vplay.plugins:plugin-admob:2.+' // import admob plugin libraries
}

Just have a look at the plugin documentation of your desired plugin and view the integration steps for more information.

To also prepare the above example for iOS, first copy the GoogleMobileAds.framework from the ios subfolder of the V-Play Plugin Demo on GitHub to a sub-folder called ios within your project. Then add this setting to the qmake configuration in your *.pro file:

ios {
  VPLAY_PLUGINS += admob
}

A short extension to the Project-Info.plist configuration of your iOS app completes the iOS integration steps for using AdMob:

NSAppTransportSecurityNSAllowsArbitraryLoadsNSAllowsArbitraryLoadsForMediaNSAllowsArbitraryLoadsInWebContent

b. Plugin Activation

Monetization plugins are usable with the free version of V-Play. However, without having a valid V-Play License Key set, only trial-modes are available for all plugins. To be able to set the GameWindowItem::licenseKey with a valid key, let’s first create a new key for the app.

After signing in to your V-Play account, you can create as many keys as you want in the License Key Creation section of the Developers Dashboard. This is how it works:

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

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

3. Copy the generated licenseKey to your GameWindowItem, GameWindow, or App component.
plugin-activation-license-3

4. You can now fully use the AdMob plugin on both iOS and Android!

This approach is the same for every plugin and each license key you create allows to activate all the plugins you need. If you encounter any issues when using V-Play in your Qt applications, don’t hesitate to contact us at support@v-play.net or in the support forums.

 

 

More Posts Like This

 

Release 2.12.1: Visual Editor & Qt Quick Designer Improvements
V-Play Update 2.12.1: Qt Quick Designer Improvements

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

How to Make a Qt app

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

Release 2_11

WeAreDevelopers Conference App – Open Source & Live Now!

WeAreDevelopers

The post How to Add V-Play to your Qt Mobile App appeared first on V-Play Engine.

Cutelyst Framework: Cutelyst 1.8.0 released

$
0
0

Cutelyst the Qt Web Framework, has another stable release, this release is mostly filled with bug fixes, the commit log is rather small.

It got fixes on Cutelyst-WSGI to properly work on Windows, QtCreator integration fixes, properly installing dll's on Windows, fix returning the right status from views (this allows you to know if for example View::Email sent the email with success).

Cutelyst is cross-platform, the code builds on CI running on Windows, OSX and Linux, but first class is still UNIX systems, as I don't use Windows, nor have a VM with development configured so I have only ensured it build fine on AppVeyor, Aurel Branzeanu provided some pull requests to improve that, if you also happen to have experience with CMake, MSVC and Windows please help me review or do other pull requests.

The release also got two API additions:

  • Context::setStash(QString, ParamsMultiMap), ParamsMultiMap also known as QMap is a type used on HTTP query and body parameters, having this method avoid writing ugly code full of QVariant::fromValue()
  • Application::pathTo(QString), instead of using the QStringList version which join the strings to build a path (like the Catalyst does), this just gets the string as you would pass to a QFile, that in turn deals with platform issues.

I'm a bit busy with html-qt and also planning a rewrite of simplemail-qt to be async, so expect smaller Cutelyst releases :)

Again help is welcome (specially on Windows usage).

Get it here https://github.com/cutelyst/cutelyst/archive/v1.8.0.tar.gz

The Qt Company Blog: QML vs. HTML5

$
0
0

Guest post by Stefan Larndorfer at sequality

Mobile devices have set the standard in terms of responsiveness and user-friendliness for HMIs across industries. Manufacturers of cars, medical equipment, industrial automation systems and consumer electronics now want to replicate this great user experience for their embedded devices. To find out which technology strategy we should select we set up a test where one of our developers was allocated 160 hours to create a demo application of an embedded system using Qt & QML and same number of hours to create the very equivalent application using HTML5.

Over the past year, more and more customers have been asking us at sequality if they should use HTML5 or Qt using the QML declarative UI language to develop software for embedded devices.

In order to give the most objective advice to our customers, we decided set up a test: give the same developer 160 hours to create a demo of an embedded system using Qt and 160 hours to create the demo using HTML5. These demos would show exactly how the two technologies compare – in terms of development, performance, and sustainability – when used to create the same product. The developer tasked with creating the demos was experienced with using HMTL5 and C++, but had little experience creating user interfaces using Qt and QML. The demos were created independently without any vendor input.

QML vs. HTML 5 test results

The demos showed that although the same amount of development time was spent on both versions, implementation with Qt QML delivered a more functional and complete user interface than the HTML5 version. The testing and debugging process was found to be more straightforward with Qt QML, not least because it didn’t need testing on multiple browsers. In general, the Qt QML version responded more quickly and enabled features, like keyboard and multi-touch, that were not supported by HTML5 without additional implementation.

From an end-user perspective, the Qt QML version behaved exactly as expected regardless of the browser or screen being used to view it.

This is because Qt based applications are compiled for the target, meaning that in terms of user observation, they behave exactly the same no matter which platform they run on. HTML5-based applications, on the other hand, run on the browser of the target, for example Chrome, meaning different platforms can show different behavior as the browser might use different rendering engines depending on the platform.

In terms of the sustainability of the technology, Qt QML is a mature technology that has been developed to ensure backwards compatibility. The AngularJS framework for HTML5 is relatively new, and a valid concern is whether it will be replaced by a new framework in the future. In contrast, QML is very likely to still be supported in 5 years.

Overall, Sequality found that the development of the applications was very different and one needs to carefully consider the benefits and drawbacks of each technology before deciding which one to use.

If the outcome of such an evaluation does not show major advantages of a particular technology, we would recommend Qt over HTML5. In our showcase, the Qt based application was generally faster, more responsive, and easier to implement.

Want to know more?

Download the complete white paper

Visit us at our booth at Qt World Summit 2017.

 

About

Stefan Larndofer is the CEO and Founder of sequality software engineering.Sequalityprovides high-quality software engineering services, specializing in user interaction (graphical user interfaces, touch screen software, C++/Qt, embedded Linux) technology. Sequality delivers software with a great user experience, inspired by mobile devices. www.sequality.at

The post QML vs. HTML5 appeared first on Qt Blog.

KDAB on Qt: hotspot – a GUI for the Linux perf profiler

V-Play Game Engine: Release 2.12.2: Firebase Realtime Listeners & Qt Creator Designer Icons

$
0
0

V-Play 2.12.2 adds support for Realtime Database Listeners to the Firebase Plugin, which allows your app to get notified whenever your data changes. In addition, the recently improved Qt Creator Designer now comes with icons for all V-Play types to let you distinguish the different components more easily.

V-Play 2.12.2 comes as a free update for all V-Play developers.

Firebase Realtime Database Listeners

Use the Firebase Plugin to store and sync data in realtime across all clients with the Firebase NoSQL Cloud Database.

update-2122-firebase-database-data

The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and changes to the database are propagated to other clients in real time. This update adds new properties and signals to the FirebaseDatabase item, which you can use to add listeners for certain database entries. With the Firebase Realtime Listeners, your app is notified immediately after your data in the cloud gets changed – no matter which device, user or application changed the value.

The following example uses the FirebaseDatabase::realtimeValueKeys property and FirebaseDatabase::realtimeValueChanged() signal to keep track of a public database entry newstext:

import VPlayPlugins 1.0
import VPlayApps 1.0

App {

  FirebaseDatabase {
    realtimeValueKeys: ["public/newstext"]
    onRealtimeValueChanged: {
      if(success) {
        console.debug("Public Realtime Value '" + key + "' changed to '" + value + "'")

        // if newstext got changed -> update AppText to show news
        if(key === "newstext")
          news.text = value
      }
      else {
        console.debug("Error with message: " + value)
      }
    }
  }

  AppText {
    id: news
    text: "" // no news by default, news is loaded from database and always up-to-date
  }
}

This example already shows how powerful the new Firebase Realtime Listeners can be. As soon as the newstext entry changes in the database, all clients will get notified and replace the old news. As Firebase also supports authentication and user access rules, you could even create a real-time chat with this new feature.

 

Firebase Realtime Database vs. V-Play WebStorage

V-Play also comes with its own easy to use WebStorage, which connects to the V-Play backend hosted on Amazon servers (and also available on-premise for Enterprise Customers). 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).

So what’s the difference between Firebase and V-Play Cloud Storage?

V-Play WebStorage has these advantages compared to FireBase:

  • All platforms: V-Play WebStorage works not only on iOS & Android, but on all supported V-Play platforms. This also includes Desktop and embedded systems.
  • No authentication required: With V-Play WebStorage, you can access per-user data without your users having to log in.
  • Late authentication: Your users can authenticate later but start saving user data before this authentication. Once they do authenticate, their data is kept and merged to the new user profile.
  • Advanced merge conflict management: With V-Play WebStorage, you can modify the default merge conflict rules that may occur if your user stores to the same key from multiple devices at the same time. In Firebase, the last write is used, whereas in V-Play a merging of the data is tried first. Additionally, you can customize the merge behavior to your requirements with the WebStorage::dataConflictStrategy property.

These are the same features like Firebase has:

  • Offline usage: You can write and read values from the storage even if the user is offline. As soon as the user has Internet Connection again, the locally cached data is synchronized with the cloud.
  • Data synchronization: If the same user is authenticated on multiple devices, a change in the data is forwarded to all connected devices in realtime. This way, the user has the same data across all devices, even across platforms.

There is one restriction with WebStorage though: user access rights. With V-Play WebStorage, there are 2 access rules: per-app and per-user data. The per-user data cannot be shared with other users, and the per-app data cannot restrict its access to certain users. You can work around this restriction by adding custom fields to your per-app data that specifies to which user the app-wide data shall be available for. However, if you have advanced requirements for user rights & data management, the Firebase Realtime Database is the better solution as you can define access rules comprehensively.

For a quick summary: if you are looking for a simple key-value store in the cloud that gets synced to multiple devices, you are better off with the V-Play WebStorage.

 

Note: If you want to build a social messaging app, a chat app, or any application where you’d like to allow your users to become friends with each other, user authentication and send messages, the V-Play Backend (using Game Network + Multiplayer functionality) is an option you can use! It features a friend system, realtime chat with push notifications, cloud storage, and more. Contact us here if you’d like to have a demo project using all these features.

 

Qt Quick Designer Icons

Since V-Play 2.12.1, it is possible to use V-Play Components with the improved Qt Quick Designer of Qt Creator 4.3. To help you get more out of the designer and quickly find the components you need, this update adds icons for all items available with the Qt Quick Designer:

update-2122-designer-icons

For a quick guide how to use the new Qt Quick Designer with V-Play, have a look at our tutorial video:

 

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

V-Play Update in Maintenance Tool

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.12.2!

 

 

More Posts Like This

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

How to Make a Qt app

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

Release 2_11

WeAreDevelopers Conference App – Open Source & Live Now!

WeAreDevelopers

The post Release 2.12.2: Firebase Realtime Listeners & Qt Creator Designer Icons appeared first on V-Play Engine.


The Qt Company Blog: Qt Visual Studio Tools Version 2.1.2 Beta

$
0
0

After some time working on the integration with Visual Studio 2017, we would now like to make the current status of this work in progress available to users of VS 2017.

We have released a new beta of the Qt Visual Studio Tools, corresponding to version 2.1.2. It is available in the Visual Studio Marketplace and can be installed directly from within Visual Studio 2017 (through the ‘Tools > Extensions and Updates…’ menu). Alternatively, it can be downloaded from this page.

Relative to the previous 2.1.1 beta, version 2.1.2 includes some additional bug fixes:

  • Add new item with VS does not generate the moc
    (reported as QTVSADDINBUG-396)
  • Run moc’ing at every build even if there is no file changed
    (QTVSADDINBUG-410)
  • 2.1.1-beta VSIX installer fails
    (QTVSADDINBUG-460)
  • When opening a pro file with Qt 5.9, unable to create the vcxproj file
    (QTVSADDINBUG-472)

For the moment, version 2.1.2 is only available for Visual Studio 2017. There is also one noteworthy issue: Qt projects will be configured with version 8.1 of the Windows SDK, and building will result in an error if the SDK is not installed. The status of this issue and description of a workaround can be found here.

We will continue working on this and other issues and suggestions reported through bugreports.qt.io with a view to providing an official release of the Qt Visual Studio Tools, which will also be available for Visual Studio 2013 and 2015.

The post Qt Visual Studio Tools Version 2.1.2 Beta appeared first on Qt Blog.

The Qt Company Blog: Renewed Qt Support Services

$
0
0

The Qt Company support team works hand-in-hand with Qt R&D developers and we are 100% committed to ensuring that you succeed with your project.

We have recently launched new support services and in this blog post I would like to introduce you to the new offering and in addition give you an introduction to the Qt Support team. The new support offering has been modified and we have launched two different levels of support, which have been named ‘Standard’ and ‘Premium’ Support. In addition to our standard offering, all 5.x releases can be extended with Extended Support.

The Team

We have a team of experienced software engineers working in Qt Support. All of us have a long background in software development and with Qt. Currently we are working from three different locations, Oulu, Oslo and Santa Clara and we are considering expanding our locations to Tokyo, Berlin and Boston during this year.
With new locations covering multiple time zones, we will be able to give even quicker responses to our Asian and US based customers.
The Qt Support team is part of Qt R&D and we work closely with the development teams. Being closely connected with where the development happens means that we are always up to date with the latest new features and we know the best practices on how to leverage these new features. For you as a Qt user, it also means that if you have an issue, we know who to contact and we can solve your challenges quickly.

Standard and Premium Support

Earlier we had three different support levels, but now we have reduced those to two and changed the names of two levels moving forwards. The previously known Silver Support will now be called ‘Standard Support’. The SLA terms are still the same as earlier with Silver Support. The new Support plan name, Standard Support, will be visible to you in your Qt Account.
Gold support has been renamed to Premium Support. Current Gold support customers will continue to get their service under the old Gold Support SLA.
The entry level support, Bronze Support has been phased out.

All Qt customers with an active license (except for start-up licensees) are entitled to Qt Support. Standard Support is bundled with all new Qt licenses. It comes with a two business day response time guaranteed and provides you priority to the customer reported Qt errors.
If a more personal and quicker support service is required, the Premium Support is the way to go. With Premium Support, we offer a dedicated support person and the possibility to utilize online chat through remote desktop connection. With Premium Support, our target is to respond within the same workday as the issue is reported. Also, reported bugs and other issues are treated with even higher priority than with Standard Support. With Premium Support, we also analyze the complete customer application code base and debug that instead of requiring a minimal test application where the issue is reproduced.

Support Level Details
Standard SupportPremium Support
Support on Qt APIs, functions, methods and programming techniquesYesYes
Guaranteed response timeWithin 48 business hoursWithin 24 business hours
Bug fix prioritization*PriorityHigh Priority
Support on using Qt for your specific projectYes
Dedicated Qt Support contactYes
Instant messaging with dedicated support contactYes

*Within reasonable efforts, not every bug is fixable as part of Qt Support

Extended Support

Qt 5.4 and later releases are currently supported by default. If support is required for older and unsupported Qt 5.x releases the support can be separately purchased as Extended Support. This will allow the customer to ask questions and report issues occurring on these older Qt versions – in the same way as if the phased out Qt version was still officially supported.
By default, releases from Qt 5.6 and onward are supported for one year and LTS releases are supported for three years starting from the 5.x.0 release.

Support periods for Qt 5.x releases
Qt VersionStandard Support UntilExtended Support Available
5.0.x – 5.3.xSupport already ended.Yes
5.4.x01.07.2017Yes
5.5.x16.03.2018Yes
5.6.x (LTS)16.03.2019Yes
5.7.x16.06.2017Yes
5.8.x23.01.2018Yes
5.9.x (LTS)31.05.2020Yes

More information regarding the different support levels can be found on the Qt Support pages.
Both Extended Support and Premium Support upgrades are targeted for complete development teams.

The Help We Provide

In most cases, Support provides a fix or a workaround for the reported issue. The remaining issues are then followed up by our development teams. Qt Support flags these bugs as being originating from commercial customer and thus gets higher priority when R&D prioritizes bugs to be fixed. Therefore, it is important that all the bugs that the commercial Qt customers encounter are also reported to the Qt Support team.

Even though helping customers tackle Qt bugs is a prominent function of the support team, we also do a lot more. Most questions sent to Support are actually not related to bugs, but rather related to finding optimal coding solutions for the problems customers are facing in their code. We have also been compiling a Qt Support FAQ page, which deals with the most common issues. The Qt Support FAQ is accessible through your Qt Account.

We have been measuring Qt support customer satisfaction for many years now and we have always had a high rating. 9/10 customers have been satisfied or very satisfied with our service. Our main target is to keep our customers happy and productive with Qt. The future of our framework relies on successful projects and therefore we put a lot of effort into providing the best support possible.

You can find more information about Qt Support on the support pages or via Qt Account and we are also more than happy to provide you with a quote. Please do contact us if you have any questions regarding our offering.

The post Renewed Qt Support Services appeared first on Qt Blog.

V-Play Game Engine: How to Add V-Play to your Qt Mobile App

$
0
0

If you have an existing Qt Mobile App, you can extend your Qt application with V-Play components to improve your mobile app experience. You can mix all of the V-Play and Qt components and have them combined in your project. And the best thing is, you do not need to rewrite your existing Qt application for this! Instead, you can mix the V-Play and Qt components freely in your mobile app. So if you need for example push notifications in your Qt app which uses Qt Quick Controls 2, you can use your existing code and simply add the Google Cloud Messaging (Firebase) push notification plugin by V-Play like this:

import QtQuick 2.0
import QtQuick.Controls 2.0
import VPlayPlugins 2.0

ApplicationWindow {

  GoogleCloudMessaging {
    onNotificationReceived: {
      console.debug("Received push notification: ", JSON.stringify(data))
    }
  }
}

 

This blog post is about the exact steps how you can add V-Play to your Qt Mobile App. Let’s get started.

How does V-Play Improve Qt?

The V-Play SDK for cross-platform apps and games comes with many components to make mobile development with Qt easier. V-Play extends Qt for mobile app development and offers for example:

  • Native look and feel for iOS and Android
  • Monetization with Ads and In-App Purchases
  • Analytics for User Behavior and Crash Reports
  • Push Notifications– triggered locally or by a server
  • Social Engagement with native sharing and Facebook integration
  • Gamification with Highscores, Achievements, Friend System and a Chat
  • Web Backend with cross-platform cloud data storage and syncing between multiple devices
  • Responsive Design for screen and device independence
  • Access to Native Device Features like native dialogs, the camera/image picker, phone contacts or content sharing

 

V-Play Apps Component Showcase iOSV-Play Apps Component Showcase Android

 

Note: To learn more about how V-Play improves Qt for mobile app developers and a comparison between Qt and V-Play, you can also see this page.

It is possible to use all V-Play features in your Qt Quick application, no matter if it is based on Qt Quick Controls 1 or Qt Quick Controls 2. It is even possible to use the V-Play components in your Qt Widget based app– you can contact us here if you’d like to get an example project how to do this.

All V-Play Components can be freely mixed with other QML Items in your mobile app. To make the learning curve easier, V-Play comes with many open-source demo and example projects you can use as a starting point for your own projects.

However, it is not only possible to create V-Play projects from scratch –you can even use V-Play Engine in your existing Qt Quick applications to take advantage of the included features in your Qt app. This article will guide you through all the important steps to successfully use V-Play in your Qt application:

 

Add V-Play to your existing Qt Installation

If you already have Qt 5 installed on your system you can add V-Play to that installation. Navigate to the root SDK folder of your Qt installation and open the executable called Maintenance Tool. Then follow these steps:

1. Choose the Add or remove components option so the Settings button is shown in the bottom left corner.

qt_install_vplay_1

2. Click the Settings button and in the Settings window, click on the Repositories tab.

qt_install_vplay_2

3. Choose the bottom section User defined repositories and click the Add Repository button. Then enter the URL for your development platform in the text box. It is either:

  • https://sdk.v-play.net/2/windows
  • https://sdk.v-play.net/2/macx
  • https://sdk.v-play.net/2/linux

qt_install_vplay_3

4. Next, confirm the V-Play installation repository with OK and proceed with the Add or remove components option by pressing the Continue button.

qt_install_vplay_1

5. V-Play Engine will now show up in addition to the available Qt modules. Make sure that it is checked in the Package Manager and proceed with the MaintenanceTool to install V-Play.
qt_install_vplay_4
Note: Each V-Play version is compatible with a certain Qt version. For example, the current version 2.12.1 uses Qt 5.9.0. If you are using an older or newer version of Qt at the moment, please also check and install the Qt Kits of the version that is compatible with V-Play at this point. V-Play will only be available with the Build Kits that use the correct Qt version. Please have a look at the V-Play Update Guide to view recent changes and Qt version updates of V-Play, and to find out which Qt version is currently used by the latest V-Play version.

Alternatively, you can also download the V-Play installer which comes with the supported Qt version. You can install side-by-side with Qt in a different directory, they will both work independently from each other then.

6. Choose Done when the installation has finished to close the installer.

qt_install_vplay_5

7. You can now open Qt Creator and log-in to your V-Play Account on the new welcome page, which was added by installing V-Play.

qt_install_vplay_6

8. If you do not own a V-Play Account yet, you can create a new account on the V-Play Website. Open the downloads page and choose Download to open the sign-up popup, which will guide you through the registration. As you already added V-Play to your Qt installation, you can skip the actual download after you’ve completed the sign-up.

qt_install_vplay_7

After you’ve successfully installed the V-Play SDK and logged into your V-Play account with Qt Creator, you can start using V-Play in your projects.

Integrate V-Play in your Qt Quick Project

To correctly link and initialize the V-Play components, some additional steps are required for each project that uses V-Play. First, open your Qt Quick Project with Qt Creator. You can then follow these steps to add V-Play:

1. Modify your .pro file configuration to link the V-Play SDK to your project

CONFIG += v-play

2. Open the main.cpp of your project and initialize V-Play

#include 
#include 
#include  // 1 - include VPApplication

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    VPApplication vplay; // 2 - create VPApplication instance

    QQmlApplicationEngine engine;
    vplay.initialize(&engine); // 3 - initialize V-Play

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    return app.exec();
}

3. In your main.qml, use V-Play GameWindow or App as your main ApplicationWindow (this is required for license validation and other checks)

import VPlay 2.0

GameWindow {
  licenseKey: ""
  // ...
}

Alternatively, you can also add a GameWindowItem as a child to your main window instead:

import VPlay 2.0

ApplicationWindow {
    // ...
    GameWindowItem {
      licenseKey: ""
    }
}

4. Add a new file qml/config.json to your project resources, and configure your correct application id and version:

{
    "title": "V-Play App",
    "identifier": "net.vplay.demoapp",
    "orientation": "auto",
    "versioncode": 1,
    "versionname": "1",
    "stage": "test"
}

5. When activating V-Play with a valid license key, the identifier and version of the config.json needs to match the actual app id and version of your mobile app. For Android apps, the identifier and version are configured in the AndroidManifest.xml:

If your application does not yet have an Android configuration, you can choose the Projects tab in Qt Creator, select the Android Kit, expand the Build Android APK section and choose Create Templates. This will create a default configuration within a new android subfolder of your project, which also includes the manifest.

6. For iOS, you can set the identifier and version in the Info.plist configuration of your app:

CFBundleIdentifiernet.vplay.demoappCFBundleVersion1

This configuration file is created by qmake when building for iOS. You can add the following qmake entry to your *.pro configuration to keep and use a custom iOS configuration for your project:

ios {
   QMAKE_INFO_PLIST = ios/Info.plist
}

Make sure to have the correct setting for all three configuration files. If everything looks good, you are ready to use V-Play in your QML application.

You can download this example from GitHub as a reference project too:

Use V-Play Components in your QML Code

Using V-Play in the QML files of your Qt Quick application is easy. All V-Play types are available as QML components and can be used just like any other Item in QML. Mixing V-Play types with Qt components like Qt Quick Controls 2 is also possible.

For example, if you like to add add an easy-to-use local storage to your application, simply add the V-Play import and use the Storage component of V-Play:

import VPlay 2.0

Storage {
  id: localStorage
  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This example saves a counter property in a local SQLite database. The code loads the previous counter value at app start and automatically stores the counter every time it is changed in the app.

It is even possible to use the WebStorage item instead, which utilizes the V-Play Game Network service to synchronize the stored data across devices of the same user:

import VPlay 2.0

VPlayGameNetwork {
  id: gameNetwork
  gameId: 
  secret: ""
}

WebStorage {
  id: localStorage

  property int counter

  onCounterChanged: localStorage.setValue("counter", counter)
  Component.onCompleted: counter = localStorage.getValue("counter") || 0
}

This is all the code required to include a simple cloud-based data storage.

Other V-Play Components offer the same ease-of-use, for an overview of all available types and features, please have a look at the online documentation of V-Play.

Access Native Device Features in your Qt App

Another big advantage of V-Play is the possibility to use native device features like the camera or confirmation and input dialogs – the NativeUtils component is all you need.

This example shares a custom text and url with the native share dialog on Android and iOS:

import VPlayApps 1.0

App {
AppButton {
  text: "Share!"
  onClicked: nativeUtils.share("V-Play is awesome!", "https://v-play.net")
}
}

Taking a photo with the camera and displaying the shot afterwards is just as simple:

// open camera on button click
AppButton {
  text: "Take Photo"
  onClicked: nativeUtils.displayCameraPicker("Take Photo")
}

// show image after photo was taken
Connections {
  target: nativeUtils
  onCameraPickerFinished: {
    if(accepted) {
      image.source = path
    }
  }
}

AppImage {
  id: image
  anchors.fill: parent
  fillMode: AppImage.PreserveAspectFit
  autoTransform: true
}

When working with dialogs, the V-Play Apps type NativeDialog is also available and offers a more convenient usage to trigger a dialog and handle the response:

AppButton {
   text: "Confirm Dialog"
   onClicked: NativeDialog.confirm("Please Confirm", "Confirm this action?", function(ok) {
     if(ok) {
       // confirmed
     }
     else {
       // not confirmed
     }
   })
 }

Integrate Third-party Services in your Qt Mobile App

V-Play Plugins allow to integrate leading third-party services for ads, analytics, push notifications and more. All native plugins are available to use in your Qt Quick application and offer a convenient way to fast-forward app and game development for iOS and Android.

Since V-Play 2.11.0 it is even possible to fully use V-Play including all monetization plugins with the free Personal Plan of V-Play. Adding services like Google AdMob, Chartboost or Soomla In-App Purchases has never been easier.

plugindemo-admob-android_opt

a. Native Plugin Integration in Qt

With a single import and QML Item, you can for example show an AdMob Banner in your app:

import VPlayPlugins 1.0

AdMobBanner {
  adUnitId: ""
  banner: AdMobBanner.Smart
  anchors.bottom: parent.bottom
}

To actually use the plugin with this simple approach on iOS or Android, a few more steps are required. For example, linking the Android Libraries for Google AdMob with your application requires the following gradle dependency:

allprojects {
  repositories {
      maven { url 'https://sdk.v-play.net/maven/' } // add V-Play repository
  }
}

dependencies {
  compile 'net.vplay.plugins:plugin-admob:2.+' // import admob plugin libraries
}

Just have a look at the plugin documentation of your desired plugin and view the integration steps for more information.

To also prepare the above example for iOS, first copy the GoogleMobileAds.framework from the ios subfolder of the V-Play Plugin Demo on GitHub to a sub-folder called ios within your project. Then add this setting to the qmake configuration in your *.pro file:

ios {
  VPLAY_PLUGINS += admob
}

A short extension to the Project-Info.plist configuration of your iOS app completes the iOS integration steps for using AdMob:

NSAppTransportSecurityNSAllowsArbitraryLoadsNSAllowsArbitraryLoadsForMediaNSAllowsArbitraryLoadsInWebContent

b. Plugin Activation

Monetization plugins are usable with the free version of V-Play. However, without having a valid V-Play License Key set, only trial-modes are available for all plugins. To be able to set the GameWindowItem::licenseKey with a valid key, let’s first create a new key for the app.

After signing in to your V-Play account, you can create as many keys as you want in the License Key Creation section of the Developers Dashboard. This is how it works:

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

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

3. Copy the generated licenseKey to your GameWindowItem, GameWindow, or App component.
plugin-activation-license-3

4. You can now fully use the AdMob plugin on both iOS and Android!

This approach is the same for every plugin and each license key you create allows to activate all the plugins you need. If you encounter any issues when using V-Play in your Qt applications, don’t hesitate to contact us at support@v-play.net or in the support forums.

The full example of this guide also available on GitHub:

 

 

More Posts Like This

 

Release 2.12.1: Visual Editor & Qt Quick Designer Improvements
V-Play Update 2.12.1: Qt Quick Designer Improvements

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

How to Make a Qt app

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

Release 2_11

WeAreDevelopers Conference App – Open Source & Live Now!

WeAreDevelopers

The post How to Add V-Play to your Qt Mobile App appeared first on V-Play Engine.

KDAB on Qt: New in Qt 5.10: Diagnostics when breaking QML bindings

$
0
0

Property bindings are one of the most interesting features of the QML language. In QML, when we set a value on a property, the right hand side expression isn't evaluated just once to produce a value, like in a ordinary imperative language.

In particular, if the expression involves other properties, then the property we're setting becomes bound to the properties in the expression: whenever they change their values, then the expression is automatically evaluated again, and the target property value updated.

For instance:

[sourcecode]
import QtQuick 2.0

Rectangle {
width: 100; height: 100

// this is a binding:
color: mouseArea.containsMouse ? "red" : "blue"

MouseArea { id: mouseArea; anchors.fill: parent; hoverEnabled: true }
}
[/sourcecode]

In the snippet above, the color property of the Rectangle is the target of a binding: it is bound to the containsMouse property of the internal MouseArea. When the mouse moves inside or outside of the mouse area, its containsMouse property will change, causing the expression for color to be re-evaluated.

In layman's terms: the rectangle will be red if the mouse cursor is hovering over it, and blue otherwise.

Property bindings allow to build our UIs in a very declarative way: we don't need to write boilerplate "slots" to update our UI elements when some other property changes value. The expression that we can write on the right hand side can be as complex as we want, even involving function calls; the engine will do all the work for us, and will make the binding work as expected.

Breaking property bindings

Sounds too good to be true? Well, property bindings have a limitation: if we use an imperative assignment to set a value on a property, its binding will be lost. For instance, suppose we want the rectangle to turn green when we click over it. This is a possible implementation:

[sourcecode]
import QtQuick 2.0

Rectangle {
width: 100; height: 100

// this is still a binding
color: mouseArea.containsMouse ? "red" : "blue"

MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: {
parent.color = "green" // oops! breaks binding
}
}
}
[/sourcecode]

In the onClicked signal handler we set the color property to green using an ordinary assignment from imperative JavaScript code. With this code, if we click on the rectangle, and then move the mouse over it and outside it, we'll see that the rectangle doesn't change color any more -- it stays green. This happens because the imperative assignment destroyed the binding, and set the color property to one specific value.

Are broken bindings a problem?

In general, the above example is 100% correct QML code, following the documented QML semantics. Therefore, one cannot claim that such code should be rejected by the QML engine or unconditionally raise warnings.

However, in my experience at KDAB, I have never encountered one single occasion when breaking a binding was intended by the developer. Broken bindings were always caused by accident (during refactorings, not realizing that the original property was bound to something, etc.), or by excessive usage of JavaScript to manage state, instead of using more declarative approaches.

On some occasions, a silent overwriting of a binding with a value did actually introduce a runtime bug, which would then stay latent, maybe for a long time. Debugging such issues could be very challenging, as it is not normally clear what the problem is when reading the QML source code -- the bug would manifest itself only when the JavaScript code containing an imperative assignment is run.

Debugging broken bindings

In order for a developer to be able to more easily track down these cases, KDAB contributed a new feature to the QML engine that will appear in Qt 5.10: the QML engine can now print debugging information whenever a binding is broken.

In order to enable the debug output you just need to enable output for the qt.qml.binding.removal logging category, for instance by exporting the QT_LOGGING_RULES environment variable:

[sourcecode]
export QT_LOGGING_RULES="qt.qml.binding.removal.info=true"
[/sourcecode]

With this variable set, the above example:

[sourcecode]
import QtQuick 2.0

Rectangle {
width: 100; height: 100

color: mouseArea.containsMouse ? "red" : "blue"

MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: {
parent.color = "green"
}
}
}
[/sourcecode]

now prints this debug message:

[sourcecode]
qt.qml.binding.removal: Overwriting binding on QQuickRectangle::color
at file:///example.qml:13
that was initially bound at file:///example.qml:6:12
[/sourcecode]

As you can see, the message tells us which property was bound, where the binding had been established, and where the imperative statement is that breaks the binding. Pretty much everything we need to debug any issues with broken bindings!

[training_callout] continue reading

The post New in Qt 5.10: Diagnostics when breaking QML bindings appeared first on KDAB.

KDAB on Qt: Qt talks at CppCon 2017

$
0
0

The program for CppCon 2017 is now published!

CppCon is the annual conference for the C++ community: five days packed with over 100 talks, as well as inspiring keynotes, panel discussions, hallway chats, fun 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.

It's our pleasure to announce that Qt will be a huge presence at this year's CppCon, with a training, a keynote speech, two talks and other open content:

  • On September 23-24, KDAB's Giuseppe D'Angelo will deliver a pre-conference training on programming with QtWidgets. This course focuses entirely on QtWidgets, the set of C++ APIs offered by Qt to build cross-platform desktop applications, running on Windows, Linux and Mac.
  • On September 27, Giuseppe will also talk about how to use Qt C++ Core APIs effectively in the 2017 update of the Effective Qt session.
  • On September 29, Simon Hausmann from The Qt Company will explore what's under the hood of the Qt object model and its features (signals, slots, properties) in his Inside the Qt Object Model session.
  • Last but not least, Lars Knoll (Qt Project Chief Maintainer, CTO of The Qt Company) will deliver a keynote speech. The details have yet to be announced, but it's great to see the C++ community acknowledging the importance of the Qt framework in the C++ ecosystem.

This isn't everything -- stay tuned for more info about other Qt-related content at CppCon, including BOFs, panels and lightning talks. Also, don't forget that on September 30 and October 1, KDAB's Thomas McGuire will explain in his post-conference training how to Debug and Profile C++ Code on Linux.

You can register to CppCon here.

See you in Bellevue!

[training_callout] continue reading

The post Qt talks at CppCon 2017 appeared first on KDAB.

Viewing all 15410 articles
Browse latest View live