Hot answers tagged

17

You can use the addToolBar() API call via QgisInterface (i.e. iface) to create a custom toolbar: class MyPlugin: def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface def initGui(self): # Add toolbar self.toolbar = self.iface.addToolBar("My_ToolBar") # Create actions ...


10

Use the findChild method of QGIS mainWindow to know if there is a QToolBar called u'MyProcessing' and get it. If you don't get anything, create it. myToolBar = iface.mainWindow().findChild( QToolBar, u'MyProcessing' ) if not myToolBar: myToolBar = iface.addToolBar( u'MyProcessing' ) myToolBar.setObjectName( u'MyProcessing' ) This needs to be ...


9

Using Plugin builder version 3.2.1 I found differences. In case of Tool button with dialog in add_action function addToolBarIcon is used (line 148): self.iface.addToolBarIcon(action) which "Add an icon to the plugins toolbar." (quote from QGIS API documentation). In case of Tool button with dock widget a new toolbar is created in __init__ function (line ...


7

In Plugins > Python Console, try typing the following: qgis.utils.iface.layerToolBar().move(5,5) It should move the toolbar shown in your image. Hope this helps!


7

You have to add any external resources including the icons in the resources.qrc file. resources.qrc = The .xml document created by Qt Designer. Contains relative paths to resources of the forms. http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html resources.qrc format: button/icon.png http://doc.qt.io/qt-4.8/resources.html


7

As the documentation on the QGIS Website this is the Actions identify tool First you need to set an action to perform: Here is some actions setup (via right click on the layer properties): Here is a result of using the actions with the 'FeatureID' selected


6

You should initialize the map with no controls. You can do this passing an empty array to the controls like this: map = new OpenLayers.Map('map', {zoomDuration: 1,projection: 'EPSG:3857' controls: []}); You should then add only those controls that you require, like this: map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new ...


5

Toolbars are located outside your screen area. You can use Python console to move them on screen. Here is example of moving Navigation Toolbar: qgis.utils.iface.mapNavToolToolBar().move(10,10) Names of other toolbars can be found by this link.


5

Maybe too obvious an answer, but it's what I needed when googling for this so... "All editing sessions start by choosing the 'Toggle editing' option" "By default, QGIS loads layers read-only: This is a safeguard to avoid accidentally editing a layer if there is a slip of the mouse. However, you can choose to edit any layer as long as the data provider ...


5

You can access QGIS toolbar buttons (actions) by using the iface object (docs here). From those actions you can create a QActionGroup and add your custom action making all actions mutually exclusive. The following code snippet shows you how to do it, step by step. I've put the code snippet in the initGui(self) method of my test plugin. # Make sure your ...


5

Your problem is with self.ShapeLayerList = QWidgetAction(self.projCombo) That is creating a QWidgetAction with the combo box as its parent widget, not its child widget. Try: self.ShapeLayerList=QWidgetAction(None) self.ShapeLayerList.setDefaultWidget(self.projCombo)


5

This is a quirk of Esri, it used to be the other way around. By default it will save all customization in only the current document, to change this open the menu customize::customize mode.. Turn off the checks indicated by the arrows to make ArcMap save to your Normal.mxt. Please note that any open instances of ArcMap will write to the normal on exit so ...


5

Processing Toolbox menus & buttons are easy to configure in QGIS 3: Settings Options Tab Processing


5

I've coded a simple QgsMessageBar which contains a widget with 3 double-spinbox (and their labels), and a QPushButton for load colors. One for each color (Blue, Orange and Red). Each SpinBox have a default value (0), a minimum (0), a maximum (100) and a step (0.5). These values can be easily edited in the code (in the BarWidget class). The messageBar pop ...


4

Do you need to remove the big one (blue one?) or the small one behind it? if the big one is the issue, try commenting: map.addControl(new OpenLayers.Control.PanZoomBar()); and you should get only one control like here: var map, layer; function init(){ map = new OpenLayers.Map( 'map'); layer = new OpenLayers.Layer.OSM( "...


4

You can activate the "Select Single Feature" tool using iface.actionSelect().trigger(). If you want to be able to deactivate the tool, you need to activate the tool that was previously active. You can save the active tool using currentTool = iface.mapCanvas().mapTool() Then, when you want to deactivate the "Select Single Feature" tool, you can activate ...


4

I know you can create a new toolbar with Buttons/Tools/etc on it, based on Python using ArcGIS 10.1 Addins. You should be able to take advantage of your current Python code and integrate it in these new tools. Take a look, it is fairly simple to create. http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_a_Python_add_in/014p00000025000000/


4

If your code just finds and executes the Start Editing command item then ArcMap will start an edit session and launch the Editor toolbar. There's probably a whole bunch of code behind that control. To start an edit session without launching the toolbar you'll need to start editing a workspace in the map via IEditor.StartEditing. Here's some retro VBA code ...


4

Assuming the basic directory structure of the uninstalled plugin is: GraphicGroundwater icon.png icons addBase.png ... resources.qrc ... You will want something like this in resources.qrc (see docs): <qresource prefix="/plugins/GraphicGroundwater" > <file>icon.png</file> <file>icons/getDEM.png</file> ...


4

In config.esriaddinx, set the tool's onDemand property to false. Similarly, if you have any extensions that need to be initialized at startup, set its autoLoad property to true.


4

I am pretty sure it's a part of the Production Mapping extension. http://resources.arcgis.com/en/help/main/10.1/index.html#//010300000214000000 This is not a free extention. (approx $9000) I don't think there is a free trial for this one ethier altough you might be able to contact your ESRI rep and see what you can do. At least it is not listed as the trial ...


4

Based on the answer and comments on this post: Tool Bar visibility in PyQGIS, we can determine the name of these objects and set their visibility to False. If you go to the menubar and select Settings > Customization, you can see the types of objects used. In your case: Menu Toolbar = QMenuBar Browser Panel = QDockWidget Label Toolbar = QToolBar So, we ...


4

You want to style your layer based on three values and you want a quick way to change those values. One way to get something close would be to create a layer with no geometry and put the three values into it and then dock its Attribute table window. Create your style expression to get the values from the layer: WHEN "valdco" = attribute(get_feature('...


4

The thing that you are looking for is emphasized in blue. P.S. Just check slightly above the highlighted toolbar.


4

Because you opened it via Project > Snapping options... Close your floating window, right click on some empty toolbar area and under Toolbars activate Snapping Toolbar as shown below: But note that the toolbar and the Snapping options partially show the same options, but the Snapping options (rsp. Project snapping settings) are well needed when turning to ...


4

To dock a floating toolbar Click on the end of the toolbar (see the circled area in the image below) and drag it to any side of the QGIS window until it snaps into place. That toolbar will re-appear in the same place the next time you turn it off and back on again. This allows you to customize the QGIS interface to your personal taste. Personally I like ...


3

I don't know why do you need to add the tool in a toolbar. Because, I have worked with some similar thing and I haven't find any need to add it in the tool bar. In my case, when user clicks on a button in the dockable window, a tool activates. To perform this work, my tool class looks like following: My tool id is:"ArcMap_SelectionTool" My tool class name ...


3

Python add-ins are new to 10.1. So your 9.3 user won't be able to use one. If he decides to migrate to 10.1 or higher (wouldn't be a bad thing after all, 9.3 is not supported for a while): Add-ins are stored in your user's profile (...\My Documents\ArcGIS\AddIns). I don't think you can use/find the add-in if you didn't install it on your machine. But if ...


3

In the requester's mxd, if you go to the Customize drop-down and then select Customize Mode (This is in 10.1. I can't remember if 9.3 was exactly the same, but either way look for Customize Mode somewhere), and then right-click on the button in the toolbar do you get the option to View Source? At 9.3 you could make buttons that fired VBA which in turn fired ...


3

According to Showing tooltips on toolbars for ArcGIS 10.3: Click the Customize menu and click Customize Mode. Click the Options tab. Check Show Tooltips on toolbars to display Tooltips for the buttons on a toolbar. Click Close. Instead of checking it, try unchecking it.


Only top voted, non community-wiki answers of a minimum length are eligible