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. Weird behavior with several QOpenGLWidgets and QVTKWidgets
Forum Updated to NodeBB v4.3 + New Features

Weird behavior with several QOpenGLWidgets and QVTKWidgets

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 264 Views
  • 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.
  • gde23G Offline
    gde23G Offline
    gde23
    wrote on last edited by
    #1

    Hello,

    i have a GUI that has a QOpenGLWidget in it.
    Further there are dialogs that have QVTKWidgets in them.
    Now I get the weird behavior, that when I rotate the view in the QOpenGLWidget, then click on the dialog QVTKWidget and then back to the mainwindow GUI glGetFloatv(GL_MODELVIEW_MATRIX, matrix) returns a unit matrix instead of the actual rotated one.
    There seems to be some cross-talk between the widgets.
    Further there are QOpenGLWidgets in a dialog which sometimes stay black (however most of the time work)
    Do I need to consider something special when working with several OpelGl-based Widgets?

    1 Reply Last reply
    0
    • gde23G Offline
      gde23G Offline
      gde23
      wrote on last edited by gde23
      #2

      Solved the first problem myself.

      there needs to be

      QOpenGLWidget::makeCurrent();
      

      inserted at the beginning of the mouseEvent() for the rotation.
      Otherwise it might use the wrong context for the rotation.

      To solve the second problem (staying black) before creating the OpenGLDialog the surface Format has to be reset:

          QSurfaceFormat fmt;
          QSurfaceFormat::setDefaultFormat(fmt);
      
      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