Create resource files
The Qt Resource System is a platform-independent mechanism for storing files in the application's executable.
To create a resource file:
- Select File > New File > Qt > Qt Resource File > Choose.
- Follow the instructions of the wizard to create a resource collection file (.qrc).
- Open the resource file in the resource editor.
- Select Add Files to locate and add individual files.
To list the folders and files in ascending alphabetic order in the source tree, select Sort Alphabetically in the context menu.
By default, resources in the application are accessible under the same file name as they have in the source tree, with a
:/ prefix, or by a URL with a
qrc scheme. To specify a path prefix for all files in the
.qrc file, select Add Prefix and enter the prefix in the Prefix field.
Some resources need to change based on the user's locale, such as translation files or icons. You can specify a locale in the Language field.
Use a lowercase, two-letter ISO 639 language code, such as de, en, or fr.
Select Remove to remove the selected file from the resource collection.
In the Remove File dialog, select the Delete file permanently check box to remove the file from the file system.
To remove files that cannot be found in the file system, select Remove Missing Files.
The above functions are also available in the context menu in the Projects view.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.