<div dir="ltr"><div>You should have a look at the QAction documentation : <a href="https://doc.qt.io/qt-5/qaction.html">https://doc.qt.io/qt-5/qaction.html</a></div><div>The first parameter, you can give a QIcon.</div><div>For some predefined icon in QGIS, you can look to <a href="https://pyqgis-icons-cheatsheet.geotribu.fr/">https://pyqgis-icons-cheatsheet.geotribu.fr/</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 27 avr. 2023 à 13:15, Giulio Fattori via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</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>
<div><font face="Helvetica, Arial,
sans-serif"><span lang="en">Great, what if I want
an icon too?</span></font></div>
<div>Thanks in advance for any help<font face="Helvetica, Arial, sans-serif"><span lang="en"></span></font></div>
<div><font face="Helvetica, Arial,
sans-serif"><span lang="en">Giulio<br>
</span></font></div>
<div><br>
</div>
<div>Il 27/04/2023 00:06, Nyall Dawson via
QGIS-Developer ha scritto:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><br>
<br>
On Thu, 27 Apr 2023 at 07:42, Catania, Luke A ERDC-RDE-GRL-VA
CIV via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>>
wrote:<br>
><br>
> But I am looking to access the dock widget and add two
icons in its row of icons or maybe a menu.<br>
<br>
It's not available via the stable API, but let's not let that
stop us! 😆<br>
<br>
layer_tree = iface.layerTreeView()<br>
layer_tree_dock = layer_tree.parent().parent()<br>
toolbar = layer_tree_dock.findChildren(QToolBar)[0]<br>
<br>
my_action = QAction('something')<br>
toolbar.addAction(my_action)
<div><br>
</div>
<div>Nyall</div>
<div><br>
</div>
<div><br>
><br>
> <br>
><br>
> Thanks in advance for any help,<br>
><br>
> Luke<br>
><br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
QGIS-Developer mailing list
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
</blockquote>
<p><br>
</p>
</div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="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" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>