如何获取存储在.qrc Qt Resorce文件中的文件列表? [英] how to get list of files stored in a .qrc Qt Resorce file?
本文介绍了如何获取存储在.qrc Qt Resorce文件中的文件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对Qt非常陌生。.在我的程序中,我在.qrc资源文件中添加了一些图标文件。
I'm very new to Qt..and in my program i have added some icon files in .qrc resource file.
我们如何在程序中列出存储在qrc中的文件?
How can we list in our program the files stored in qrc ?
推荐答案
下面的示例代码应该执行此操作:
Here's example code that should do it:
QDirIterator it(":", QDirIterator::Subdirectories);
while (it.hasNext()) {
qDebug() << it.next();
}
文档链接:
http://doc.qt.io/qt-5/qdiriterator.html
这篇关于如何获取存储在.qrc Qt Resorce文件中的文件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文