I am trying to create a QSGTexture so I can use it on a simple texture node in a QQuickItem:
QSGTexture
*tex
= view.
createTextureFromImage(QImage("qrc:/testfont.png"));
qDebug()<<"texture size at creation: "<<tex->textureSize().width();
QSGTexture*tex= view.createTextureFromImage(QImage("qrc:/testfont.png"));
qDebug()<<"texture size at creation: "<<tex->textureSize().width();
To copy to clipboard, switch view to plain text mode
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?
Bookmarks