此页面文档
uic (用户界面编译器)
为
Qt Widgets
模块。
uic
读取 XML 格式的用户界面定义 (
.ui
) 文件如生成通过
Qt Designer
并创建相应的 C++ 头文件。
用法:
uic [options] <uifile>
下表列出的命令行选项识别通过
uic
.
选项 | 描述 |
---|---|
-h, --help
|
显示命令行选项的帮助。 |
-v, --version
|
显示版本信息。 |
-d, --dependencies
|
显示依赖。 |
-o, --output <file>
|
Place the output into
<file>
|
-a, --no-autoconnection
|
Do not generate a call to
QObject::connectSlotsByName()
.
|
-p, --no-protection
|
Disable header protection. |
-n, --no-implicit-includes
|
Disable generation of
#include-directives. |
--postfix <postfix>
|
Postfix to add to all generated classnames. |
--tr, --translate <function>
|
Use <function> for i18n. |
--include <include-file>
|
Add #include
<include-file>
to
<file>
.
|
-g, --generator <python|cpp>
|
选择生成器。 |
--idbased
|
Use id based function for i18n |
--from-imports
|
Python: generate imports relative to
'.'
|
若使用
qmake
,
uic
will be invoked automatically for header files.
Here are useful makefile rules if you only use GNU make:
ui_%.h: %.ui uic $< -o $@
If you want to write portably, you can use individual rules of the following form:
ui_foo.h: foo.ui uic $< -o $@
You must also remember to add
ui_foo.h
to your
HEADERS
(substitute your favorite name).