<div dir="auto"><div>Thank you Etienne.  I did just what you suggested. But did not het anywhere.  I still get the same error message.</div><div dir="auto"><br><div dir="auto">My question did not get resolved and only for lack of information i can't move forward with the upgrade.  </div><div dir="auto">What i think has happened is that QGIS leadership has chosen to control the access gates to "ousiders" who want to program in C++ and related functiions in producing plugins by controlling how plugins are registered.  </div><div dir="auto"><br></div><div dir="auto">It is a pity that I can't upgrade this plugin for lack of information.</div><div dir="auto"><br></div><div dir="auto">In the past i have donated money and willing to donate time and money.  Whay is there so much secrecy on the basic C++ plugin initialization and registry?  It does not make for a good and inclusive  policy.<br><div dir="auto"><br></div><div dir="auto">Thank for your help anyway.</div></div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, Sep 15, 2019, 9:11 PM Etienne Trimaille <<a href="mailto:etienne.trimaille@gmail.com" target="_blank" rel="noreferrer">etienne.trimaille@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I can't really answer your question but you should use <a href="https://qgis.org/api/classQgsMapLayerComboBox.html" rel="noreferrer noreferrer" target="_blank">https://qgis.org/api/classQgsMapLayerComboBox.html</a> instead of creating your own combobox. (if possible).</div><div><br></div><div>Etienne<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 15 sept. 2019 à 10:11, Maaza Mekuria <<a href="mailto:mcmekuria@gmail.com" rel="noreferrer noreferrer" target="_blank">mcmekuria@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">QGIS Layer List upgrade to V3 C++ plugin - Geographic Information Systems Stack Exchange                                                                                                                                           













         

                                                                                                                                                                          

                                                                 

     

     <style>body,.top-bar{margin-top:1.9em}</style>     













<div><div id="m_2580783359485160115m_-4367367572533654911gmail-m_4253509280734288121gmail-content"><div><div id="m_2580783359485160115m_-4367367572533654911gmail-m_4253509280734288121gmail-mainbar"><div id="m_2580783359485160115m_-4367367572533654911gmail-m_4253509280734288121gmail-question"><div><div><div><p>I was upgrading a c++ plugin that I had used in the past and almost eliminated all the the usual compiler errors due to version changes according for the current version (3.6).  The plugin used to collect current map canvas layers in a combo list box for selection.  I am getting two errors that I can't figure out what to do with. This code compiled  without problem pre-2.0.</p><p>The first happens to be about QGSMapLayer that can't be instantiated because it is turned as an abstract class  and I am getting an error  [Severity   Code    Description Project File    Line    Source  Suppression State Error   C2259   'QgsMapLayer': cannot instantiate abstract class    tarjan_sccplugin    C:\OSGeo4W64\apps\Qt5\include\QtCore\qlist.h    214 Build   ]</p><p>This is portion of the code generating the error.  Where cmbNetSourceLayer is a combo-box .</p><p>void tarjan_sccGui::populateLayers( QString const& url ) {    cmbNetSourceLayer->clear();</p><p>QString layerName;    QString layerType;</p><pre><code><span>// fill list of layers</span><span>
</span><span>QMap</span><span><</span><span>QString</span><span>,</span><span> </span><span>QgsMapLayer</span><span>*></span><span> mapLayers </span><span>=</span><span> </span><span>QgsProject</span><span>::</span><span>instance</span><span>()-></span><span>mapLayers</span><span>();</span><span>
</span><span>QMap</span><span><</span><span>QString</span><span>,</span><span> </span><span>QgsMapLayer</span><span>*>::</span><span>iterator</span><span> layer_it </span><span>=</span><span> mapLayers</span><span>.</span><span>begin</span><span>();</span><span>

</span><span>for</span><span> </span><span>(;</span><span> layer_it </span><span>!=</span><span> mapLayers</span><span>.</span><span>end</span><span>();</span><span> </span><span>++</span><span>layer_it</span><span>)</span><span>
</span><span>{</span><span>
    </span><span>QgsVectorLayer</span><span>*</span><span> vl </span><span>=</span><span> </span><span>dynamic_cast</span><span><</span><span>QgsVectorLayer</span><span>*>(</span><span>layer_it</span><span>.</span><span>value</span><span>());</span><span>
    </span><span>if</span><span> </span><span>(!</span><span>vl</span><span>)</span><span>
        </span><span>continue</span><span>;</span><span>
    </span><span>else</span><span>

     cmbNetSourceLayer</span><span>-></span><span>addItem</span><span>(</span><span>vl</span><span>-></span><span>name</span><span>()</span><span> </span><span>);</span><span>
</span><span>}</span></code></pre><p>The second error appears to be in explicit declaration for the plugin. Something has changed in how the plugins are initiated.  [Severity   Code    Description Project File    Line    Source  Suppression State Error (active)      invalid explicit instantiation declaration  tarjan_sccplugin    d:\GIS\v3\Quantum-GIS\src\core\qgsoptionalexpression.h  82  IntelliSense    ]</p><p>No idea what must be done to overcome this error.  The cited module appears to be an optional data module.</p><p><br></p><p>Any help is appreciated.</p></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>
</blockquote></div>
</div></div>