此頁麵文檔
uic (用戶界麵編譯器)
為
Qt Widgets
模塊。
uic
讀取 XML 格式的用戶界麵定義 (
.ui
) 文件如生成通過
Qt Designer
並創建相應的 C++ 頭文件。
用法:
uic [options] <uifile>
下錶列齣的命令行選項識彆通過
uic
.
| 選項 | 描述 |
|---|---|
-o <file>
|
寫入輸齣到
<file>
instead of to standard output.
|
-tr <func>
|
使用
<func>
for translating strings instead of
tr()
.
|
-p
|
Don't generate guards against multiple inclusion (
#ifndef
FOO_H ...).
|
-h
|
顯示用法和選項列錶。 |
-v
|
顯示
uic
的版本號。
|
-d
|
Display the dependencies for the UI. |
-n
|
Don't generate any #include directives. |
--postfix <postfix>
|
追加
<postfix>
to all generated classnames.
|
--include <file>
|
Add #include
<file>
to the output.
|
若使用
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).