QT adds version information to the application (settings for RC files, available with QT built-in variables)

Source: Internet
Author: User

作者:daodaoliang时间:2016年7月11日16:12:09版本:V 0.0.4邮箱:[email protected]
0. Environmental statement
    • System environment: WIN10 64-bit
    • Qt Environment: Qt-lib 5.6.0
    • QCREAT0R 3.6.1
1. Use the. rc file 1.1 to create under the project .rcFile

For example version.rc :

# if defined(UNDER_CE)#  include <winbase.h># else#  include <windows.h># endifVS_VERSION_INFO VERSIONINFOFILEVERSION 1,0,2,0PRODUCTVERSION 1,0,2,0FILEFLAGSMASK 0x3fL#ifdef _DEBUGFILEFLAGS VS_FF_DEBUG#elseFILEFLAGS 0x0L#endifFILEOS VOS__WINDOWS32FILETYPE VFT_DLLFILESUBTYPE 0x0LBEGINBLOCK "StringFileInfo"BEGINBLOCK "040904b0"BEGINVALUE "CompanyName", "NS\0"VALUE "FileDescription", "数据库测试类库\0"VALUE "FileVersion", "1.0.1.0\0"VALUE "LegalCopyright", "@2016\0"VALUE "OriginalFilename", "NDBPool1.dll\0"VALUE "ProductName", "NDBPool\0"VALUE "ProductVersion", "1.0.1.0\0"ENDENDBLOCK "VarFileInfo"BEGINVALUE "Translation", 0x0409, 1200ENDEND/* End of Version info */
1.2 Modifications proFile

Add in Project fileRC_FILE += ./version.rc

2. Using built-in variables
 VERSION = 1.2.3 QMAKE_TARGET_PRODUCT = 产品名称 QMAKE_TARGET_COMPANY = 公司 QMAKE_TARGET_DESCRIPTION = 文件描述 QMAKE_TARGET_COPYRIGHT = 版权
3. Anti-crater Tips

Be sure to ensure that the RC file is GBK format, otherwise it will be garbled, the generated RC file is UTF-8 format by default

http://daodaoliang.com/blog/2016/07/11/Qt%E7%BB%99%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%B7%BB%E5%8A%A0%E7%89 %88%e6%9c%ac%e4%bf%a1%e6%81%af.html

QT adds version information to the application (settings for RC files, available with QT built-in variables)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.