全部博文(17)
2011年(17)
分类: 嵌入式
2011-03-10 10:03:11
UserInterfaceCompiler (uic)
用户接口编译器(UIC)
This page documents the User Interface Compiler for the Qt GUI application framework. The uic reads a user interface definition (.ui) file in XML as generated by and creates corresponding C++ header or source files. It can also generate an image file to embed raw image data in C++ source code.
这页文档介绍QT图形编程应用框架下的UIC(User Interface Compiler),UIC读取用户接口定义文件(.UI),后缀是.ui这种XML格式文件是由qt另外一个工具Qt Desiger 产生的,UIC工具从 .ui文件产生C++头文件和实现文件,同时也能生成图像的C++代码,这种代码是embed raw image data格式数据。
UIC的使用 File Generation Options
Generate declaration:
产生声明文件,就是头文件.h
命令:uic [options]Generate implementation:
产生实现文件,就是.cpp文件
命令:uic [options] -implGenerate image collection:
产生图像格式C++代码
命令:uic [options] -embedFor convenience, uic can also generate declaration or implementation stubs for subclasses.
Generate subclass declaration:
产生子类声明。
命令:uic [options] -subdeclGenerate subclass implementation:
产生子类实现文件
命令:uic [options] -subimpl标准操作码,Options的所有格式
uic is almost always invoked by make (1), rather than by hand.
Here are useful makefile rules if you only use GNU make:
%.h: %.uiIf you want to write portably, you can use individual rules of the following form:
NAME.h: NAME.uiYou must also remember to add NAME.cpp to your SOURCES (substitute your favorite name) variable and NAME.o to your OBJECTS variable.
(While we prefer to name our C++ source files .cpp, the uic doesn't care, so you can use .C, .cc, .CC, .cxx or even .c++ if you prefer.)