PointSymbolEditorWidget: Create point symbol from selected objects#2426
PointSymbolEditorWidget: Create point symbol from selected objects#2426dl3sdo wants to merge 2 commits intoOpenOrienteering:masterfrom
Conversation
Extend point symbol editor to create point, line and area subsymbols from selected objects. Closes OpenOrienteeringGH-2425 (Create point symbols from selected objects).
| namespace OpenOrienteering { | ||
|
|
||
| PointSymbolEditorWidget::PointSymbolEditorWidget(MapEditorController* controller, PointSymbol* symbol, SymbolRole role, qreal offset_y, QWidget* parent) | ||
| PointSymbolEditorWidget::PointSymbolEditorWidget(MapEditorController* controller, PointSymbol* symbol, Map* source_map, SymbolRole role, qreal offset_y, QWidget* parent) |
There was a problem hiding this comment.
Early feedback:
I don't think we should add another parameter. The source map is implicitly known, via controller and symbol.
(Another suggested workflow was copy-and-paste. This would use a different Map, with all complications. And you wouldn't get that Map at constuction time, before "Paste".)
There was a problem hiding this comment.
I also didn't like to add a new parameter but had not found a better alternative.
The newly created controller being passed to PointSymbolEditorWidget only knows the preview map but does not know the source_map, neither does the symbol. There is certainly the previously active controller who 'knows' the source map but I don't know how PointSymbolEditorWidget can access it.
MapEditorController describes itself as a 'HACK' for being used in the symbol editor for the preview. MapEditorController could be extended to store the source map in addition as it's already considering the symbol editing usecase.
There was a problem hiding this comment.
I removed the unused parameter QWidget* parent and added Map* source_map = nullptr at the end which avoids modifying area and line symbol settings.
Modify the signature of PointSymbolEditorWidget constructor to pass source map at last element so that line and area symbol settings don't need to be changed.
Extend point symbol editor to create point, line and area subsymbols from selected objects.
Closes GH-2425 (Create point symbols from selected objects).