Results 1 to 2 of 2

Thread: Trouble creating a QSGTexture

  1. #1
    Join Date
    Dec 2013
    Posts
    9
    Qt products
    Qt5
    Platforms
    Windows

    Default Trouble creating a QSGTexture

    I am trying to create a QSGTexture so I can use it on a simple texture node in a QQuickItem:

    Qt Code:
    1. QSGTexture*tex= view.createTextureFromImage(QImage("qrc:/testfont.png"));
    2. 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?

  2. #2
    Join Date
    Dec 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Trouble creating a QSGTexture

    I was having the same problem... uh...
    "qrc" should be ommitted from the path.
    so:
    QImage(":/testfont.png")
    works.

Similar Threads

  1. Replies: 2
    Last Post: 2nd November 2011, 03:08
  2. Replies: 0
    Last Post: 11th September 2011, 12:19
  3. Having Trouble Creating Classes
    By jstippey in forum Newbie
    Replies: 2
    Last Post: 17th March 2011, 15:22
  4. Trouble with creating custom class
    By jstippey in forum Qt Programming
    Replies: 9
    Last Post: 12th January 2011, 14:08
  5. SQL trouble
    By xmeister in forum Newbie
    Replies: 2
    Last Post: 25th March 2009, 11:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.