No resource file in Qt Creator

I use Qt Creator and I created a resource file. When I try to access the resource file, when I work in design mode, it says that the root of the resource is empty.

How can I specify a dir resource? Why is it not displayed if it is in the same folder?

+5
source share
1 answer

To use a resource file, even if it is in the same folder, you must add the resource file to the project in Qtcreator to use it. Just right-click on the project name in your project tree in QtCreator and click on add existing files, then you add your resource file, and now you can use your resource in your project.

, .

 QResource::registerResource("/path/yourresource.rcc");

:/ qrc:///.

: qrc:///files/yourfile yourfile, files resource.

+2

All Articles