Thanks Larry, this is exactly what I was looking for! On Mon, Apr 2, 2012 at 2:13 PM, Larry Shaffer <[email protected]>wrote:
> Hi Aaron, > > On Mon, Apr 2, 2012 at 2:16 PM, SJWC GIS <[email protected]> wrote: > > Hello all, > > > > I'm creating a qgis python plugin. One of the functions of the plugin > is to > > customize the qgis interface by turning off a few toolbars. For most > > toolbars, this isn't a problem, but for some reason I can't find a way to > > shut off the "Label" toolbar. For most toolbars, the following > statements > > are working... > > > > self.iface.digitizeToolBar().setVisible(False) > > > > But I can't find a labelToolBar() object that I can do this operation > with. > > Does anyone have any guidance on why this is different? I'm not > noticing > > any plugins that might be influencing this... Thanks! > > Seems there is no method in the QgisInterface class for accessing the > new label toolbar yet. > > Try... > > iface.mainWindow().findChild(QToolBar,"mLabelToolBar").setVisible(False) > > I found the object name for the label toolbar using: > > toolbars = iface.mainWindow().findChildren(QToolBar) > > for toolbar in toolbars: > print toolbar.objectName() > > Which returned this on my QGIS setup: > > mFileToolBar mLayerToolBar mDigitizeToolBar > mAdvancedDigitizeToolBar mMapNavToolBar mAttributesToolBar > mPluginToolBar mHelpToolBar mRasterToolBar mLabelToolBar OpenStreetMap > > > There's probably a more direct solution than the 'findChild()' method. > > Regards, > > Larry Shaffer > Dakota Cartography > Black Hills, South Dakota >
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
