Qt中如何添加.qrc文件

You need a resource file (.qrc) within which you embed the input text file. The input file can be any .txt file with a paragraph of text. Create a text file called input.txt and store it in the textfinder folder.

To add a resource file:

Select File > New File or Project > Qt > Qt Resource File > Choose.


"New File or Project dialog"

The Choose the Location dialog opens.

"Choose the Location dialog"

In the Name field, enter textfinder.
In the Path field, enter C:QtexamplesTextFinder, and click Next or Continue.
The Project Management dialog opens.

"Project Management dialog"

In the Add to project field, select TextFinder.pro and click Finish or Done to open the file in the code editor.
Select Add > Add Prefix.


In the Prefix field, replace the default prefix with a slash (/).
Select Add > Add Files, to locate and add input.txt.
"Editing resource files"

原文地址:https://www.cnblogs.com/guxuanqing/p/4753460.html