Introduction to Qt 5

Source: Internet
Author: User

QT 5 Introduction qt 5 Overview

in this version of QT 5, QT Quick became the heart of Qt. But QT 5 also continues to provide powerful local C + + capabilities to achieve a better user experience, as well as full support for Opengl/opengl es graphics acceleration.

QT 5 is the first version to make a big change since the QT 4.x series released in 2005. This change is mainly to make QT more adaptable to future needs.

QT 5.0 releases the full SDK, covering windows, Mac OS x, and Linux. This indicates that the QT 5.0 release includes the QT 5 framework, the IDE (QT Creator), examples, and documentation.

QT 5 's success stems from Qt 4, so QT is as compatible with QT 4.x series as possible.

QT 5 eliminates some of the internal design on the architecture and makes QT 5 more modular, easier to learn and faster. QT 4.x series applications require only a few changes and a simple recompile with QT 5 to support QT 5.

Some of the packages for QT 5 (mainly the development framework) are released with QT Creator 2.6.1, and this version of QT Creator is also compiled using QT 5.

QT 4 has been released for over 7 years, and Qt 4 is still in the main branch QT 4.8 version.

Now the 5th largest version of Qt has been released, offering 4 main features:

(1) Amazing image processing and presentation capabilities: especially in specific environments, such as embedded and mobile devices. Qt Quick 2 provides a view of the scene based on open GL, a particle system, and a collection of some rendering effects. QT Multimedia and QT Graphicaleffects further promote these features.

(2) Developer productivity and flexibility: make JavaScript and qml a class citizen, and continue to retain the support of C + + as a base and for Qt widgets. The additional QT WebKit2 makes it easier for HTML5 developers.

(3) Cross-platform portability: As QT's core modules and add-ons use new structures and QPA, the development of OS developers is made easier. The ultimate goal is to make QT work in all environments. The next step is to provide full QT support on iOS and Android, which has started.

(4) Open development and open management ensure a wider range of developers to develop and test QT 5.

The Qt 5 contains the following modules:

Core modules: Qt core,qt gui,qt multimedia,qt netword,qt qml,qt quick,qt sql,qt test,qt webkit,qt WebKit widgets,qt Widgets.

Additional modules: Qt d-bus,qt graphical effects,qt imageformats,qt opengl,qt Print support,qt declarative,qt script,qt Script tools,qt SVG,QT xml,qt XML Patterns.

Description

QT's core module defines the basis for QT on all platforms. They are available on all development platforms supported by QT as well as on the target platform for testing. They are both source code and binary compatible during QT 5. The core modules are common and useful for most QT applications. Modules implemented for a particular purpose are placed in the QT add-on module, even though the module is available on all supported platforms.

The list of QT core modules is as follows:



QT's add-on module provides additional value for specific purposes. These modules may be available only on certain development platforms or target platforms. Some of these modules may only be included in the release of QT for specific platforms.

The list of additional modules for Qt is as follows:



The next step is to introduce the tools section of Qt.

The tools used to develop QT applications are published as part of Qt with the QT version. The official release of the tool supports all development platforms.

the list of tools for Qt is as follows:


New features included with Qt 5

Next, let's look at what new features are included in Qt 5, and the main new features are the following table:



Now let's go over these new features in detail:

(1) Amazing Graphics Capability andperformance

QT 5 uses the OpenGL-based scene view to speed up QT quick images, making it possible for the user interface to use animations, image effects, and particle systems, even in hardware-constrained mobile and embedded devices.



The benefits of changing the rendering engine architecture can also be seen from the following examples:



(2) Qt Quick in QT 5

Qt Quick provides the necessary base parts for developing QML applications. The latest version of the Technology (v2.0) also introduces a series of C + + classes as substitutes for the Qdeclarative equivalence class in QT Quick 1. New features in Qt quick include:

*canvas:canvas provides an API similar to the Canvas in HTML5, along with some additional features;

*shader Effects: This feature allows the GLSL renderer to be integrated into the QML and applied to the interface components and images;

*particle Effects: Used to create a diverse 2D particle system;

*sprites: It can be used in 2D animated objects, and can serve as the source of the particle system;

* Offline storage: Offline storage is the Html5web database API, in QT 5 It is the JavaScript API used to store data in QT quick applications;

*window:window provides a top-level window and screen type for getting the screen resolution and other details. This is useful for developing desktop programs using QT quick;

* New Rendering Architecture: A new OpenGL-based rendering architecture optimized for performance.



The QT graphical effects module provides a range of ready-made effects that can be applied to QT quick applications, including soft drop shadow,blur,gow and colorize.



(3) WebKit and HTML5

Qt WebKit is a Web content rendering engine based on an open source WebKit project. WebKit extensive support for standard web technologies. QT's WebKit module provides integration with QT quick and traditional widgets. The module integrates the benefits of the latest HTML5 into QT 5, including CSS filters, animations, videos, Canvas, WebGL, and HTML video.

(4) Multimedia

QT Multimedia provides a lot of QML types and C + + classes to handle multimedia content. It also provides the necessary APIs to get the camera and radio functions. Qt 5 puts the QT multimedia module in the core module, so it supports all major platforms.


(5) modularized Qt Libraries

Qt 5 divides the QT library into several specific libraries and modules. This means that an application can select the libraries it needs to use, compile, and deploy.

A list of QT modules has been described earlier.

(6) Widgets in Qt 5

QT Widgets has been divided into a separate module in QT 5. It is also one of the core modules.


(7) Qt Platform abstraction

The part of QT that is dependent on the window system has been completely rewritten in Qt5, based on QT Platform abstraction: A plugin architecture that allows QT to dynamically load the windowing system it is in. This will provide the following benefits:

* The base code of Windows system integration is in the center and can be reused by all platforms;

* Simplify the task of porting Qt to a new platform;

* Removing dependency from the Windows system from Qt makes it possible to align the binary of QT programs running under multiple windowing systems. For example, Qtlinux binaries can be run on X11 and Wayland.

(8) New Connection Syntax

In addition to the well-known and still available way to connect signals and slots, new overloads for Qobject::connect have been added to QT5, and the new syntax allows the use of pointers to member functions to connect signals and slots:


The new syntax provides compile-time checking of the compatibility of signals and slots, and if there is an implicit conversion between parameter types, the conversion is performed automatically, and the new syntax solves many of the problems caused by TypeDef or namespaces.

Also, if your compiler supports C++11, you can even connect to a lambda function directly (signal):


(9) Connectivity and Networking

Qt 5 provides better support for IPV6 as well as two modes of networking. The vast majority of applications that use host names and network layer transport protocols can now obtain IPV6 transport support. These applications can choose to accept both IPV4 and IPV6 connections, or only one of two connection types. In an HTTP connection made using Qnetworkaccessmanager, the IPV4 and IPV6 connections are attempted in parallel, and the first successful connection is put into use. This is particularly useful for environments in which a restricted connection is in the two connection types.

Qt 5 also provides a better way to handle socket-based TCP connections and SSL authentication. This means that developers can now:

* Bind a TCP socket to an IP before the connection is established;

* Verify the SSL authentication chain;

* Access Legacy systems

Rigorous client authentication is a top priority for many applications that handle critical data. The opaque private keys supported in QT 5 allow applications to read private keys from snakes, such as: The PKCS#11 software protector is used for strict client authentication. Qsslkeyexample demonstrates the reading of the private key from the device.

(Ten) JSON support

QT applications that store a small amount of data using a simple data structure can now choose to use a JSON document that is on the upper level of the complex database backend, which requires the necessary drivers or plug-in access to the data. JSON is a text-mode-based open standard derived from JavaScript, making it the first choice for QML applications.

Qt Core provides a series of classes for parsing and generating JSON documents. These classes also allow you to convert between JSON data stored in memory and standard JSON-formatted documents. The goal is to make the same operation of JSON faster.

(one) User Input

Qt 4 already provides the processing of multi-touch input in C + +. QT 5 extends this support to QT Quick, which includes all the information about the contacts: contact position, pressure, and speed.

In Qt 5, the handling of mouse events is enhanced in its preprocessor. In Qt Quick, the application has more control over the handling of mouse events. The mouse area in the QML document can pass the mouse wheel and click events, as well as ignore the time of delivery.

In addition to these, Qt 5 also adds support for multiple mouse buttons on platforms that support multiple mouse buttons. This is primarily to support scenarios where a game app is developed using QT.

Introduction to Qt 5

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.