Bug #12630
openThe open editor in WAbstractItemView forwards mouse events to WAbstractItemView
0%
Description
If I open a cell for editing and make a mouse click in the editor then the view sends the corresponding signals "clicked", "mouseWentDown", "mouseWentUp" too. In my opinion it is wrong.
Updated by Matthias Van Ceulebroeck 3 days ago
- Target version set to 4.13.2
Yes, I agree.
If the editor is already open, the signals should not fire, as the active widget would be the editor, not the cell. Events to it are to be handled by the widget in the cell, not the cell itself.
Updated by Romain Mardulyn 1 day ago
- Status changed from New to InProgress
- Assignee set to Romain Mardulyn
Updated by Romain Mardulyn about 7 hours ago
I disagree.
I believe that propagating events that the editor does not listen to to its parent is a good design choice here. There are cases where people will want the view to react to these events. If those events are not propagated by default, reacting to those events will require creating a custom WItemDelegate, while if they are propagated, ignoring these events can simply be done by checking whether an editor is open at the given index. This is also consistent with how WFormWidget behaves in general: if it is not listening to an event, the propagation of that event will not be prevented.
Furthermore, changing this behavior would break existing code relying on it. And since this behavior has been in Wt for about 15 years and nothing in the documentation or the rest of the library makes it look like it should not behave in this way, I think this should not be changed.