Missing QEvent::MouseButtonRelease in QApplication event filter



  • 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?


  • Lifetime Qt Champion

    Hi,

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



  • @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?


  • Lifetime Qt Champion

    What about using the open method ?



  • 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;
    }
    };
    

  • Lifetime Qt Champion

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.