Dear all,<br><br>having no experience with mailing lists I tried to find kind of a QGIS forum, but did not find anyone.<br><br>I hope, it is the right place to ask the following questions and may find some help :-)<br><br>
1)<br>I launched the first tutorial describing the first simple use of the QGIS API (findable under <a href="https://github.com/qgis/qgis-code-examples/tree/master/1_hello_world_qgis_style">https://github.com/qgis/qgis-code-examples/tree/master/1_hello_world_qgis_style</a>) and would like to know, why I get the app output:<br>
<br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>Layer is valid</font></b></span></span></p><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QWidget::repaint: Recursive repaint detected</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::begin: Widget painting can only begin as a result of a paintEvent</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::setRenderHint: Painter must be active to set rendering hints</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::setRenderHint: Painter must be active to set rendering hints</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::worldTransform: Painter not active</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::save: Painter not active</font></b></span></span></p><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::restore: Unbalanced save/restore</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::setWorldTransform: Painter not active</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::save: Painter not active</font></b></span></span></p><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::setOpacity: Painter not active</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::restore: Unbalanced save/restore</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::setWorldTransform: Painter not active</font></b></span></span></p>
<span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>
</font></b></span></span><p style="margin:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:courier new,monospace"><b><font>QPainter::end: Painter not active, aborted</font></b></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"></span></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
<span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)">The only change from my side was the adaption of the pathes to the plu<font>gins directory and my smal spatialite datab<font>ase.</font></font></span></font></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)"></span></font></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)"><font><font><font>2)</font></font></font></span></font></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)"><font><font><font><font>I open<font>ed my database in QGIS application and created a *.qml style fi<font>le</font></font></font></font></font></font></span><span style="color:rgb(0,0,0)">, but how do I apply such a style to a QgsVectorLayer using the C++ API?</span></font></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)"><font>I tried the following<font> without success:</font></font></span></font></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="font-family:arial,helvetica,sans-serif"><font><span style="color:rgb(0,0,0)"><font><font><br>
</font></font></span></font></span></span></p><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:'Source Code Pro';font-size:10pt"><span style="background-color:rgb(255,255,255)"><b><span style="font-family:courier new,monospace"><font><font><font><font>const QString myLayerStylePath  = app->applicationDirPath() + "/../rsc/styles/lines.qml";</font></font></font></font></span></b></span></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px"><span style="color:rgb(51,51,255)"><span style="font-family:'Source Code Pro';font-size:10pt"><span style="background-color:rgb(255,255,255)"><b><span style="font-family:courier new,monospace"><font><font><font><font><font>bool resultFlag;<br>
QString errorMsg = mypLayer->loadNamedStyle( myLayerStylePath, resultFlag );<br>if ( !resultFlag ) {<br>    qDebug() << errorMsg;<br>}</font></font></font></font></font></span></b></span></span></span></p><p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px">
<span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><b><span style="font-family:courier new,monospace"><font><font><font><font><font><br>
</font></font></font></font></font></span></b></span></span></span></p><p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span style="font-family:courier new,monospace"><font><font><font><font><font><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font>There was no error message but no rendering too!?</font></span></span></font></font></font></font></font></span></span></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px"><br><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span style="font-family:courier new,monospace"><font><font><font><font><font><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"></span></span></font></font></font></font></font></span></span></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span style="font-family:courier new,monospace"><font><font><font><font><font><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font><font>3)</font></font></span></span></font></font></font></font></font></span></span></span></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Source Code Pro';font-size:10pt;color:#aa0000"><span style="color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span style="font-family:courier new,monospace"><font><font><font><font><font><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font><font><font>Is there any <font>detailed documentation for the use of the API? The only not really complete one I found is <a href="http://www.qgis.org/pyqgis-cookbook">http://www.qgis.org/pyqgis-cookbook</a></font></font></font></font></span></span></font></font></font></font></font></span><b><span style="font-family:courier new,monospace"><font><font><font><font><font></font></font></font></font></font></span></b><br>
</span></span></span></p><br>4)<br>My last question I hope to find any help is: How do I search throw the discussions in the mailing list to avoid to ask duplicated questions?<br><br>Many thanks<br>joomie<br>