如何在qt中设置.exe文件的属性?

有没有办法设置app.exe的属性? 我在Windows上工作,我的意思是,当你右键点击.exe文件,你可以select属性和细节,你可以设置描述,版本,名称等。有没有人知道在代码中设置它的方式?

您将需要添加如下内容:

win32:RC_FILE = application.rc 

到您的.pro文件。 application.rc文本文件可能包含以下信息,包括图标:

 IDI_ICON1 ICON DISCARDABLE "resources/Email.ico" # if defined(UNDER_CE) # include <winbase.h> # else # include <winver.h> # endif VS_VERSION_INFO VERSIONINFO FILEVERSION 0,4,0,0 PRODUCTVERSION 0,4,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 "040904B0" BEGIN VALUE "CompanyName", "My company\0" VALUE "FileDescription", "My application\0" VALUE "FileVersion", "0.4.0.0\0" VALUE "LegalCopyright", "Copyright (C) 2010-2014 John Daw (email@mail.com)\0" VALUE "OriginalFilename", "application.exe\0" VALUE "ProductName", "My Application 0.4\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END /* End of Version info */