(转自:http://blog.csdn.net/libaineu2004/article/details/17362777)
Windows下的.exe可执行文件的属性中有版本这个信息,含有版本信息、描述、版权等。对于qt程序,要含有这样的信息,那就请如下操作:新建<工程名>.rc文件,在rc文件填入下的信息:
#ifdefined(UNDER_CE) #include<winbase.h> #else #include<winver.h> #endif VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "080404b0" BEGIN VALUE "CompanyName","BeiJingXXXXCo.,Ltd." VALUE "FileDescription","IndustrialControlSystem" VALUE "FileVersion","1.0.0.0" VALUE "InternalName","QtStudio.exe" VALUE "LegalCopyright","Copyright(C)2001-2013" VALUE "OriginalFilename","QtStudio.exe" VALUE "ProductName","QtStudio" VALUE "ProductVersion","1.0.0.0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation",0x804,1200 END END
然后将pro文件的RC_FILE = <工程名>.rc,如此一来编译生成的程序就会含有版本信息。