[Development] QWidget mouse events - different order

Rick Stockton rickstockton at reno-computerhelp.com
Fri Dec 20 19:37:37 CET 2013


On 12/20/2013 02:05 AM, Martin Koller wrote:
> On Thursday 19 December 2013 22:18:36 Andreas Aardal Hanssen wrote:
>> On 19 Dec 2013, at 18:36, Rick Stockton <rickstockton at reno-computerhelp.com> wrote:
>>> Perhaps we should perform as QT4 did (there wasn't a second ButtonPress,
>>> the DoubleClick "ate it"). Such use cases would then need to be "fixed
>>> up" (i,e, to accept EITHER event as a cause for executing that Action)?
>>> Logical, but a lot of work.
>> Keeping Qt 5’s current behavior makes it impossible for an app to distinguish between multiple presses and a double-click without duplicating the timers in QApplication. Applications that rely on the original behavior are likely to be confused by the state you enter when receiving the second press.
Agreed! I can't think of of another way to
>>
>> http://qt-project.org/doc/qt-5.0/qtwidgets/qapplication.html#doubleClickInterval-prop
>>
>> Sending the press event before the double click looks like a mistake, I wonder if it’s the same on all platforms. I would be surprised, as it would break all apps that handle more than simple mouse events. A git bisect is probably a good idea...
> I checked now on windows: it's the same:
> press
> release
> press
> doubleclick
> release
>
I agree, it looks like a mistake. Most likely, this error was created
when we moved the "duplicate code" (code which checks the timers and
creates the doubleclick) out from the individual platform plugins, and
"higher up" into QPA.
Can I leave the fix to someone else? My time is limited and my ability
to code is very poor. I took a cursory look at the code which creates
DoubleClick, and may not fully understand it: I would expect the "extra"
ButtonPress to be emitted after the doubleclick, and not before.

Does anyone object to treating current Qt5 behavior as a bug? If not,
then bug definition is "The creation of a mouse DoubleClick event no
longer suppresses the ButtonPress event which caused it".

-- 
GPG fingerprint: 597E 4CE5 6D56 A7C2 DA3A 26FF F21F F828 0C86 165A




More information about the Development mailing list