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. Event processing control on Widget
QtWS25 Last Chance

Event processing control on Widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • kragnfrolK Offline
    kragnfrolK Offline
    kragnfrol
    wrote on last edited by
    #1

    Hi,

    I'm working on a GIS app with Qt 5.6 and OpenGL.

    I was working on migrating Qt from 4.8.4 to 5.6.

    From this migration, I replaced QGLWidget with QOpenGLWidget.

    But now, it seems that my QOpenGLWidget are starting to process event to early. It start to receive and process "mouseEntered" event before the component is ready to fully process it, and there is stuff I need to do on mouseEntered.

    I need some help here to be able to disable event processing until everythings is ready and them re enable it.

    Is it a way to do this in Qt ?

    Regards,

    Valerian

    1 Reply Last reply
    0
    • Chris HennesC Offline
      Chris HennesC Offline
      Chris Hennes
      wrote on last edited by
      #2

      Event processing begins when QApplication::exec() is called, so do all of your setup before calling it.

      Chris Hennes, Pioneer Library System

      1 Reply Last reply
      0
      • kragnfrolK Offline
        kragnfrolK Offline
        kragnfrol
        wrote on last edited by
        #3

        I can't. I can open dynamically open as much widget as needed. Each one are supposed to hold a view with a different image. All of them are opened during the execution.

        mrjjM 1 Reply Last reply
        0
        • kragnfrolK kragnfrol

          I can't. I can open dynamically open as much widget as needed. Each one are supposed to hold a view with a different image. All of them are opened during the execution.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @kragnfrol

          Hi
          its hard to guess at with no code but maybe you can move some of the init code to the views constructor?

          I assume you do something like
          new View
          setup view

          to be even possible for it to get events before "Ready to fully process it"

          Trying to pause event loop is not a good idea as its also used for drawing etc so it would be better to find out why it get events when u think its still being setup.

          1 Reply Last reply
          1
          • kragnfrolK Offline
            kragnfrolK Offline
            kragnfrol
            wrote on last edited by
            #5

            Hi !

            Code is sadly too complex to be shown here in an understandable way.

            Each view has some "tools" which has to be activated when the mouse enter the view, and has to be disabled when the mouse leave.

            But when I create the QOpenGLWidget and call for show(), it receive a MouseEnteredEvent (even with setEnabled(false)).
            This event is too early, so I cannot set my tool, and I've to get my mouse out the view and back in again to make it works as usual.

            I need to call for show() because the surface needs to be created, but I just need to know if it is possible to delay that first MouseEnteredEvent.

            If it is not possible I'll try to find a workaround in my code.

            mrjjM 1 Reply Last reply
            0
            • kragnfrolK kragnfrol

              Hi !

              Code is sadly too complex to be shown here in an understandable way.

              Each view has some "tools" which has to be activated when the mouse enter the view, and has to be disabled when the mouse leave.

              But when I create the QOpenGLWidget and call for show(), it receive a MouseEnteredEvent (even with setEnabled(false)).
              This event is too early, so I cannot set my tool, and I've to get my mouse out the view and back in again to make it works as usual.

              I need to call for show() because the surface needs to be created, but I just need to know if it is possible to delay that first MouseEnteredEvent.

              If it is not possible I'll try to find a workaround in my code.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @kragnfrol
              Maybe give it an event filter and control what events are allowed until ready ?

              1 Reply Last reply
              1

              • Login

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