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

℡╲_俬逩灬. 提交于 2019-12-17 16:17:28

问题


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 ?


回答1:


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



来源:https://stackoverflow.com/questions/13509799/how-to-get-list-of-files-stored-in-a-qrc-qt-resorce-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!