Results 1 to 2 of 2

Thread: Trying to draw my QGLWidget in a QML file...only glClear works?

  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Trying to draw my QGLWidget in a QML file...only glClear works?

    hi guys, I'm coding a 3d game, I have my working qglwidget, but now I want to embed it into a qml file, to add UI and stuff.

    So I made a QDeclarativeItem, copied QGLWidget's paintGL() to paint(...) of the QDeclarativeItem...

    then registered the item as a qml Type, and created a simple qml file with that object inside it...(also set a new QGLWidget as QDeclarativeView's viewport)
    result:

    the glClear which is at the beginning of the paint is called (the screen is cleared with the right color), but the rest of the things are not drawn.
    At the end of the paint glGetError returns 0, so there are apparently no glErrors during the paint, but nothing is drawn...

    What am I doing wrong?

    Thanks in advance,
    faenil

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Trying to draw my QGLWidget in a QML file...only glClear works?

    Quote Originally Posted by faenil View Post
    So I made a QDeclarativeItem, copied QGLWidget's paintGL() to paint(...) of the QDeclarativeItem...
    You really did what you claim here? I'm asking because QGLWidget::paintGL() is empty... What did you really do?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QGLWidget: Draw 100% of image (even when hidden)
    By JohnnyRep in forum Qt Programming
    Replies: 5
    Last Post: 28th January 2016, 14:46
  2. Replies: 7
    Last Post: 13th September 2011, 14:39
  3. Replies: 3
    Last Post: 6th July 2011, 06:59
  4. Replies: 10
    Last Post: 10th February 2011, 23:31
  5. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06

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.