I've got a plugin where I load some layers. After the last layer loaded, I show the attribute table.
However, I would like to select the form view and not the table view (see image).
How can I do this in Python?
On QGIS v.2.6 you can open the Attribute table in form view (attribute editor) mode, this way:
Paste the following code snippet there:
from qgis.gui import QgsDualView
dv = QgsDualView()
dv.init( iface.activeLayer(), iface.mapCanvas() )
dv.setView( QgsDualView.AttributeEditor )
dv.show()
And you get (yeah, I know it lacks the toolbar at the top, but that's the most you can get from PyQGIS :D) this: