<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Direct QPainter based rendering and Antialiasing in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85325#M406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can work around the problem by&amp;nbsp;specifying the number of samples to be used for multisampling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in a couple ways:&lt;/P&gt;&lt;P&gt;1) In main.cpp before the QApplication is instantiated.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;QSurfaceFormat&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;setSamples&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;8&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN style="color: #800080;"&gt;QSurfaceFormat&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c;"&gt;setDefaultFormat&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) On the QGraphicsView's viewport directly.&lt;/P&gt;&lt;P&gt;In subclassed MapGraphicsView constructor:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;static_cast&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800080;"&gt;QOpenGLWidget&lt;/SPAN&gt;*&amp;gt;(&lt;SPAN style="color: #00677c;"&gt;viewport&lt;/SPAN&gt;());&lt;BR /&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;format&lt;/SPAN&gt;();&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;setSamples&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;8&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;setFormat&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However what I still need to find out is whether the MapGraphicsView should be setting up the number of samples by default.&amp;nbsp; I should have that information soon.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Michael&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2018 20:10:24 GMT</pubDate>
    <dc:creator>MichaelTims</dc:creator>
    <dc:date>2018-07-23T20:10:24Z</dc:date>
    <item>
      <title>Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85320#M401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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 &lt;STRONG&gt;MapGraphicsView::drawForeground(...)&lt;/STRONG&gt; which receives &lt;STRONG&gt;QPainter*&lt;/STRONG&gt; 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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both approaches function as expected with one exception - I'm unable to make the rendering of lines and ellipses to be &lt;STRONG&gt;anti-aliased&lt;/STRONG&gt;. 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 &lt;STRONG&gt;QPainter::setRenderHint(QPainter::Antialiasing)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I can make the anti-aliasing work on other non-Esri types of projects, my guess is that the ArcGIS&amp;nbsp;&lt;STRONG&gt;MapGraphicsView&lt;/STRONG&gt;&amp;nbsp;keeps tight control of the QPainter's rendering setting so even if I set the anti-aliasing inside the paint()&amp;nbsp;function (on QGraphicsObject, or MapGraphicsView::drawForeground), it wont respect that flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help and clarify what I'm missing here and how can I make the direct painting look properly aliased?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 04:08:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85320#M401</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-07-19T04:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85321#M402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if setting&amp;nbsp;&lt;STRONG&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;setRenderHint(QPainter::Antialiasing)&lt;/STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;on the MapGraphicsView in your application makes any difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;-Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 05:05:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85321#M402</guid>
      <dc:creator>MichaelTims</dc:creator>
      <dc:date>2018-07-19T05:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85322#M403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;I just tried it and unfortunately it makes not difference &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;The vector map that I downloaded under my ESRI dev account is properly anti-aliased and has always been when running my test app.&lt;/P&gt;&lt;P&gt;Only my direct drawings remain un-antialiased.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 07:38:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85322#M403</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-07-19T07:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85323#M404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for trying that.&amp;nbsp; Bummer that it didn't do the trick.&amp;nbsp; I will try to repro on my end so I can do some troubleshooting.&amp;nbsp; We have seen problems in the past with OpenGL states being left dirty and the QPainter system not resetting the default state back properly for what the items require while painting.&amp;nbsp; It could be something like that going on since you've mentioned that you see the correct behavior when not consuming the ArcGIS Qt view.&amp;nbsp; I'll keep you posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 19:28:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85323#M404</guid>
      <dc:creator>MichaelTims</dc:creator>
      <dc:date>2018-07-19T19:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85324#M405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael, I hope you'll be able to find the cause of this.&lt;/P&gt;&lt;P&gt;If you need any more info, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your findings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 00:24:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85324#M405</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-07-20T00:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85325#M406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can work around the problem by&amp;nbsp;specifying the number of samples to be used for multisampling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done in a couple ways:&lt;/P&gt;&lt;P&gt;1) In main.cpp before the QApplication is instantiated.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;QSurfaceFormat&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;setSamples&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;8&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN style="color: #800080;"&gt;QSurfaceFormat&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c;"&gt;setDefaultFormat&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;fmt&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) On the QGraphicsView's viewport directly.&lt;/P&gt;&lt;P&gt;In subclassed MapGraphicsView constructor:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;static_cast&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800080;"&gt;QOpenGLWidget&lt;/SPAN&gt;*&amp;gt;(&lt;SPAN style="color: #00677c;"&gt;viewport&lt;/SPAN&gt;());&lt;BR /&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;format&lt;/SPAN&gt;();&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;setSamples&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;8&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN style="color: #092e64;"&gt;openGlWidget&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;setFormat&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;format&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However what I still need to find out is whether the MapGraphicsView should be setting up the number of samples by default.&amp;nbsp; I should have that information soon.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Michael&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2018 20:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85325#M406</guid>
      <dc:creator>MichaelTims</dc:creator>
      <dc:date>2018-07-23T20:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Direct QPainter based rendering and Antialiasing</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85326#M407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Michael.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround indeed &lt;SPAN style="text-decoration: underline;"&gt;works&lt;/SPAN&gt; - much appreciated.&lt;/P&gt;&lt;P&gt;Unless there is some valid reason for not making it default, I believe it would be more intuitive to make it so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for finding the workaround and the code snippets.&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 03:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/direct-qpainter-based-rendering-and-antialiasing/m-p/85326#M407</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-07-24T03:02:19Z</dc:date>
    </item>
  </channel>
</rss>

