Can I use the Qt resource compiler with other libraries?

83 Views Asked by At

I use the qt resource system with png files. I create .a qrc file where I specify all the pictures I need and add it to my CMakeLists. The following code works great:

QPixmap pix(":/resources/image.png");

But can I somehow use compiled resources with other libraries, for example SFML? The following code won't work, are there any alternative ways?

sf::Texture txt;
sf::Sprite spr;
txt.loadFromFile(":resources/player.png");
spr.setTexture(txt);
1

There are 1 best solutions below

2
vltimvtxx On

Closed. I just used text.loadFromMemory(), in which parameters I passed the beginning and the size of the file.