[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Catching mouseclicks outside QPopup
From:       Giovanni Bajo <rasky () develer ! com>
Date:       2008-02-22 19:03:15
Message-ID: 47BF1C73.6040001 () develer ! com
[Download RAW message or body]

On 2/22/2008 7:28 PM, Peter Shinners wrote:

> I have a custom QTextEdit widget opened as a QPopup. How can my widget
> catch mouse clicks outside the widget area so it knows when to hide? I
> want the same behavior as clicking outside a QMenu or QComboBox popup.
> It seems like there would be some window flag I can set to do this
> automatically? I've found grabMouse doesn't quite work, and also sets
> off alarms from the desktop protection apps.

Add a custom exec() function to your class and run a custom event loop 
in there (QEventLoop.exec). I'm not 100% sure it will work, but it should.
-- 
Giovanni Bajo

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic