Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Trying to draw QGLWidget in a QML file, only glClear works?
Forum Updated to NodeBB v4.3 + New Features

Trying to draw QGLWidget in a QML file, only glClear works?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    faenil
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      minimoog77
      wrote on last edited by
      #2

      Maybe this will help http://doc.qt.nokia.com/latest/qpainter.html#beginNativePainting

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved