[Qgis-user] Adding folder location to Browser - Favorites with Python

Richard Duivenvoorde rdmailings at duif.net
Sat May 23 02:37:03 PDT 2020


On 5/23/20 11:21 AM, Jorge Gustavo Rocha wrote:
> Hi Seggie,
> 
> Just one line of code to add a folder to browser panel:
> 
> iface.browserModel().addFavoriteDirectory('/home/jgr/tmp')

And to add some more context: QGIS is build using Qt widgets, which has
a model/view programming paradigm:

https://doc.qt.io/qt-5/model-view-programming.html

So the 'model' behind the 'browserDockWidget'-view is the QgsBrowserModel:

https://qgis.org/pyqgis/master/core/QgsBrowserModel.html

^^ also have a look there to see what else is possible/needed

Regards,

Richard Duivenvoorde


More information about the Qgis-user mailing list