AnsweredAssumed Answered

Direct QPainter based rendering and Antialiasing

Question asked by on Jul 18, 2018
Latest reply on Jul 23, 2018 by


I've been experimenting with ArcGISRuntime::MapGraphicsView, specifically I was to draw directly on top of the rendered map. I can successfully draw either by overriding MapGraphicsView::drawForeground(...) which receives QPainter* as its first parameter, or I also managed to do it via QGraphicsScene by retrieving the instance of it in the constructor of my MapGraphicsView derived subclass and then added to it my own QGraphicsObject based instance with its own rendering routine.


Both approaches function as expected with one exception - I'm unable to make the rendering of lines and ellipses to be anti-aliased. I have been using Scene item based rendering in my other projects and always managed to get the QPainter to draw the primitives anti-aliased by setting the QPainter::setRenderHint(QPainter::Antialiasing).


Since I can make the anti-aliasing work on other non-Esri types of projects, my guess is that the ArcGIS MapGraphicsView keeps tight control of the QPainter's rendering setting so even if I set the anti-aliasing inside the paint() function (on QGraphicsObject, or MapGraphicsView::drawForeground), it wont respect that flag.


Can you please help and clarify what I'm missing here and how can I make the direct painting look properly aliased?


Thank you in advance.


Kind regards