Results 1 to 12 of 12

Thread: How to get mouse click events outside the Qt window?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get mouse click events outside the Qt window?

    try this.
    first actived current widget
    then
    overload the event function
    Qt Code:
    1. bool YourWidget::event ( QEvent * event )
    2. {
    3. if (event->type() == QEvent::ActivationChange)
    4. {
    5. if(QApplication::activeWindow() != this)
    6. {
    7. this->hide();
    8. }
    9. }
    10. return QWidget::event(event);
    11. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 18th September 2010 at 07:36.

Similar Threads

  1. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  2. Replies: 11
    Last Post: 15th July 2008, 13:11
  3. Replies: 1
    Last Post: 9th February 2007, 09:41
  4. Replies: 2
    Last Post: 24th July 2006, 18:36
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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.