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 ?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With