Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to hide all the fields at once in QGIS 1.7?

I see where I can hide one field at a time but I would like a button which does it all at once.

share|improve this question
    
Do you mean field attributes displayed in a layer? Or 'layers'? –  Simbamangu Oct 23 '12 at 11:14
add comment

1 Answer

up vote 3 down vote accepted

with the GUI no but with a small Python script run in the Python console you can:

from qgis.utils import iface
layer = iface.activeLayer()
indexes = layer.pendingAllAttributesList()
for i in indexes:
      layer.setEditType(i, QgsVectorLayer.Hidden)

Copy and paste the following into the QGIS Python console and it should hide all the attributes on the layer.

share|improve this answer
    
What is the preferred way to save this bit of code in the interface somewhere? Or how easy is it to attach this to a ui button? I'd like to give a go at contributing to the project –  Justin Oct 24 '12 at 11:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.