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. QGLWidget - how to draw from another class or passing data to QGLWidget
Forum Updated to NodeBB v4.3 + New Features

QGLWidget - how to draw from another class or passing data to QGLWidget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 489 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 implemented something similar to the simle GL-example .
    I have another class, that contains some data which gets calculated somewhere else (list of pairs of points that shall be painted as lines)
    How can i draw from this other class or pass the data to the GLWidgetClass to be used in the draw() methode?

    jsulmJ 1 Reply Last reply
    0
    • gde23G gde23

      Hello,

      i have implemented something similar to the simle GL-example .
      I have another class, that contains some data which gets calculated somewhere else (list of pairs of points that shall be painted as lines)
      How can i draw from this other class or pass the data to the GLWidgetClass to be used in the draw() methode?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @gde23 You can emit a signal in this class as soon as new data is available. Then connect a slot in your QGLWidget to this signal. The signal can pass the data to draw as parameter.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

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

        I solved it by adding a list to the GL object containing all the pointers to the objects to draw (i already hat this list), but thanks anyway.

        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