Menu

#212 Polygon selection creates too many vertices

None
closed
nobody
5
2014-08-27
2014-08-20
No

With Qwt-6.1/Qt-4.8.6, when doing a polygon selection with a QwtPlotPicker, The first or second click occasionnaly receive twice the same mouse press event, and as a result, add two vertices at the same position to the selection polygon.
Attached is a modified event_filter example that illustrates the problem. I simply draw the selection polygon, with the vertice number beside each vertice. As you can see, after the first click, the first vertice number is sometimes 2 (the 1 is drawn underneath), and the second vertice number is 3

1 Attachments

Discussion

  • olivier barthelemy

    Oops, here is the updated event_filter.pro for the example to build.
    I have the same behaviour with qwt trunk. It appeared at my switch from qt-4.8.2/qwt-6.0.1 to qt-4.8.5/qwt6.1
    What i think is happening : at the first click, we enter the loop that sends the event to all registered event filters. The first object to receive it (QwtPlotPicker?) adds a new event filter (for the QwtPickerPolygonMachine?). But since new filters are added to the top of the event list, the first object goes in second place. Then the event dispatching loop continues, and sends the event to the second receiver of the list, which is now the same as the object that just received the event.

     

    Last edit: olivier barthelemy 2014-08-21
  • Uwe Rathmann

    Uwe Rathmann - 2014-08-27
    • status: open --> closed
    • Group: -->
     
  • Uwe Rathmann

    Uwe Rathmann - 2014-08-27

    Indeed an issue with adding event filters inside an event filter. In the end I would see it as a Qt bug, but as it is very unlikely, that it will ever be fixed in Qt I have changed the code in a way, that the event filtering of the internal overlays is avoided.

    I also noticed, that auto-repeated key events are not handled in the state machines, what also leads to many pointless duplicates in the polygon selection.

    Both issues fixed in all relevant branches >= 6.1

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB