[Qt] Introduction to Qt

00. Table of Contents

01. Qt overview

QT is a cross-platform C++ graphical user interface library, produced by TrollTech, Norway. It currently includes Qt Creator, QtEmbedded, Qt Designer rapid development tools, Qt Linguist internationalization tools and other parts. Qt supports all Linux/Unix systems and Windows Platform, Mac platform, etc.

02. Qt advantages

Qt is a cross-platform C++ graphical user interface application framework that provides application developers with all the functions needed to build an artistic graphical user interface. Qt is easy to extend and allows true component programming. Qt is the same graphical interface library as GTK, KDE, MFC, OWL, VCL, and ATL.

The advantages of QT are as follows:

2.1 Excellent cross-platform features

Qt supports the following operating systems: Microsoft Windows, Linux, Solaris, SunOS, HP-UX, Digital UNIX (OSF/1, Tru64), Irix, FreeBSD, BSD/OS, SCO, AIX, OS390, QNX, etc.

2.2 Object-oriented

Qt's good packaging mechanism makes Qt a very high degree of modularity, good reusability, and very convenient for user development. Qt provides a safe type called signals/slots to replace callback, which makes the collaboration between various components very simple.

2.3 Rich API

Qt includes more than 250 C++ classes, and also provides template-based collections, serialization, file, I/O device, directory management, and date/time classes.

2.4 Support 2D/3D graphics rendering, support OpenGL

2.5 A large number of development documents

2.6 XML, JSON support, etc.

03. Qt related tools

QT development tools include Qt Creator, Qt Designer, Qt Linguist, Qt Assistant, Qmake, CMake, etc.

3.1 Qt Creator

Qt Creator is a lightweight cross-platform integrated development environment for Qt development.

3.2 Qt Designer

Qt Designer is a powerful drag-and-drop graphical user interface layout and design tool.

The functions of Qt Designer are as follows:

A、支持表单和对话框的创建,可即时预览
B、与Qt版面系统集成
C、宏大的标准widgets集
D、支持客户定制的widgets和对话框
E、与Microsoft Visual Studio .NET无缝集成

The advantages of Qt Designer are as follows:

A、大大加快了界面的设计过程
B、支持所有平台上的本地外观感觉
C、开发者能在自行选择的工作环境内充分发挥其现有技能

3.3 Qt Linguist

Qt Linguist is a set of tools that supports quick and error-free translation of Qt applications. It is a set of tools that can streamline the international workflow.

The functions of Qt Linguist are as follows:

A、采集所有的用户界面文本并以一个简洁的窗口将其展现给人工译者
B、支持所有语言
C、从单一应用的二进制程序内部提供同时多语言支持及同时多写入系统

The advantages of Qt Linguist are as follows:

A、大大加快了翻译/本地化进程
B、与Qt的语言敏感排版引擎协同,以创建与语言不相关的简洁一致的界面
C、轻松应对国际市场

3.4 Qt Assistant

Qt Assistant is a customizable and redistributable help file and document reader.

The functions of Qt Assistant are as follows:

A、简单明快的web浏览器般导航、书签和文档文件连接
B、支持富文本HTML
C、全文本关键词查阅
D、可定制并随Qt供应

The advantages of Qt Assistant are as follows:

A、无需再从头开始构建帮助系统
B、充分利用现有的HTML技能
C、以方便搜寻和导航的格式向最终用户提供文档

3.5 QMake

Qmake cross-platform makefile generator.

The functions of Qmake are as follows:

A、读取工程源码,生成依赖关系树,生成平台相关工程和makefiles
B、与Visual Studio及Xcode集成

The advantages of Qmake are as follows:

A、无需担忧跨平台编译
B、降低对makefile手工构建的需求度

3.6 CMake

CMake is a cross-platform installation (compilation) tool, you can use simple sentences to describe the installation (compilation process) of all platforms. It can output a variety of makefile or project files, and can test the C++ features supported by the compiler, similar to automake under UNIX. Only the configuration file of CMake is named CMakeLists.txt. Cmake does not directly construct the final software, but generates standard construction files (such as Makefile for Unix or projects/workspaces for Windows Visual C++), and then use it in the usual way of construction. This allows developers who are familiar with an integrated development environment (IDE) to build their software in a standard way. This ability to use the native construction system of various platforms is what distinguishes CMake and SCons from other similar systems.

3.7 Other tools

A. lupdate: Extract the string to be translated from the source code file or other resource files, and save it into the .ts file in xml format.

B. lrelease: Responsible for converting .ts files into .qm files used by the program. The .qm file will remove all the blank and untranslated content in the .ts file and compress the storage format.

C. lconvert: used for format conversion between translation files.

D. QVFb: Virtual frame buffer device, simulated framebuffer device (size, color depth), and can also simulate the layout of the hardware keyboard (including special keys) through the skin, which can facilitate the development of embedded programs on the desktop system machine

E. makeqpf: Create qpf format for embedded devices. Qpf is a pre-rendered font, directly saved as binary content, and can be loaded with memory mapping when used, and the process from loading to drawing does not require calculation.

F, uic: User Interface Compiler. Generate C++ code from the user interface file (.ui).

G, rcc: Resource Compiler. The rcc tool embeds related resources into the Qt application during the compilation process according to the content of the .qrc file.

H, qtconfig: X11-based Qt configuration tool and online help.

I. qconfig: Qt Embedded (Linux and Windows CE) configuration tool.

J, qtdemo: Qt example and demo project loader.

K. qt3to4: A tool to assist in porting Qt 3 programs to Qt 4.

L, qdbusxml2cpp: QtDBus XML compiler. Convert D-Bus interface description in xml format into C++ source code

M. D-Bus Viewer: A tool that can view D-Bus objects and information.

N、Qt Visual Studio Add-in:Visual Studio集成

O, Qt Eclipse Integration: Eclipse integration

04. Qt Basic Module

  • Qt Concurrent
  • Qt Core
  • Qt Core Compatability APIs
  • Qt D-Bus
  • Qt GUI
  • Qt Help
  • Qt Network
  • Qt OpenGL
  • Qt Print Support
  • Qt QML
  • Qt Quick
  • Qt Quick 3D
  • Qt Quick Controls
  • Qt Quick Layouts
  • Qt Quick Timeline
  • Qt Quick Widgets
  • Qt Shader Tools
  • Qt SQL
  • Qt SVG
  • Qt Test
  • Qt UI Tools
  • Qt Wayland
  • Qt Wayland Compositor
  • Qt Widgets
  • Qt XML

05. Qt Extension Module

Qt 6.0 users can also obtain the following extension modules through the package manager:

  • Qt 3D
  • Qt Image Formats
  • Qt Network Authorization
  • M2M package: Qt CoAP
  • M2M package: Qt MQTT
  • M2M package: Qt OpcUA

We still use the installer as the backend of the package manager, and users need to use the Qt installer (or maintenance tool) to select additional libraries. We are looking for other solutions to improve Qt Creator's support for using additional libraries.

We plan to provide the following additional libraries in Qt 6.1:

  • Active Qt
  • Qt Charts
  • Qt Quick Dialogs (File dialog)
  • Qt ScXML
  • Qt Virtual Keyboard

Qt 6.1 version has completed the freezing of features in January, so currently only a small number of expansion modules are included. But later we will provide more extension modules for preview.

We plan to provide the following additional libraries in Qt 6.2:

  • Qt Bluetooth
  • Qt Data Visualization
  • Qt Lottie Animation
  • Qt Multimedia
  • Qt NFC
  • Qt Positioning
  • Qt Quick Dialogs: Folder, Message Box
  • Qt Remote Objects
  • Qt Sensors
  • Qt SerialBus
  • Qt SerialPort
  • Qt WebChannel
  • Qt WebEngine
  • Qt WebSockets
  • Qt WebView

Some modules are not listed above because:

  • They are deliberately removed from Qt 6 (such as Qt KNX, Qt Script, and Qt XML Patterns).
  • This function is or will be part of other modules, so it no longer needs to be a separate module (for example, platform-specific extras)
  • We plan to release them after Qt 6.2 LTS is released or through Qt Marketplace.
  • They are not part of the Qt framework, such as tools (Qt Creator, Qt Design Studio, etc.), Qt Safe Renderer, Qt Automotive Suite, etc.

06. Old version module

QT基础模块包括:
1) Qt Core,提供核心的非GUI功能,所有模块都需要Qt Core模块。Qt Core模块的类包括了动画框架、定时器、各个容器类、
时间日期类、事件、IO、JSON、插件机制、智能指针、图形(矩形、路径等)、线程、XML 等。
2) Qt Gui,提供 GUI 程序的基本功能,包括与窗口系统的集成、事件处理、OpenGL 和 OpenGL ES 集成、2D 图像、字体、拖放等,
一般由 Qt 用户界面类内部使用,也可以用于访问底层的 OpenGL ES 图像 API。Qt Gui 模块提供的是所有图形用户界面程序都需要
的通用功能。
3) Qt Multimedia,提供视频、音频、收音机以及摄像头等功能,需要在 pro 文件中添加 QT += multimedia。
4) Qt Network,提供跨平台的网络功能,需要在 pro 文件中添加 QT += network。
5) Qt Qml,提供供 QML(一种脚本语言,也提供 JavaScript 的交互机制) 使用的 C++ API,需要在 pro 文件中添加 QT += qml。
6) Qt Quick,允许在 Qt/C++ 程序中嵌入 Qt Quick(一种基于 Qt 的高度动画的用户界面,适合于移动平台开发),需要在 pro 文
件中添加 QT += quick。
7) Qt SQL,允许使用 SQL 访问数据库,需要在 pro 文件中添加 QT += sql。
8) Qt Test,提供 Qt 程序的单元测试功能,需要在 pro 文件中添加 QT += testlib。
9) Qt Webkit,基于 WebKit2 的实现以及一套全新的 QML API

QT扩展模块包括:
(1)Qt 3D,提供声明式语法,在 Qt 程序中可以简单地嵌入 3D 图像。Qt 3D 为 Qt Quick 添加了 3D 内容渲染。Qt 3D 提供了 
QML 和 C++ 两套 API,用于开发 3D 程序。
(2)Qt Bluetooth,提供用于访问蓝牙无线设备的 C++ 和 QML API。
(3)Qt Contacts,用于访问地址簿或者联系人数据库的 C++ 和 QML API。
(4)Qt Concurrent,封装了底层线程技术的类库,方便开发多线程程序。
(5)Qt D-Bus,是一个仅供 Unix 平台使用的类库,用于利用 D-Bus 协议进行进程间交互。
(6)Qt Graphical Effects,提供一系列用于实现图像特效的类,比如模糊、锐化等。
(7)Qt Image Formats,支持图片格式的一系列插件,包括 TIFF、MNG、TGA 和 WBMP。
(8)Qt JS Backend,模块没有公开的 API,是 V8 JavaScript 引擎的一个移植,仅供 QtQml 模块内部使用。
(9)Qt Location,提供定位机制、地图和导航技术、位置搜索等功能的 QML 和 C++ API。
(10)Qt OpenGL,方便在 Qt 应用程序中使用 OpenGL,仅仅为了程序从 Qt 4 移植到 Qt 5 的方便才保留下来,如果你需要在新的 
Qt 5 程序中使用 OpenGL 相关技术,需要使用的是 QtGui 模块中的 QOpenGL。
(11)Qt Organizer,使用 QML 和 C++ API 访问组织事件(organizer event)。organizer API 是 Personal 
Information Management API 的一部分,用于访问 Calendar 信息。通过 Organizer API 可以实现:从日历数据库访问日历时间、导入 
iCalendar 
事件或者将自己的事件导出到 iCalendar。
(12)Qt Print Support,提供对打印功能的支持。
(13)Qt Publish and Subscribe,为应用程序提供对项目值的读取、导航、订阅等的功能。
(14)Qt Quick 1,从 Qt 4 移植过来的 QtDeclarative 模块,用于提供与 Qt 4 的兼容。如果你需要开发新的程序,需要使用 
QtQuick 模块。
(15)Qt Script,提供脚本化机制。这也是为提供与 Qt 4 的兼容性,如果要使用脚本化支持,请使用 QtQml 模块的 QJS* 类。
(16)Qt Script Tools,为使用了 Qt Script 模块的应用程序提供的额外的组件。
(17)Qt Sensors,提供访问各类传感器的 QML 和 C++ 接口。
(18)Qt Service Framework,提供客户端发现其他设备的服务。Qt Service Framework 为在不同平台上发现、实现和访问服务定义了
一套统一的机制。
(19)Qt SVG,提供渲染和创建 SVG 文件的功能。
(20)Qt System Info,提供一套 API,用于发现系统相关的信息,比如电池使用量、锁屏、硬件特性等。
(21)Qt Tools,提供了 Qt 开发的方便工具,包括 Qt CLucene、Qt Designer、Qt Help 以及 Qt UI Tools 。
(22)Qt Versit,提供了对Versit API 的支持。Versit API是Personal Information Management API 的一部分,用于 QContacts
 和 vCard 以及 QOrganizerItems 和 iCalendar 之间的相互转换。
(23)Qt Wayland,仅用于Linux平台,用于替代 QWS,包括 Qt Compositor API(server)和 Wayland 平台插件(clients)。
(24)Qt WebKit,从 Qt 4 移植来的基于 WebKit1 和 QWidget 的 API。
(25)Qt Widgets,使用 C++ 扩展的 Qt Gui 模块,提供了一些界面组件,比如按钮、单选框等。
(26)Qt XML,SAX 和 DOM 的 C++ 实现。该模块已经废除,请使用 QXmlStreamReader/Writer。
(27)Qt XML Patterns,提供对 XPath、XQuery、XSLT 和 XML Schema 验证的支持。

07. Appendix

7.1 Summary of Qt tutorials
URL: https://dengjin.blog.csdn.net/article/details/115174639

Guess you like

Origin blog.csdn.net/dengjin20104042056/article/details/115264831