Release of Qt 5.4, detailed explanation of Android feature changes, qtandroid

Source: Internet
Author: User

Release of Qt 5.4, detailed explanation of Android feature changes, qtandroid

On July 6, December 10, 2014, Qt 5.4 was finally released! Blog post on the official blog: http://blog.qt.digia.com/blog/2014/12/10/qt-5-4-released.

Download link: http://www.qt.io/download.

Copyright foruok, reprinted please indicate the source: http://blog.csdn.net/foruok.

Changes in Qt 5.4

Qt 5.4 has brought a lot of changes, such as Qt Quick 2D renderer, so that Qt Quick can not use OpenGL, and Qt WebEngine ,...... For details, see the following link:

  • Http://blog.qt.digia.com/blog/2014/12/10/qt-5-4-released/
  • Http://qt-project.org/wiki/New-Features-in-Qt-5.4
  • Http://qt-project.org/wiki/Change-files-in-Qt-5.4.0
Some students are concerned about 5.4 what problems, look here: http://qt-project.org/wiki/Qt540-KnownIssues.


Changes in Android support

This is my biggest concern. My book Qt on Android core programming has been on the market for some time. The changes brought about by the 5.4 release may cause readers to have questions when learning, so I sorted out the changes related to Android for your reference.

In two parts, one is the SDK and the other is the development environment Qt Creator.

Qt SDK changes

There are some changes related to Android in Qt SDK.

Android Native Style

The APK developed by Qt on Android 5.3, 5.2, and, whether based on Widgets or Qt Quick, cannot support Android Native Style very well. It is a pity for many of you. The good news is that Qt 5.4 supports it! See the following link:

Http://blog.qt.digia.com/blog/2014/12/03/native-android-style-in-qt-5-4/

For Qt Widgets on Android, if you use the ministro service in 5.3, some controls already support Android Native Style, such as QLineEdit and QMessageBox. The change brought about by 5.4 is: Android Native Style has nothing to do with ministro! You can also get the Android native style interface without using ministro.

For Qt Quick, there was no Android Native Style before 5.4. This is a great change.

In addition, the Android version is updated quickly. The official version of Android L has been released for a while! Qt 5.3.2 already supports the Android L preview version, but there are a lot of work, Android L Material style, Qt 5.4 does not support ...... Is the change too big? How can people catch up and ...... However, there are still some good news. There is no shortage of tough people in this world. Let's look at the following link, based on the Material style implemented by Qt Quick from scratch:

Https://github.com/7ymekk/qml-material

It is also open-source!

Release changes

Qt 5.4 is the first integrated version after the establishment of the Qt Company. There are also some changes in the release plan. Let's take a look at the instructions on the download page. below is:


Figure 1 Qt 5.4 release

No, four versions, three charged ...... I support this strategy and the company will survive!

The Community version, the Community version, has fewer features to support. Let's take a look at the descriptions on the following page ...... The following are the changes in the Start Menu after installation:


Figure 2 shortcut naming for the Qt 5.4 Community version

Compare 5.3.1 and 5.4.0. Pay attention to the changes in shortcuts.

Qt on Android Known Issues

Well, the Android SDK changes have been completed, and some are worth looking forward to. For example, video support based on Widgets is still not coming ...... For more information, see the following link:

Http://qt-project.org/wiki/Qt_for_Android_known_issues

Sorry, Android 5.0 cannot be remotely debugged ...... However, I have never used remote debugging. The interfaces and logic are all debugged on Windows. The Android real machine depends on the actual running effect. This is the great convenience of Qt cross-platform debugging!

Changes in Qt Creator

Qt Creator 3.3.0 is released in Qt 5.4. Compared with the Android feature changes introduced by the SDK, Qt Creator makes more convenient changes to Android!

Changes in project options

The Qt Creator versions (3.2.x, 3.1.x) carried by 5.3 and 5.2, and the project options of the Qt on Android application, such as signature, deployment policy, and AndroidManifest creation, are actually running the configuration, actually, it's not that reasonable. Think about it.

Qt Creator 3.3.0 has changed. Is the build Configuration:


Figure 3 Qt on Android build configuration

Click the Create Templates button in the Action column to Create a template file for the Android project, such as AndroidManifest. xml. When I read Qt on Android core programming (based on Qt 5.2 and Qt 5.3), I find that the project setting options described in the book are not found. Pay attention to the differences here.

In addition to location changes, there are also some new changes, such as Use Gradle in Advanced Actions, which will be discussed later.

Is the running Configuration:


Figure 4 Qt on Android running configuration

Don't talk about it ......

Compilation System Changes

Qt Creator actually calls the tool chain for building Android applications to compile and package the so and necessary Android Project template files of Qt on Android into APK. I am not clear about my book Qt on Android core programming. This process is basically transparent to developers and does not need to be particularly concerned.

There are several ways to build the Android project. The original method is not mentioned. The automation is ant and gradle, which is said to be productivity improvement. In the order I mentioned, better than one. A few days ago, Google released Android Studio 1.0, which uses gradle to compile Android projects ......

Qt Creator 3.3.0 also supports using gradle to build an APK, while retaining ant support. We need to make some choices for use. Let's see how it works.

  • Build with Gradle

In two steps, when creating a template (Create Templates) (see the button in the red box in figure 3 and click it), select support for Gradle. See figure 5:


Figure 5 support Gradle when creating an Android Template File

After the project is created, see Figure 6. Changes in the project View:


Figure 6 project view when using Gradle

OK. After the template is created, configure the build option, as shown in figure 7:


Figure 7 Use Gradle in build configuration

Okay, now we can Run ......

Swollen, so slow ...... Originally, see Figure 8:


Figure 8 compile and output information built using Gradle

It turns out that Qt Creator will automatically download gradle for us. It may also be automatically configured. It took a lot of effort to configure Gradle 2.2.1 last week to compile my Android project, later, Android Studio was directly installed, which means that when Android Studio is started, it is called a slow loading, and it is called a slow loading. It is like the one in the world ...... Slower than Eclipse ......

I'm impatient. I canceled it. If I didn't go down, I decided to use ant.

  • Build with ant

Welcome back to the old road.

Figure 9 is created when the template is created:


Figure 9 use Ant to create a template to cancel support for Gradle

Project view after the template is created:


Figure 10 project view when Ant is used for building

Is it refreshing ...... I think the more you look, the better you look ...... I belong to my elders ......

Click Run ......, Look at the output information:


Figure 11 compile and output information when Ant is used for building

There are so many changes to building.

Deployment Policy Changes

Because of Android 5.0, you know ......

See:


Figure 12 Deploy local Qt libraries cannot be used in Android 5

A little tragic. Android 5 is not applicable to the developer-friendly deployment policy "Deploy local Qt libraries to temporary dirrectory.

However, Qt Creator 3.3.0 is quite friendly and reminds us that the previous versions are willful and we will not be taken into account ......



Let's go here, la ......


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.