I am trying to make group and fill it with layers in pyQGIS.
Piece of my code:
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import QFileInfo
from qgis.core import *
from qgis.utils import iface
group = iface.legendInterface().addGroup( 'abc')
group.setName("Group X")
But I got only error AttributeError: 'int' object has no attribute 'setName'
May I import some other class or where is problem?