[Qt-interest] Events on Transparent Window
Sean Hayes
sean.t.hayes at vanderbilt.edu
Fri Feb 11 17:24:02 CET 2011
Jason,
> 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.
>
By parent window do you mean the MainWindow?
>
> 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.
>
I can use an event filter to receive all the touch events. However, there
are two things I have observed. Touch events only get set to one window at a
time. Therefore, if you add a new touch point over a second window, you do
not get the event. Secondly, if you start a touch point outside of any of
the windows, the event is not received. I think the only solution is to have
on be window over top of everything that grabs the touch events.
>
> 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.
>
I have tried installing an event filter on the main window and I am not able
to get touch events that occur on child windows. It seems that there is
a event propagations barrier between windows. Can anyone explain why event
don't get passed from a child window to a parent window?
Thanks for your ideas,
Sean
>
> ------------------------------
> *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<http://blogs.msdn.com/b/seealso/archive/2011/02/07/creating-windows-touch-control-frameworks-photostrip.aspx>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
>
> ------------------------------
> Need Mail bonding?
> Go to the Yahoo! Mail Q&A<http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091>for great
> tips from Yahoo! Answers<http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091>users.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110211/60070cba/attachment.html
More information about the Qt-interest-old
mailing list