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. Mouse events and filter
Forum Updated to NodeBB v4.3 + New Features

Mouse events and filter

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k Views 1 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.
  • M Offline
    M Offline
    mohsen
    wrote on last edited by
    #1

    i've a problem with getting mouse release event in a specific situation. i capture child widgets events via "installEventFilter" and point them to their parent ("this")
    @
    bool mywidget::eventFilter(QObject *obj, QEvent event)
    {
    switch(event->type()){
    case QEvent::MouseButtonPress:
    QApplication::sendEvent(this,event);
    static_cast<QWidget
    >(obj)->setVisible(false);
    break;
    }

    return QObject::eventFilter(obj, event);
    

    }
    @

    as the code says, the pressed child gets hidden after the event has forwarded to the parent. now the mouse event has destroyed cuz the child's visibility went to false.
    The problem is here where i need to get the mouse release event but i don't get anything out.
    how can i transfer the event to the parent ("this") just like it is occurred for the parent? (keep it pressed)
    simply say getting the mousePressEvent() by child and mouseReleaseEvent() by parent

    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