How to read file from QRC?
Solved
General and Desktop
-
Hey
Bit annoying but I have this in QRC:
<RCC> <qresource prefix="/"> <file>data.glsl</file> </qresource> <qresource prefix="/openGL/"> <file alias="testX">file/test.glsl</file> </qresource> </RCC>
And I wish to load it as :
QString path = "/openGL/testX" loadShader(path); .... void loadShader(QString filePath){ QFile v(filePath); v.open(QIODevice::ReadOnly); qDebug() << v.readAll(); if (!mShader->addShaderFromSourceFile(QOpenGLShader::Vertex, v.readAll())) {
This seems to not work...
device not open
bla bla bla...What to do ?
TIA
-
-
Hey
Thanks for info!
I had another deep look at what I was doing... I forgot to add ":" !
"/openGL/testX"
to
":/openGL/testX"Blindness...
-
@Dariusz
Hi
Thats why i often use the copy trick :)
ctrl+k type some of the name, press enter, right click and copy
Almost as fast as writing it when i have nested folders.
1/4