QMake 和 Uic
来源:互联网 发布:网络通信sig加密 编辑:程序博客网 时间:2024/06/08 19:40
qmake 和 uic都很好用 qmake用来生成makefile文件 然后交给编译器来进行编译 uic将QtDesigner生成的ui文件解析成ui_uifilename.h文件(user interface complier)
qmake链接:
http://www.kuqin.com/qtdocument/qmake-manual-5.html
http://www.antsight.com/liyi/qt/qmake-manual-4.html
http://www.cuteqt.com/blog/?tag=uic
都很实用 可以轻易掌握qmake
uic:
Description
This page documents the User Interface Compiler for the Qt GUI toolkit.The uic reads a user interface definition (.ui) file in XML asgenerated by Qt Designer and creates corresponding C++ header or sourcefiles. It also generates an image file that embeds raw image data inC++ source code.
Generate declaration:
uic [options] <file>
Generate implementation:
uic [options] -impl <headerfile> <file>
<headerfile>: name of the declaration file
Generate image collection:
uic [options] -embed <project> <image1> <image2> <image3> ...
<project>: project name <image[1..n]>: image files
For convenience, uic can also generate declaration or implementation stubs for subclasses.
Generate subclass declaration:
uic [options] -subdecl <subclassname> <baseclassheaderfile> <file>
<subclassname>: name of the subclass to generate
<baseclassheaderfile>: declaration file of the baseclass
Generate subclass implementation:
uic [options] -subimpl <subclassname> <subclassheaderfile> <file>
<subclassname>: name of the subclass to generate
<subclassheaderfile>: declaration file of the subclass
General Options
-o file
Write output to file rather than to stdout.
-nofwd
Omit forward declarations of custom classes in the generated header file. This is necessary if typedef classes are used.
-tr func
Use func() instead of tr() for internationalization.
-version
Display the version of uic and exit.
Usage
uic is almost always invoked by make(1), rather than by hand.
Here are useful makefile rules if you only use GNU make:
%.h: %.ui
uic $< -o $@
%.cpp: %.ui
uic -impl $*.h $< -o $@
If you want to write portably, you can use individual rules of the following form:
NAME.h: NAME.ui
uic $< -o $@
NAME.cpp: NAME.ui
uic -impl $*.h $< -o $@
You must also remember to add NAME.cpp to your SOURCES (substitute yourfavorite name) variable and NAME.o to your OBJECTS variable.
(While we prefer to name our C++ source files .cpp, the uic doesn'tcare, so you can use .C, .cc, .CC, .cxx or even .c++ if you prefer.)
- QMake 和 Uic
- qmake 会自动调用uic吗?
- uic
- qmake和tmake
- qmake和nmake
- qmake
- QMake
- qmake
- QMake
- qmake
- qmake
- qmake
- qmake
- qmake
- qmake
- qmake
- qmake
- qmake
- Microsoft SQL Server 2000完全卸载与重新安装
- WebLogic Performance Tuning学习笔记
- 解决cmd中文乱码
- 驱动程序中USB设备的配置过程
- PHP的随机名言
- QMake 和 Uic
- 在VMWare中配置SQLServer2005镜像 Step by Step(二)——配置镜像
- C# 多线程的问题
- Qt 发布程序
- 想下个 project 2007教程,郁闷的事
- 寻找优秀的程序员之实战指南-2
- 常用正则表达式
- Windows7 开机桌面黑屏故障终极解决方案
- 哈佛大学图书馆墙上的训言