3nids / itembrowser

A QGIS 2.x plugin to browse a multiple selection, with auto-zooming to current feature and an option to open feature form.
Other
4 stars 4 forks source link

Can I control what attribute is shown in the browser window? #5

Closed magerlin closed 7 years ago

magerlin commented 7 years ago

I would like to see another attribute than the one shown (with same value "Rahela Vlaovic" for all selected features):

image

Is that possible?

3nids commented 7 years ago

this is the display expression of the layer, you can change it in the properties

magerlin commented 7 years ago

Hmm - I cannot make that work. I have tried this: image

And this: image

But it does not change that the attribute "Name" is shown in the browser window

magerlin commented 7 years ago

I am using Qgis 2.18.12 in Win 7 64 bit....

3nids commented 7 years ago

Sorry, this is properly handled in coming QGIS 3. To set the display expression of a layer in QGIS 2.x, you have to define it in the attribute table as a related layer -- not very easy way. A solution would be to use a python command to do it: iface.activeLayer().setDisplayExpression( 'your_expression' )