make tracks and polygons clickable and make track points highlightable #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Points on tracks and polygons which have the clickable property set will emit a point-clicked signal when the user left-clicks on a point. When the editable property is also set a then a click is only considered as a click when the mouse pointer does not move while the left button is down. In case the mouse is moved while the left button is down it is considered as a drag-n-drop action (thus emitting a point-changed signal).
The point-select signal is also emitted after a 'breaker' has been clicked (only when editable is set).
This patch also include code to highlight a point with a (custom) highlight color (only the alpha channel is the same as for non-highlighted points). Only one point per track can be highlighted. Highlighting a point works by passing a pointer to a OsmGpsMapPoint (which must be in the list of track points) as value for the highlight-point property.
Also two examples are included to demonstrate the use of the click and highlight usage. The second example illustrate these features combined with the editable property.
If there are any question, please don't hesitate to ask.
This is a rebased update from the old pull request (which I accidentally closed).