Qt Visual Studio add-in: Managing Resources

Source: Internet
Author: User

Adding new resources to a QT project is similar to adding resources to a normal c ++ project, the main difference being that. QrcFiles (QT resource files) are used instead of Windows. RCFiles. Unlike. RCFiles,. QrcFiles Work on all platforms supported by QT and are trivial to load from QT code.

To add new resources, you must first create a new. QrcFile. To do this, openAdd new itemDialog, selectQt resource fileFromQt project itemsFolder, and clickOpen. The newly created. QrcFile will be displayed in the qrc Editor, which is part of the add-in installation.

At this point,. QrcFile only contains a prefix named after the project. You can add resources under that prefix by selecting it and clicking onAddButton on the right hand side. Then clickAdd FileIn the context menu. NowResource EditorWill display a dialog that allows you to add an existing file.

When referring to the resources later on from QT code, you must prepend the prefix, the file name, and a colon. For example,:/Myproject/print.bmp. Using the context menu, you can rename the predefined prefix or add other prefixes to. QrcFile.

See the QT resource system document for more information.

 

Related Article

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.