Trouble creating a QSGTexture
I am trying to create a QSGTexture so I can use it on a simple texture node in a QQuickItem:
Code:
QSGTexture
*tex
= view.
createTextureFromImage(QImage("qrc:/testfont.png"));
qDebug()<<"texture size at creation: "<<tex->textureSize().width();
This crashes the system every time it runs. I also tried putting just the file name in the QImage constructor, and while that didn't crash, the qDebug statement causes a crash when trying to test if it has a width attached.
Can anyone point out the error or point to an example of how to properly create a texture?
Re: Trouble creating a QSGTexture
I was having the same problem... uh...
"qrc" should be ommitted from the path.
so:
QImage(":/testfont.png")
works.