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. Is it alternative of windowClosed event for openglwindow?
Forum Updated to NodeBB v4.3 + New Features

Is it alternative of windowClosed event for openglwindow?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 1.2k Views 2 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.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by
    #1

    How to catch the event of X button pressed on opengl rendering window closed?
    void windowClosed(CloseEvent * ce) Does not appear to work for opengl window.

    1 Reply Last reply
    0
    • m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi,
      I would think the x-button is part of a widget not of a (opengl)window. The usual way is to override the widget's closeEvent. But if you generate the widget from the (opengl)window you cannot do it directly. You can probably include the widget in the layout of another widget where you can then override the closeEvent.
      -Michael.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by SGaist
        #3

        Hi,

        To add to @m-sue, what do you need to do when your QOpenGLWindow closes ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          To add to @m-sue, what do you need to do when your QOpenGLWindow closes ?

          Q Offline
          Q Offline
          Q139
          wrote on last edited by Q139
          #4

          Hi,
          To change bool variable in other class depending if rendering or closed window.
          The opengl window condition could be checked in some timed loop also, it is not important to capture the exact moment.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Then why not use the visible property for that ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • BuckwheatB Offline
              BuckwheatB Offline
              Buckwheat
              wrote on last edited by
              #6

              You could also create a SIGNAL and emit it that says your custom window has closed. If you are do not know the pointer to the QOpenGLWindow to connect to it, you could route through a parent class by creating the same signal, connecting the QOpenGLWindow to the parent signal, then connecting the obtaining slot to the parent window.

              Seems like a round about way, but signals and slots are useful in many ways. It is like a router pattern for signals and slots.

              Dave Fileccia

              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