[Development] QPushButton: drag and drop

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Jun 7 21:26:11 CEST 2022


Il 07/06/22 20:57, Laszlo Papp ha scritto:
> Just checked the Qt wiki, but it does not seem to speak about this rule. 
> Only binary and source compatibility. No behaviour compatibility. And by 
> the way, fixing the bug to match the documentation and therefore 
> intended behaviour would not even be behaviour break.
> 
> https://wiki.qt.io/Qt-Version-Compatibility 
> <https://wiki.qt.io/Qt-Version-Compatibility>

There's behaviour break and behaviour break.

Here we're talking about a fundamental change to how Qt has (not?) 
handled mouse release notifications on DND. I can wager there's also 
other many other similar situations (e.g. while having the mouse grab, a 
widget gets hidden, or a modal window opens up, etc.) that are currently 
similarly unhandled. Bonus points for "user cancels DND with the 
keyboard (escape) and releases into the widget", "a modal window opens 
up and closes down while the user never releases the mouse", etc.


I'm calling it a "fundamental" change, because

* any widget currently handling DND already does not expect to receive 
any event when DND is done; this may cause a further bug, for instance a 
widget gets a mouse release when it thinks it never saw the 
corresponding press;

* any widget currently NOT handling DND (e.g. QPushButton) needs to 
handle the fake release event, in whatever way it's delivered.

which is a long way to say "any QWidget subclass handling mouse events 
needs to be changed". And that's a very high bar for a behavioral change.


If anything, this could start on a opt-in basis (a widget attribute set 
by the user, possibly also an application attribute, if you're feeling 
adventurous) and slowly starting fixing any misbehaving widget in the 
span of 2-3 minor releases, then we flip the attribute for next LTS (opt 
out instead of in), then it's the default in Qt 7.


My 2 c,

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4244 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220607/b349aff9/attachment.bin>


More information about the Development mailing list