Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenGL issues in QT5
Qt 6.11 is out! See what's new in the release blog

OpenGL issues in QT5

Scheduled Pinned Locked Moved General and Desktop
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.
  • E Offline
    E Offline
    electrohamster
    wrote on last edited by
    #1

    I'm having some difficulty with OpenGL in Qt5 and am not sure I know what I'm doing wrong.

    I can run the 5.0 OpenGL examples fine and I can run the NeHe 4.8 OpenGL examples fine http://qt-project.org/wiki/NeHe_in_Qt

    When I convert the simple NeHe 4.8 examples to 5.0 though the only thing that works is clearing the screen to black, none of the polygons are rendered.

    I found this post which which implies that the OpenGL context works differently in Qt5 http://qt-project.org/forums/viewthread/20033

    For reference, my ultimate goal is to use a QDeclarativeView with an QGLWidget for the viewport and a QGraphicsScene for the scene with glut calls in drawBackground(QPainter *painter, const QRectF &rect)

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      My advice is start off simple and just use a QWindow subclass, create yourself a QOpenGLContext to get your own rendering working.

      Once that is working, change your window class to inherit from QDeclarativeView and set a QML scene on it and integrate your rendering.

      These two videos may be of interest to you ;)

      http://www.youtube.com/watch?v=VxsS7u-vgc8&list=PLizsthdRd0YzYe5T3Txgg7TUGVi-ijq4d&index=20

      http://www.youtube.com/watch?v=GYa5DLV6ADQ&list=PLizsthdRd0YzYe5T3Txgg7TUGVi-ijq4d&index=21

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      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