如何获取存储在 .qrc Qt Resorce 文件中的文件列表? [英] how to get list of files stored in a .qrc Qt Resorce file?

查看:18
本文介绍了如何获取存储在 .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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆