Qt Quick 工具和实用程序

Qt offers several tools and utilities to enable a rich developer experience, especially for Qt Quick developers. The following sections provide a brief introduction to those tools and utilities, and provide links to further information about them.

Qt Creator

Qt Creator IDE is the key tool that enhances the overall developer experience of working with Qt and Qt Quick. Its editing, formatting, profiling and debugging features for Qt Quick make working with Qt Quick easier.

Qt Design Studio

Qt Design Studio enables designing Qt Quick-based UIs using simple drag-n-drop gestures that most designers are familiar with. It offers UI elements from the Qt Quick and Qt Quick Controls modules, as well as integration for custom UI elements.

QML Debugger

QML debugger is a very useful utility that enables:

  • debugging JavaScript functions,
  • executing JavaScript expressions,
  • and inspecting QML properties.

The QML debugger is part of both Qt Creator and Qt Design Studio .

QML Profiler

QML profiler enables you to get necessary diagnostic information, allowing you to analyze the application code for performance issues. For example, too much JavaScript in each frame, long-running C++ functions, and so on.

The profiler is part of both Qt Creator and Qt Design Studio .

QmlLive

QmlLive is a 3rd party tool that offers a QML runtime capable of rendering changes to the code in realtime. It avoids the need to rebuild the application after every code change and install it on the target device. You can also extend it to build a custom runtime that suits your needs.

GammaRay

GammaRay is a useful utility that provides diagnostic information about your application. It is similar to the QML Profiler described in the earlier section, but offers a lot more. For example, the number of items or QObjects created, function calls made, time taken by each function call, property value introspection at runtime, and so on. Such information is very handy, especially while debugging QML applications.

Squish

Squish is a well-known testing tool that automates UI testing by recording your actions or running scripts. Once the tests are setup, UI tests are a lot easier to run.

qmllint

qmllint is a tool shipped with Qt, that verifies the syntatic validity of QML files. It also warns about some QML anti-patterns. If you want to disable a specific warning type, you can find the appropriate flag for doing so by passing --help on the command line.

See the full documentation page of qmllint 了解细节。

qmlformat

qmlformat is a tool that automatically formats QML files in accordance with the QML 编码约定 .

The tool groups all properties, functions, and signals together, instead of retaining the order you specified.

Imports will also be sorted in alphabetical order. This can be disabled by specifying the -n 标志。

By default, qmlformat writes the formatted version of the file to stdout. If you wish to have your file updated in-place specify the -i 标志。