Qt 特征概述

This document provides a summary of the most important features of Qt, providing links to other pages in the documentation that cover these features in more detail. It is not intended to be a comprehensive guide to Qt's features.

Qt 中的基础技术

Qt is built upon a set of core technologies, provided by the QtCore and QtGui modules. These include the following:

The mature classes provided by these technologies have been used to build robust, cross-platform desktop applications. They are augmented by a number of additional technologies and improvements that have appeared over the lifetime of Qt 4.

图形用户界面




Alongside the support for traditional desktop user interfaces, Qt includes support for declarative UI development with Qt Quick , a set of technologies for creating fluid, dynamic user interfaces. A starting point for exploring this approach can be found in the Qt Quick 介绍 guide.

Qt provides a range of standard user interface elements, called widgets, for each supported platform. Widgets can be used as containers for other widgets, as windows, and as regular controls that the user interacts with. Where the platform supports it, widgets can be made to appear partially transparent, and may be styled with Qt 样式表 .

支持 touch input and gestures enable widgets to be used to create intuitive user interfaces for touch-enabled devices.

User interfaces can also be created dynamically at run-time with the features provided by the QtUiTools 模块。

A selection of available widgets are shown in the Qt Widget 图库 . An introduction to the concepts behind widgets can be found in the Widget 教程 .


描绘、打印和渲染

Widgets are just one of many kinds of paint device that Qt can render onto. This support for unified painting makes it possible for applications to use the same painting code for different tasks, as well as allowing Qt to be extended to support additional file formats.

Qt provides support for common bitmap image formats, SVG (可伸缩向量图形) (SVG) drawings and animations, Postscript and Portable Document Format (PDF) files. Postscript and PDF are integrated with Qt's printing system , which also allows printed output to be previewed.

Interactive graphics can be created with the 动画框架 , allowing animations to be used with both widgets and graphics items. Animations can be used with the state machine framework , which provides a way to express application logic and integrate it with the user interface. Animations can be enhanced with a collection of graphics effects that operate on graphics items and can be applied individually or combined to create more complex effects.

Qt supports integration with OpenGL on a number of levels, providing convenience functions for handling textures and colors, as well as providing support for pixel and sample buffers. Future support for higher level 3D integration is provided by Qt3D enablers which include matrix multiplication , quaternions , and an API for vertex and fragment shaders .

Two APIs are provided for multimedia. The Phonon Multimedia Framework has traditionally been used on desktop platforms. A set of multimedia services provides low-level access to the system's audio system and is often used on mobile devices.


基础设施

Facilities for Inter-Process Communication (IPC) and Remote Procedure Calling (RPC) mechanisms are available on platforms that support the D-Bus message bus system.

An Undo framework based on the Command pattern is designed to enable a consistent approach to handling data in editing applications.

The QtScript and QtScriptTools modules provide support for application scripting and debugging using the ECMAScript language.

The QtHelp 模块 provides the foundations of an interactive help system that can be used in conjunction with Qt Creator or integrated into applications directly.

XML handling is supported in a number of places in Qt. The QtCore module provides classes for reading and writing XML streams. The QtXmlPatterns module includes XQuery , XPath and XSLT support, providing facilities for XML processing beyond that supported by the QtXml module, which contains SAX and DOM parsers. XML schema validation in the QtXmlPatterns module covers large parts of version 1.0 of the specification.


Web 客户端集成

Integration between Qt and WebKit makes it possible for developers to use a fully-featured Web browser engine to display documents and access online services. Developers can access the browser's environment to create documents and run scripts within one or more browser widgets.

A DOM access API for QtWebKit provides a cleaner and safer way to access elements and structures of Web pages without the use of JavaScript.

延伸阅读

Many of the technologies mentioned here, as well as other, more specific features, are listed in the Qt 4 的新功能 document. A complete list of Qt's modules can be found on the 所有模块 page, which also includes more domain-specific technologies.

The tools that are supplied with Qt are covered by the listing in the Qt's Tools 文档。