Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get list of files stored in a .qrc Qt Resorce file?

I'm very new to Qt..and in my program i have added some icon files in .qrc resource file.

How can we list in our program the files stored in qrc ?

like image 223
Kiran P Avatar asked Nov 22 '12 09:11

Kiran P


People also ask

What is a Qt resource file?

The Qt resource system is a platform-independent mechanism for shipping resource files in an application. Use it if your application always needs a certain set of files (like icons, translation files, images), and you don't want to use system-specific means to package and locate these resources.

What is Qt RCC?

The rcc tool is used to embed resources into a Qt application during the build process. It works by generating a C++ source file containing data specified in a Qt resource (. qrc) file.


1 Answers

Here's example code that should do it:

QDirIterator it(":", QDirIterator::Subdirectories); while (it.hasNext()) {     qDebug() << it.next(); } 

Link to documentation: http://doc.qt.io/qt-5/qdiriterator.html

like image 76
hyde Avatar answered Oct 22 '22 00:10

hyde