[Qt-interest] how to discard mousePressEvent in mouseDoubleClickEvent

Arnold Krille arnold at arnoldarts.de
Tue Apr 21 20:50:12 CEST 2009


Hi,

On Tuesday 21 April 2009 16:35:31 Yifei Li wrote:
> My program allows users to create and modify Bezier curves.   Users can
> add new control points by single clicks, and a double click indicates
> the point being added is the last one.

The problem is in fact that for a double-click you have to wait for <double-
click-interval> seconds to know whether the click is a click or a double-
click.

What distinguishes your normal points from the last points? Are they basicly 
the same and the last point just points at 0 instead of the next point?

Why don't you add the points on click and double-click just makes the last 
added point the last point in the curve?
Or click adds the points to the active curve and double-click de-activates the 
active curve. (Active = points are added)

> So if I understand you correctly, there's no function call like
> 'disableEvent(mousePressEvent)'?

Actually there is, for each event you have to choose whether you accept it or 
not. If you accept it, it is "eaten", if you do not accept it, it gets send to 
the next widget to handle it. In Patterns this is a chain-of-responsibility if 
I am not mistaken.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090421/4e208982/attachment.bin 


More information about the Qt-interest-old mailing list