Results 1 to 10 of 10

Thread: qmouseEvent handling

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Jul 2006
    Posts
    79
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: qmouseEvent handling

    i did that but now i can't even get to start the form... the eventFilter is run endlessly and sends the event directly to the parent:

    Qt Code:
    1. bool alarmScreen::eventFilter( QObject *obj, QEvent *ev )
    2. {
    3. //printf("got in\n");
    4. if ( obj == textScreen->viewport() )
    5. {
    6. printf("its the textEdit\n");
    7. if ( e->type() == QEvent::MouseButtonRelease )
    8. {
    9. printf("ad %d,%d\n",e->x(),e->y());
    10. return TRUE;
    11. }
    12. else
    13. {
    14. return FALSE;
    15. }
    16. }
    17. else
    18. if ( obj == this )
    19. {
    20. if ( e->type() == QEvent::MouseButtonRelease )
    21. {
    22. printf("af %d,%d\n",e->x(),e->y());
    23. return TRUE;
    24. }
    25. else
    26. {
    27. return FALSE;
    28. }
    29. }
    30. else
    31. {
    32. printf("sending event to parent");
    33. return alarmScreen::eventFilter( obj, ev );
    34. }
    35. }
    To copy to clipboard, switch view to plain text mode 

    it's very weird behaviour.. because when the mouse pointer flies over QTextEdits's frame border the eventFilter procedure is called and even when i click on the QTextEdits's frame border the right branch is called.. also when i click on the frame that lies (and covers) all of QWidget (alarmScreen) works properly..

    but, IN the white space of the QTextEdit (the writing space) it seems it is dead.. or that something else interecepts the mouse events before alarmScreen::eventFilter() can do so...
    thank you for your attempts to help
    nass
    Last edited by nass; 10th October 2006 at 11:42.

Similar Threads

  1. Keyboard Handling
    By ToddAtWSU in forum Qt Programming
    Replies: 4
    Last Post: 5th July 2006, 13:25
  2. Qt's Exception Handling
    By bruce1007 in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 09:30
  3. How to get color of pixel or point by QMouseEvent
    By Krishnacins in forum Newbie
    Replies: 4
    Last Post: 28th May 2006, 01:46
  4. string handling
    By vijay anandh in forum Qt Programming
    Replies: 4
    Last Post: 5th May 2006, 09:15
  5. QToolBox and QMouseEvent
    By mickey in forum Qt Programming
    Replies: 6
    Last Post: 1st February 2006, 11:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.