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. Getting event filter to configure flags on qApp as global helper

Getting event filter to configure flags on qApp as global helper

Scheduled Pinned Locked Moved Unsolved General and Desktop
qevent
1 Posts 1 Posters 346 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 12 Jan 2020, 15:59 last edited by
    #1

    Hey

    I'm I've set global event filter on my app :

        QApplication a(argc, argv);
        a.installEventFilter(icEventMonitor::EM()); // this can be controlled by a flag.
    

    And set this routing inside my eventFilter() function to handle some selection changes/macros when user press shift/ctrl/mouse press/release etc.

        switch (eventType) {
            case QEvent::MouseButtonPress: {
                mInputManager->handleEventMouseButtonPress(static_cast<QMouseEvent *>(event));
                break;
            }
    
            case QEvent::KeyPress: {
                mInputManager->handleEventKeyPress(static_cast<QKeyEvent *>(event));
                break;
            }
    
        }
    
        bool v = QObject::eventFilter(object, event);
    
        switch (eventType) {
            case QEvent::MouseButtonRelease: {
                mInputManager->handleEventMouseButtonRelease(static_cast<QMouseEvent *>(event));
                break;
            }
            case QEvent::KeyRelease: {
                mInputManager->handleEventKeyRelease(static_cast<QKeyEvent *>(event));
                break;
            }
        }
    

    The issue I'm having is that when user release mouse button. This event here runs till end, unselects the mouse press flag and then notifives the object of change. Where as I though that by doing bool v = QObject::eventFilter(object, event); I can control when I notify widget of event change and then what action to perform post event.

    This class is meant to allow for holding shift, changing widgets/etc etc and still retain the selection flag/macro. Right now the mouse release event flags macro as "de-clicked" and then when widget gets it it has incorrect macro status as it should be as clicked/etc...

    Any ideas how to handle this eventFilter to allow for preWidget action - widgetAction - postWidgetAction workflow?

    TIA

    1 Reply Last reply
    0

    1/1

    12 Jan 2020, 15:59

    • Login

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