Qt adds image resources
1. How to add pictures
a. Save the images in a file and load them at runtime.
b. Include the XPM file in the source code.
c. Use Qt's resource mechanism.
2. Use the Qt resource mechanism to add pictures
1. First put an images folder containing image files into the project directory.
images folder
2. In the resource project to be added, right-click the project name, select Add New File, and select: Qt->Qt Resource File.
3. Click the choose button, set the name
4. Click Next, and click Finish.
5. The resource file addition of the project is completed.
6. Add a prefix to the file. Adding a prefix can facilitate management. Click the Add button and choose to add a prefix. This text is prefixed with "/".
7. To add a picture file, click Add, click Add File to open images, select the file to be added, and click Open.
8. If the file list is the content of the red box on the left, you can choose to rebuild it to display it.
9. Use these images
a. ": + prefix name + file name";
b. Right-click the file to be used, and click Copy Path ":...".