Category Archives: News

Link

We have released version 2.9.0 of our Qt application introspection tool GammaRay. GammaRay allows you to observe behavior and data structures of Qt code inside your program live at runtime. GammaRay 2.9 introduces a number of new features interesting to Qt Quick, QWidgets, Qt 3D and non-graphical Qt users alike.

Qt Quick

One focus area of this release is the paint analyzer. It got significantly improved argument inspection, stack traces for all operations, and, in addition to QWidgets, QGraphicsView and QQuickPaintedItem, it’s now also available for the Qt Quick software renderer (with Qt 5.9.3 or newer) and Qt 3D painted textures. The paint analyzer now also measures the time each operation takes. With all that combined you have a powerful tool when being faced with rendering performance issues in applications using the Qt Quick software renderer.

GammaRay paint analyzer / profiler with a Qt Quick software renderer application.

For the Qt Quick OpenGL renderer we have some interesting new feature too of course, such as the texture inspection tab. This enables you to see the textures used on the GPU backing Image elements or Text elements using distance field rendering. This is useful to spot sub-optimal texture atlas usage, or textures containing unnecessary content, both of which can hurt GPU memory consumption. The texture inspection view supports analyzing this with diagnostic overlays, highlighting transparent borders or repeated areas that can for example be optimized by the use of BorderImage elements.

GammaRay texture inspector highlighting a largely transparent element in a texture atlas

Core Features

There’s also new features for the non-UI aspects of Qt. The new QML binding inspector (requires Qt 5.10 or newer) allows you to analyze the dependencies of a QML property binding. It provides source code navigation to the corresponding binding dependency and thus is quite useful for debugging non-trivial binding loops.

GammaRay QML binding inspector showing a binding loop.

The new QObject creation stack trace view expands on the QObject creation source navigation we introduced in the previous release and also shows you the full stack trace leading up to the creation of a specific object (not available on all platforms). Very useful when you spot objects in GammaRay that shouldn’t be there (anymore).

GammaRay object creation stack trace view.

Widgets

For QWidget users, the GammaRay widget inspector is now able to visualize the tab focus chain. This makes testing the tab …read more

Source:: https://www.kdab.com/gammaray-2-9-0-release/

      

Link
App Architecture for REST Services with Qt, QML and V-Play

REST and RESTful web services are the most common way to access data through the Internet. Qt with V-Play provides an easy way to connect via REST. This article guides you through the most important steps to create an App and connect to a REST service. Additionally, it provides reusable code snippets.

Spoiler: Basic REST Example with V-Play

Before we jump into the details of creating the sample App, this is how a basic request to a REST service looks, using the XMLHttpRequest:

// Create the XMLHttpRequest object
var xhr = new XMLHttpRequest

// Listen to the readyStateChanged signal
xhr.onreadystatechange = function() {
  // If the state changed to DONE, we can parse the response
  if (xhr.readyState === XMLHttpRequest.DONE) {
    // The responseText looks like this {"ip":"xxx.xxx.xxx.xxx"} 
    // Parse the responseText string to JSON format
    var responseJSON = JSON.parse(xhr.responseText)
    // Read the ip property of the response
    var ip = responseJSON.ip
    // Log your ip to the console output
    console.debug("My IP is: " + ip)
  }
}

// Define the target of your request
xhr.open("GET", "https://api.ipify.org?format=json")
// Execute the request
xhr.send()

Real-Life Sample Project

For the most useful results, we build a real-life Qt client. It accesses one of the web’s most popular weather services. It’s easy to adapt to any other REST service: the process is always the same. You only need to change the endpoint URL and parse the corresponding content.

The full sample is available open-source on GitHub:

Architecture

The app consists of two files:

  • Main.qml: contains the UI and REST logic
  • DataModel.qml: stores & caches the parsed data from the REST service

Basic UI for a Responsive REST Client App

First, we create the user interface: the QML items in “Main.qml”. We use V-Play APIs. They adapt to the style of the target platform (Desktop, Android, iOS). These three items are usually present in every Qt / QML app:

  1. The App component is always the top-level element in the QML file. It adds a lot of vital layout data to standard Qt classes. Two mechanisms are especially important. Device-independent pixels (dp) for sizes and scale-independent pixels (sp) for fonts.
  2. Initially, our REST client app only has a single page. It’s still a good idea to add the NavigationStack item as a child. Later, it could handle navigating to a detail page. In …read more

    Source:: https://v-play.net/cross-platform-app-development/access-rest-services-qt-v-play-weather-service-example-app-open-source

          

Link

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

C++ Support

The possibly most noteworthy and least directly visible change is that we upgraded the backend for the Clang code model from Clang 3.9 to Clang 5.0. This enables support for many C++17 features that were not available in Clang 3.9. The Clang code model is not used by default. Open Help > About Plugins (Qt Creator > About Plugins on macOS) and turn on the ClangCodeModel plugin to enable it.

Another feature that is not visible until you enable it, is the new option to integrate Clang-Tidy and Clazy warnings into the diagnostic messages that you see in the C++ editor. Go to Options > C++ > Code Model > Clang Code Model Warnings, create a copy of one of the presets, and choose the checks that you want to be performed.

The informational tooltips on symbols are now generated from information from Clang instead of the built-in model (if you enabled the Clang code model). It now resolves auto to the actual type and shows template parameters for template types. It shows the first or the brief paragraph of a documentation comment, too.

We also added separate highlighting of function definitions and fixed some issues with saving header files on Windows while Clang has a grip on them.

Navigation

We added 3 more filters to Locator. Type “b” to jump to a bookmark, filtering on file name and notes. The other two are not directly related to navigation but nevertheless useful.
The filter “t” triggers an item from the main menu. You can either use the display name of the item to locate it, or parts of the menu path leading to it. For example “t sess expe” could be used to trigger the menu item File > Sessions > Experimental Stuff.
Use “=” to evaluate simple ECMAScript (JavaScript) expressions. You have all functionality from the ECMA-262 specification at your disposal, and for convenience, we also added the functions from the Math object as global functions (so you can write “max(1, 2)” instead of “Math.max(1, 2)”).

We continued the work on the File System navigation pane that we started with 4.5. It now has breadcrumbs for the file path at the top, and we added actions for adding, removing, and renaming files to its context menu.

Model Editor

Thanks to Jochen, the original contributor to the model editor, it received a big update …read more

Source:: http://blog.qt.io/blog/2018/02/07/qt-creator-4-6-beta-released/

      

Link
01_blog_overview

Welcome to Part 3 of my Blog series about Sharing Files to and from mobile Qt Apps.

Part 1 was about sharing Files or Content from your Qt App with native Android or iOS Apps, Part 2 explained HowTo share Files with your Qt App from other native Android Apps – this part now does the same from other native iOS Apps.

Some preliminary notes

  • Try it out: all sources are available at ⦁ GitHub
  • Android Permissions not checked in Example App: enable WRITE_EXTERNAL_STORAGE manually
  • Current Android release is for Target SDK 23 ! (Android 7 requires ⦁ FileProvider – wait for Blog Part 4)
  • All Use-Cases are implemented to be used x-platform – currently Android and iOS

If you‘re looking for an Android-only solution please also take a look at AndroidNative project.

Prepare iOS Info.plist

Similar to Android intent-filter in AndroidManifest.xml we must add some informations to Info.plist. If you haven‘t already done copy the Info.plist from your build directory into your project:

02_info_plist_in_project

Then add this into your .pro:

ios {
    ...
    QMAKE_INFO_PLIST = ios/Info.plist
    ...
}

Open the Info.plist and insert these lines:

CFBundleDocumentTypes
  CFBundleTypeNameGeneric FileCFBundleTypeRoleViewerLSHandlerRankAlternateLSItemContentTypespublic.data

See all the details from Apple Documentation „Registering File Types“.
Here‘s a short overview how the Types are organized:

03_uniform_type_identifiers

public.data is similar to MimeType */* we are using to filter Android Intents in our Example App.

After adding the lines to Info.plist our App will appear as a target App if Files or Attachments should be shared from other iOS Apps.

Fortunately iOS doesn‘t provide our own App as target if we want to share Files from our Example App with other iOS Apps.
Remember: On Android we had to create a custom Chooser to filter out our own App as target.

Get the incoming URL

The Files from other iOS Apps will be passed to the Qt App via application:openURL:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

see also Apple documentation.

From Part 2 (Android implementation) you know that we have to wait until the Qt App is ready to handle the incoming URL and be able to emit a SIGNAL to QML UI.

We don‘t need this for iOS, because there‘s a Qt method we can use out of the box and grab the passed file url by registering QDesktopServices::setUrlHandler:

QDesktopServices::setUrlHandler("file", this, "handleFileUrlReceived");

This is easy to implement. We already have the IosShareUtils.mm class where we handle sharing …read more

Source:: http://blog.qt.io/blog/2018/02/06/sharing-files-android-ios-qt-app-part-3/

      

Link

The Qt Company Support Team works hand-in-hand with Qt R&D developers, and we are 100% committed to ensuring your success. It’s now been a bit over half a year since we launched the new Premium Support service. We felt that now would be a good time to recapture its essence and the experiences of our teams and customers. We will be sharing lots of troubleshooting tips and best practices on March 6th, in our Qt Support – Tips and Tricks webinar – make sure to join and tell us about your project! In the meantime, here’s a brief recap of what we’ve been working on.

Qt Support Services

Standard Support is included with all new commercial Qt licenses (apart from start-up licenses). This guarantees that we respond to your request within 48 business hours and prioritize your reported Qt errors. However, many of our customers require more personal and quicker support service. This is where Premium Support comes in. It offers a dedicated support representative close to your time zone who will respond to you within 10 business hours on average. This means that if we get your request in the morning you can see our response before you leave work.

When we try to reproduce any issues you may have, we can also use your complete applications instead of minimal test versions to analyze issues and fix bugs. Premium Support reported Qt bugs also get high priority and will get handled quickly.

You can find the SLA terms on our webpage.

Experiences from Premium Support

We’ve resolved oodles of bug fix requests for our Premium Support customers. With Premium Support it doesn’t really matter whether the issue lies in your code or in the Qt libraries. We will investigate and find the solution no matter what. Typically bugs can be difficult to resolve in Standard Support since a minimal test application is required and some of the issues are really hard to reproduce with anything else than customer application. Being able to use customer application really speeds up resolving bugs!

We have also been providing a lot of guidance on best practices on particular use cases for our customers. This includes ideal usage of Qt APIs and what can be done within the customer application, algorithm guidance, architecture design and optimizing performance.

Another type of project we are often involved in is the migration from obsolete Qt version to a newer …read more

Source:: http://blog.qt.io/blog/2018/02/05/premium-support-learning-and-experiences/

      

Link

Near the end of 2017, Med Device Online published an article outlining important medical device design and manufacturing challenges at present and would extend into 2018 and beyond.

Working with Qt, and developing on the innovative, safe, and effective Qt software framework, we help companies meet and overcome these challenges medical device developers and manufacturers face. The following is a list of the challenges outlined in the Med Device Online article and the Qt response:

  • Beating the Competition with Innovation
    You can create modern User Experiences with uncompromising performance & reliability. Build safe, effective, and reliable user interfaces and user experiences on almost any embedded device or mobile device platform.
  • Anticipating Rising Costs & Regulatory Changes
    The Qt Company has a very experienced and diverse partner ecosystem. Leveraging our partnership with The Emergo Group allows our customers to better understand and anticipate the effects of pending regulations. Through this partnership our customers can best align their product development cycle with the regulatory certification cycle, making their overall go-to-market process (development + regulatory) faster and more efficient.
  • Streamlining R&D Amid Shorter Product Life Cycles
    During a recent customer survey, 84% of Qt’s customers state that their development teams are more productive using Qt. When asked how much productivity increased, their response was that productivity went up nearly 100%, or doubled, what it did when they weren’t using Qt. Qt allows you to do more work with less people in shorter amounts of time. If your software is intended to live on different types of platforms, you will not need a separate software development team for each platform with which it is to be compatible. The User Interfaces and User experiences created on Qt can reside on mostly any embedded or mobile platform with one code base. Simply code and compile to iOS, MacOS, Windows, Android, Embedded Linux, QNX, and many others.
  • A Need For Growing Support Networks
    The Qt Company has a very experienced consultancy group and that can help streamline R&D processes and uncover new, “outside the box” opportunities to compete on innovation. Our Qt consultants combined with our industry leading partnerships help our partners streamline time-to-market while enhancing safety and effectiveness.

We at The Qt Company are happy to help companies to design safe, efficient and user-friendly medical devices. Read more about our offering for the medical industry at www.qt.io/qt-in-medical.

The post Medical Device Design & Manufacturing Challenges: 2017 And Beyond appeared first on …read more

Source:: http://blog.qt.io/blog/2018/01/31/medical-device-design-manufacturing-challenges-2017-and-beyond/

      

Link
nymea1

Here at guh GmbH, the creators of the IoT platform nymea, we have been using Qt since right from the start. You may think: it seems an odd choice to use Qt for a device with no UI requirements but just middleware components basically invisible to the user. Let me explain why this definitely isn’t the case. Essentially, there are tree misconceptions in the previous statement.

UI Framework: Yes, but so Much More

The first and biggest misconception is that Qt only focuses on UI projects. It is true that Qt started as a UI toolkit many, many years ago. But since then, Qt has evolved into a fully featured set of libraries and tools supporting the developer in every layer of the stack. Even if you don’t need graphical bells and whistles, Qt will increase your productivity by an order of magnitude. I’ll go a bit more in depth later on.

UI has Many Faces

Now, let me address the second misconception in the above statement: that no display equals no UI. Even when you’re building an embedded device without display, there’s hardly no user interface for it. In our example the user interface consists of a web interface running on the IoT box and a client app. The client application, running on mobile phones, PCs or just wall-mounted displays is mostly a thin UI layer, talking to the device. Here, Qt Quick can deliver a smooth, modern experience with a “write once, run everywhere” application. And the coolest part: since Qt 5.10, this very same client application can be re-used as the web interface on the device deploying the new Qt WebGL features.

No More Overhead: Deploy Only What You Need

Another comment I’ve often heard is that importing Qt into an embedded device would be a huge overhead. While in the early days, Qt was built of some few, rather big modules, this has changed a long time ago. At the very latest with Qt5, the modularization of Qt has facilitated fine-grained control of what parts of Qt are needed for a small footprint installation. However, in recent days this has been taken even further, and with Qt for devices it is now possible to strip down the required components to the real bare minimum, invalidating this point completely.

nymea3

How Qt has Increased Our Productivity Building nymea:

As mentioned above, I’d also like to address some of the features …read more

Source:: http://blog.qt.io/blog/2018/01/30/boost-your-iot-device-with-qt/

      

Link
How to Make a Qt app

Application Development with QML is simple and powerful. But Qt C++ can be more performant, offers many features and is less error-prone. This post shows you how to create apps that take advantage of both languages.

How to Communicate between C++ and QML

It is important to choose the right language for different features of your app. Integrate C++ components with QML to take your mobile app development to the next level.

Advantages of Coding in QML

V-Play Engine for Qt-based mobile apps and games uses the power of Qt Quick (QML + Javascript). This declarative scripting language is so powerful that it saves up to 60% lines of code compared to other programming languages.

Coding in QML has several advantages over development with C++:

  • Coding with QML + JavaScript is very easy to learn and allows to reduce the required amount of code a lot.
  • Language concepts like states, signals or property bindings are a huge time-saver.
  • QML makes adding animations simple. You can animate every property of your QML types with simple Animation components.
  • QML is extensible and flexible. For example, you can extend objects with new properties and features in-line. No need to create a new re-usable type for small extensions.
  • The QML Rendering Engine offers a great performance. The renderer uses C++ Qt and relies on a hardware accelerated scene graph. This makes it fast enough to power even high-performance games.

When to use C++ Instead

Qt app development with C++ has advantages as well. For some scenarios you need features that are only available with Qt C++. Also, C++ is fast and type-safe. This allows to provide the best possible performance for long-running and data-intense calculations.

For these examples, you would choose C++ over QML:

V-Play Game Engine: Release 2.12.0: Qt 5.9 & Qt Creator 4.3 Support

Download One Card on iOS

V-Play 2.12.0 adds support for Qt 5.9 and the latest Qt Creator 4.3. Qt 5.9 adds many great features like support for gamepads and 3D key frame animations. Qt Creator 4.3 adds a much improved design mode, which allows you to write QML code side-by-side with a visual representation of the code. This allows rapid prototyping of UIs.

V-Play 2.12.0 Improvements

V-Play is now compatible with Qt 5.9 and Qt Creator 4.3, which adds an improved QML Designer. The biggest benefit of the new QML Designer is the new live preview of your QML code. You can have your UI side-by-side with QML code, which allows to further accelerate the development process.

Some of the V-Play components now also support the QML Designer and visual development. The supported components include GameWindow, App, Scene, Page, NavigationStack and also most of the other components are working. With this improvement, you can now adjust component properties with a nice visual editor.

Other improvements of this V-Play release:

  • You can use an improved icon-font handling within games and apps and use the latest FontAwesome version 4.7.0 with the IconType component.
  • The Download One Card on iOS Download One Card on Android
  • With the AppButton::textFont property, you can now access and modify all font properties of the text within AppButton.
  • The Component Showcase Demo App configuration for ios/Project-Info.plist now includes the NSContactsUsageDescription entry, which is required for NativeUtils::storeContacts() since iOS 10.
  • Use the new Dialog::autoSize property to decide whether the dialog uses a fixed height or a dynamic height based on the Items you add as dialog content.
  • Incorrect warning for publish builds about using DEPLOYMENTFOLDERS is no longer displayed when QRC is actually used instead. This is relevant when protecting your source code for published apps.

Qt 5.9 Improvements for Mobile App Development

Qt 5.9 added many improvements and was shipped on time. This indicates that the new CI system The Qt Company is now be using yields great results. These are our favorite Qt 5.9 improvements, with a focus for mobile app or game development:

Qt 3D: Animations, Physics Based Rendering (PBR), Level of Detail

Qt 3D got a lot better with the Qt 5.9 release. These are our highlights: