Results 1 to 3 of 3

Thread: Mouse & KeyBoard Event

  1. #1
    Join Date
    Jan 2008
    Posts
    91
    Thanks
    8

    Default Mouse & KeyBoard Event

    Dear Friends,
    I have a small problem, I want to close a QDialog if there is a MouseEvent in my application.
    There are many Widget's and Buttons , I want to detect MouseEvent before them and close the dialog box, How can I do that? Can I detect mouseRelease or press event on QApplication.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mouse & KeyBoard Event

    Install an event filter on the application object.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Mouse & KeyBoard Event

    if you want to close particular Dialog hard code like that
    Qt Code:
    1. void className::mousePressEvent(QEvent *event)
    2. {
    3.  
    4. dialogName->close();
    5.  
    6. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Mouse over event on qwtmarker?
    By shud in forum Qwt
    Replies: 2
    Last Post: 20th September 2009, 15:12
  2. how to send a emulated mouse event to QListWidget
    By yxmaomao in forum Qt Programming
    Replies: 4
    Last Post: 22nd July 2008, 02:49
  3. pass mouse event information to another widget
    By Rooster in forum Qt Programming
    Replies: 5
    Last Post: 12th July 2008, 04:23
  4. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05
  5. Replies: 2
    Last Post: 24th July 2006, 18:36

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.