Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Missing QEvent::MouseButtonRelease in QApplication event filter

Missing QEvent::MouseButtonRelease in QApplication event filter

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 3 Posters 1.6k 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.
  • A Offline
    A Offline
    allagar
    wrote on last edited by
    #1

    I have subclassed QApplication and used installEventFilter() to preview mousebottonpress and mousebuttonrelease events. Once my application detects 3 mousebottonpress events within a defined area it will display a dialog box. I also print the mouse event types being filtered and do see the press and release events for the first 2 press/releases. After receiving the 3rd press event, my dialog is launched and my filter doesn't display the release event. This always occurs. Once my dialog is displayed my event filter does capture press/release events. Any reason why my release event after my dialog is created is not captured by my QApplication event filter?

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

      Hi,

      Are you calling exec on your dialog ? If so, the events are now processed in that secondary event loop.

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

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Are you calling exec on your dialog ? If so, the events are now processed in that secondary event loop.

        A Offline
        A Offline
        allagar
        wrote on last edited by
        #3

        @SGaist Thanks for the reply, Yes I am calling mydialog.exec(). I was under the impression I would still catch the mouse events from the main application event queue before they where passed on to my dialog event queue. Once the dialog is displayed I do resume capturing mouse events from my application filter before thy are delivered to my dialog. It is only the last release mouse event that I miss before I create my dialog. I just cannot account for the missing mouse release event?

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

          What about using the open method ?

          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
          • T Offline
            T Offline
            Tusovshik
            wrote on last edited by Tusovshik
            #5

            Options and futures writers are required to have a sufficient amount of margin in their accounts to cover potential losses. The SPAN system, through its algorithms, sets the margin of each position to its calculated worst possible one-day move.

            //-------------------------------------------------------------------------------
            // P R E P A R I N G T I B C O
            //-------------------------------------------------------------------------------
            class IDT_Qt_ExceptionCatcher : public QApplication
            {
            public:
            IDT_Qt_ExceptionCatcher(int _argc, char *_argv[]) : QApplication(_argc, _argv) {};
            
            bool notify ( QObject * receiver, QEvent * event )
            {
            try
            {
            return QApplication::notify(receiver, event);
            }
            catch(...) { std::cout << "error" << std::endl; }
            
            return false;
            }
            };
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Tusovshik what does it have to do with the question at hand ?

              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

              • Login

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