开发者

Mouse events with Qt

I'm trying to implement some kind of drag and drop feature between two widgets with Qt 4.5. So I've reimplemented the mouse events methods to do what my program is supposed to do when I press the mouse button on the first widget and move the cursor & release the button on the second one.

开发者_C百科

Problem is: after the pressEvent on the first widget no other widget receives a mouse related event (move, release or enter) before the first widget got the release event. Even the first widget doesn't receive the leave event when the cursor goes outside, if the button was not released beforehand.

How can I make the target widget receive the mouse events before the button is released?

Thanks.


IIRC you don't use "normal" mouse events for drag and drop in Qt. Read the appropriate section in Qt documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜