[Qgis-developer] Help needed in creating Third Level Submenu

Bishwarup Banerjee bishwarup.banerjee at gmail.com
Mon Aug 3 08:57:46 EDT 2009


Dear All,

I am trying to create THIRD LEVEL MENU  through the following code. Like I
have a menu Called "Boundaries", inside that I have sub menu called
"Division", inside that I have "Division_name", inside "Division Name" we
have a separate sub menu called "Division Range", on clicking on the sub
menu "Division range" some action is done, like opening the range boundary
shape file. I am able to open the Shape file portion, but I am getting error
in the Bold Line marked as "AttributeError: addActions"

        self.menu = QMenu()
        self.menu.setTitle( "Boundaries" )

        self.DM = QMenu( "Division" )
        self.Div1 = QAction( QIcon( ":/icons/find.png" ), "Division
Name",self.iface.getMainWindow() )
        self.DM.addActions( [ self.Div1])
        self.menu.addMenu( self.DM )
        menuBar = self.iface.getMainWindow().menuBar()
        menuBar.addMenu(self.menu)

        self.Div_Range = QAction( QIcon( ":/icons/find.png" ), "Division
Range",self.iface.getMainWindow() )
        *self.Div1.addActions( [ self.Div_Range])*
        self.menu.addMenu( self.Div_Range )
        menuBar = self.iface.getMainWindow().menuBar()
        menuBar.addMenu(self.menu)

        QObject.connect( self.Div_Range, SIGNAL("triggered()"),
self.Div1_Clicked )

It will be of immense help, if anybody can point the error in the code, or
is it like THIRD LEVEL SUBMENU is not supported in QGIS?

I am using QGIS 0.11, Python 2.5 and QT.

I am posting the same in the QGIS Developer forum

Thanking you in advance,

With Warm Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090803/5b160155/attachment.html


More information about the Qgis-developer mailing list