AnsweredAssumed Answered

Updating a Graphic in GraphicsLayer / thread safeness

Question asked by ChEhrlicher on Feb 15, 2016
Latest reply on Feb 16, 2016 by ChEhrlicher

Hi,

 

we add a EsriRuntimeQt::Graphic to a EsriRuntimeQt::GraphicsLayer with GraphicsLayer::addGraphic(m_graphicPtr). Now we want to change the graphic (e.g. the line color). What's the recommended way to do this? The documentation does not say anything about this:

  • simply modify m_graphicPtr (and hope the GraphicsLayer notices the change and updates it's graphical representation)
    • this would mean that all Functions for EsriRuntimeQt::Graphic must be thread-safe
    • or is there another synchronization mechanism
    • using updateGraphic with the same pointer used by addGraphic will lead to a crash (afaics addGraphic() moves ownership and updateGraphic() will delete the old graphic - at least this is what I'm seeing, the documentation only express this indirect with)
  • create a new Graphic and replace the current one with EsriRuntimeQt::GraphicsLayer::updateGraphic()
  • other ways I'm not aware of

 

Thx,

Christian

Outcomes