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.