[Qt-interest] Mouse double click.
Andreas Pakulat
apaku at gmx.de
Fri Feb 20 11:11:08 CET 2009
On 19.02.09 16:38:20, Malyushytsky, Alex wrote:
> I don't see how sending multiple events instead of
> QEvent::MouseButtonDblClick may improve anything, but I see how you can
> get in trouble with it.
Because thats whats happening when the user does it. There are two
presses+releases and Qt's code itself (IIRC in QWidget::event) creates the
double-click event depending on how much time has gone between the first
and the second click.
> Each system has its own settings, which affects the way single clicks are
> treated - as a few single clicks or doubleclick. Such settings can be
> cofigured by user, so there is no way to insure you will get double click
> event by sending few single click events unless you really send it the
> form of doubleclick or go and find such settings to determine the most
> reasonable timing yourself.
Actually Qt exposes this "setting" (or has its own, not sure) via
QApplication::doubleClickInterval(), so its no problem to post the events
in the right time-distance.
Andreas
--
You will overcome the attacks of jealous associates.
More information about the Qt-interest-old
mailing list