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

2020-05-23 Thread Seggie, Graeme
I actually got a response on Stack Exchange regarding this query, so in the interests of sharing the response... Code to run in QGIS Python console is: browserModel = iface.browserModel() dirs = ['U:\dir1', 'U:\dir2', 'U:\dir3', 'U:\dir4'] for dir in dirs:

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

2020-05-23 Thread Richard Duivenvoorde
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:

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

2020-05-23 Thread Jorge Gustavo Rocha
Hi Seggie, Just one line of code to add a folder to browser panel: iface.browserModel().addFavoriteDirectory('/home/jgr/tmp') Regards, Jorge On 22/05/20 14:37, Seggie, Graeme wrote: > > Hello, > >   > > I am struggling to get something to work, which would seem to be an > easy thing to do,

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

2020-05-22 Thread Seggie, Graeme
Hello, I am struggling to get something to work, which would seem to be an easy thing to do, but cannot quite make my understanding of the python docs work in practice. What I would like to do, is run some python to add some folders to the favorites area in the browser within QGIS. This is to