【问题标题】:how to get list of files stored in a .qrc Qt Resorce file?如何获取存储在 .qrc Qt 资源文件中的文件列表?
【发布时间】:2012-11-10 16:19:43
【问题描述】:

我对 Qt 很陌生。在我的程序中,我在 .qrc 资源文件中添加了一些图标文件。

我们如何在我们的程序中列出存储在 qrc 中的文件?

【问题讨论】:

    标签: qt embedded-resource


    【解决方案1】:

    下面是应该做的示例代码:

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

    文档链接: http://doc.qt.io/qt-5/qdiriterator.html

    【讨论】:

    • 很好很简单的例子! +1
    猜你喜欢
    • 1970-01-01
    • 2014-07-13
    • 2012-12-13
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多