[Development] QPushButton: drag and drop

Philippe philwave at gmail.com
Sat Jun 4 07:25:57 CEST 2022


I have also noticed several posts on Stack Overflow, Qt Centre, etc, about this issue without a "real solution". 

I confirm. This case is very similar to user reports I've had for about 10 years, on OSX only, that occur randomly. I've wasted countless hours on this with no solution. And without a good excuse to give to these users...

Philippe

On Fri, 3 Jun 2022 13:20:31 +0100
Laszlo Papp <lpapp at kde.org> wrote:

Hi, 
> 
> 
> It seems that QWidget::mouseReleaseEvent does not get triggered after QDrag::exec. This causes the following issue that the QPushButton instance gets stuck in "pressed down" (with pressed highlight, etc) state as the following short gif shows: https://imgur.com/a/dk7zs9D
> 
> 
> I worked this around by calling setDown(false); after drag->exec(...), but I wonder if this is something that should be, or even can be fixed in Qt for all OSes.
> 
> 
> Here is a small testbed example I have put together that is really small and reproduces the issue. This is what I also used for the above gif to show the issue.
> 
> 
> https://github.com/lpapp/examples/tree/main/qt-button-dnd
> 
> 
> 
> This is where the QDragManager::drag starts grabbing the mouse on Linux with X11 for example: https://github.com/openwebos/qt/blob/master/src/gui/kernel/qdnd_x11.cpp#L2026
> 
> 
> I do not know the details very well, but from a user point of view, it would be good to either let mouseReleaseEvent get triggered as usual after the dragging has finished or at least not to have artifacts like the above around.
> 
> 
> I have also noticed several posts on Stack Overflow, Qt Centre, etc, about this issue without a "real solution". E.g. this dates back to 12 years ago: https://www.qtcentre.org/threads/34539-Drag-and-drop-from-QPushButton
> 
> 
> What do you think about this issue?
> 
> 
> Thanks.
> 
> 
> Kind regards,
> László
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220604/84896efa/attachment-0001.htm>


More information about the Development mailing list