[Qt-interest] Events on Transparent Window

Jason H scorp1us at yahoo.com
Wed Feb 9 22:49:20 CET 2011


Unfortunately, at 0, it is likely to be optimized out. Better to find a way to 
intercept the event at the parent window and handle it before it is passed to 
child windows. 


I think you can install an event filter on the parent window by subclassing the 
class and overriding the default handler. It's been a while since I did anything 
like that but that's how I'd approach it. 


Windows has to deliver the event to the MainWindow, where in it gets translated 
(reltive positioning) through the parent hierarchy before ending up on the final 
child widget itself. You should be able to intercept any such event early on.




________________________________
From: Sean Hayes <sean.t.hayes at vanderbilt.edu>
To: Qt Interest <qt-interest at trolltech.com>
Sent: Wed, February 9, 2011 11:19:44 AM
Subject: [Qt-interest] Events on Transparent Window

I am trying to create a transparent window that overlays multiple other windows 
and captures all mouse and touch events. Windows touch messages seem to only be 
set to a window if the initial contact point is over the window. Therefore, if 
you start a gesture over one window and add a finger over another window, the 
QTouchEvent will only contain the first touch point. A setup similar to the one 
in this Windows programing article may solve this problem. However, I do not 
know much about windows specific code and would prefer to stick with Qt's API 
for obvious reasons.


Setting full transparency causes Windows to send the event directly to the 
window underneath, defeating the purpose. Any ideas on how to force the 
transparent window to receve events? I have tried this with 
QWidget::setWindowOpacity(0).

I am using Qt 4.7.1 on Windows 7.

Thanks for you help,
Sean


 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110209/4a458d77/attachment.html 


More information about the Qt-interest-old mailing list