Results 1 to 4 of 4

Thread: how to get MouseClick Event in this case

  1. #1
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Question how to get MouseClick Event in this case

    I have a QMainWindow which has some child controls (eg. QTableView).
    Now I want to QMainWindow get all mouse click event. How to do this?

    I am using Qt4.3 with XP
    I have tried eventFilter() in QMainWindow, but problem is when you click on the QTableView(actually any kind of child control)
    ,progrom can't enter the QMainWindow's eventFilter().

    Can anybody help me?

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to get MouseClick Event in this case

    various possibilites:
    * you can use eventFilter() (don't forget to install it on all the watched widgets!)
    * you should read QCoreApplication::notify()

    other question: why do you want that?

    HTH

  3. #3
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: how to get MouseClick Event in this case

    that is my special case:
    there is a button, click this button will popup a frameless widget, then when you click any other position in my main window will make this widget disappear. so In my main window I want to get mouse click event even if you click main window's child control.

  4. #4
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: how to get MouseClick Event in this case

    I have done this as below:

    just using QCoreApplication::notify(), thanks caduel!

Similar Threads

  1. Qt event queue overloading?
    By gct in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2008, 18:39
  2. showing menu mouseclick event with opengl object
    By validator in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2008, 23:25
  3. Replies: 1
    Last Post: 16th October 2007, 22:41
  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. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55

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.