English 中文(简体)
透明接受事件
原标题:Transparently accept events
  • 时间:2012-05-25 18:47:09
  •  标签:
  • c++
  • qt

我有两个部件, < 坚固 > A < / 坚固 > 和 < 坚固 > B < / 坚固 > 。 < 坚固 > B < / 坚固 > 在 " 坚固 " A < / 坚固 " 上,使用网格布局。

+------------------------
| QGraphicsView A
|
|   +--------------------
|   |QGraphicsView B
|   |
|   |
|   |

A 需要接受所有鼠标事件( 移动、 新闻、 发布等 ) 。 < enger > B 需要透明地只接受鼠标移动 。 我怎么能得到 < enger > B 来只接受鼠标移动, 然后将所有其他事件( 包括鼠标移动) 传递到 < enger > A ( 不了解 A )?

问题回答

这样做的一种方式是让父母在孩子身上安装事件过滤器,并按您想要吞咽或通过的事件的逻辑进行。

看看:http://qt-project.org/doc/qt-4.8/qobject.html#安裝EventFilter





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签