[Development] QPushButton: drag and drop

Volker Hilsheimer volker.hilsheimer at qt.io
Sat Jun 4 13:30:42 CEST 2022


> On 4 Jun 2022, at 07:25, Philippe <philwave at gmail.com> wrote:
> 
> 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
>  

Hi Philippe,


We have fixed a whole bunch of macOS specific bugs with enter/leave/hover logic, and also with the handling of window modality on macOS; e.g.

https://bugreports.qt.io/browse/QTBUG-36926
https://bugreports.qt.io/browse/QTBUG-78970
https://bugreports.qt.io/browse/QTBUG-92040

Perhaps those are the issues you have been running into as well? There might be more, in which case it would be good to have specific bug reports.

Volker



> 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ó
> 
>  
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development



More information about the Development mailing list