Hi German,<br><br>Thank you very much for your reply. I will try to incorporate the way you suggested. But, I thing I was wondering is that if "addActions" does not inherits from QAction, then how is that when I go to only second level of submenu option, instead of thrird level, it works fine. The problem arises only when we go to the third level.<br>
<br>With warm Regards,<br>Bishwarup<br><br><div class="gmail_quote">2009/8/3 Germán Carrillo <span dir="ltr"><<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Bishwarup, the addActions method is in QWidget class, and QAction don't inherited from that. So addActions don't exist for QAction. Maybe you can use QtDesigner to create the menu level you want and then generate the .py with pyuirc4, this way you can see how to create it.<br>
<br>Why you don't use the last QGis version?<br><br>Germán<br><br><div class="gmail_quote">2009/8/3 Bishwarup Banerjee <span dir="ltr"><<a href="mailto:bishwarup.banerjee@gmail.com" target="_blank">bishwarup.banerjee@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Dear All,<br><br>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"<br>
<br> self.menu = QMenu()<br> self.menu.setTitle( "Boundaries" )<br> <br> self.DM = QMenu( "Division" )<br> self.Div1 = QAction( QIcon( ":/icons/find.png" ), "Division Name",self.iface.getMainWindow() )<br>
self.DM.addActions( [ self.Div1])<br> self.menu.addMenu( self.DM )<br> menuBar = self.iface.getMainWindow().menuBar()<br> menuBar.addMenu(self.menu)<br> <br> self.Div_Range = QAction( QIcon( ":/icons/find.png" ), "Division Range",self.iface.getMainWindow() )<br>
<b>self.Div1.addActions( [ self.Div_Range])</b><br> self.menu.addMenu( self.Div_Range )<br> menuBar = self.iface.getMainWindow().menuBar()<br> menuBar.addMenu(self.menu)<br> <br> QObject.connect( self.Div_Range, SIGNAL("triggered()"), self.Div1_Clicked )<br>
<br>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?<br><br>I am using QGIS 0.11, Python 2.5 and QT.<br><br>I am posting the same in the QGIS Developer forum<br>
<br>Thanking you in advance,<br><br>With Warm Regards<br><br>
<br></div></div>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div><font color="#888888"><br>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>
<br>
</font></blockquote></div><br>