IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt GUI Overview

An overview of the Qt GUI module.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt GUI Overview▲

The Qt GUI module provides classes for windowing system integration, event handling, OpenGL and OpenGL ES integration, 2D graphics, basic imaging, fonts, and text. These classes are used internally by Qt's user interface technologies but can also be used directly, for example to write applications using low-level OpenGL ES graphics APIs.

For application developers writing user interfaces, Qt provides higher level APIs, like Qt Quick, that are much more suitable than the enablers found in the Qt GUI module.

Application Windows▲

The most important classes in the Qt GUI module are https:// and https://. A Qt application that wants to show content on screen has to use these. https:// contains the main event loop, where all events from the window system and other sources are processed and dispatched. It also handles the application's initialization and finalization.

The https:// class represents a window in the underlying windowing system. It provides a number of virtual functions to handle events (https://) from the windowing system, such as touch-input, exposure, focus, key strokes, and geometry changes.

2D Graphics▲

The Qt GUI module contains classes for 2D graphics, imaging, fonts, and advanced typography.

A https:// created with the surface type https:// can be used in combination with https:// and https://, Qt's highly optimized 2D vector graphics API. https:// supports drawing lines, polygons, vector paths, images, and text. For more information, see https:// and https://.

Qt can load and save images using the https:// and https:// classes. By default, Qt supports the most common image formats including JPEG and PNG among others. Users can add support for additional formats via the https:// class. For more information, see https://.

Typography in Qt is done with https://, which uses the https:// API in combination with Qt's font classes, primarily https://. Applications that prefer more low-level APIs to text and font handling can use classes like https:// and https://.

OpenGL and OpenGL ES Integration▲

https:// supports rendering using OpenGL and OpenGL ES, depending on what the platform supports. OpenGL rendering is enabled by setting the https://'s surface type to https://, choosing the format attributes with https://, and then creating a https:// to manage the native OpenGL context. In addition, Qt has QOpenGLPaintDevice, which enables the use of OpenGL accelerated https:// rendering, as well as convenience classes that simplify the writing of OpenGL code and hides the complexities of extension handling and the differences between OpenGL ES 2 and desktop OpenGL. The convenience classes include https:// that lets an application use all the OpenGL ES 2 functions on desktop OpenGL without having to manually resolve the OpenGL function pointers. This enables cross-platform development of applications targeting mobile or embedded devices, and provides classes that wrap native OpenGL functionality in a simpler Qt API:

  • QOpenGLBuffer

  • QOpenGLFramebufferObject

  • QOpenGLShaderProgram

  • QOpenGLTexture

  • QOpenGLDebugLogger

  • QOpenGLTimerQuery

  • QOpenGLVertexArrayObject

Finally, to provide better support for the newer versions (3.0 and higher) of OpenGL, a versioned function wrapper mechanism is also available: The QOpenGLFunction_N_N family of classes expose all the functions in a given OpenGL version and profile, allowing easy development of desktop applications that rely on modern, desktop-only OpenGL features.

For more information, see the OpenGL Window Example.

The Qt GUI module also contains a few math classes to aid with the most common mathematical operations related to 3D graphics. These classes include https://, https://, and https://.

A https:// created with the https:// can be used in combination with https:// and QOpenGLPaintDevice to have OpenGL hardware-accelerated 2D graphics by sacrificing some of the visual quality.

Vulkan Integration▲

Qt GUI has support for the https:// API. Qt applications require the presence of the https://.

On Windows, the SDK sets the environment variable VULKAN_SDK, which will be detected by the configure script.

On Android, Vulkan headers were added in API level 24 of the NDK.

Relevant classes:

  • QVulkanDeviceFunctions

  • https://

  • QVulkanFunctions

  • https://

  • https://

  • https://

  • https://

For more information, see the https:// and the https://.

Drag and Drop▲

Qt GUI includes support for drag and drop. The https:// overview has more information.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.