How to access Qt resource data from non-Qt functions

后端 未结 3 1504
Happy的楠姐
Happy的楠姐 2021-01-02 04:19

As I understand it, the way to packages non-code resources such as data files in a Qt app is using the resource system. However, what if I want to access a resource using a

3条回答
  •  太阳男子
    2021-01-02 04:35

    What about opening the resource file with a QFile object, wrapping this with a QDataStream object, and wrapping this with a boost::iostreams::stream object, which derives from a specialization of std::basic_istream? Sounds complicated, but does not need too many lines of code, see this answer.

提交回复
热议问题