Hot answers tagged

35

According to https://hub.qgis.org/issues/15265, the GDAL tools might get lost if you have the processing tools installed as an external plugin. Since some time, it has become a core plugin, so no need to be in the users .qgis2/python/plugins/processing folder. You can remove that savely. Apart from that, I discovered a second Vector menue right to the Help ...


30

This works for QGIS 3.4 => Create a group of all the layers you want to have the same style Edit the style of one of the layers in the group to your liking Right-click the correctly styled layer; 'Styles' -> 'Copy Style' -> 'Symbology' Select the group you created before Right-click the group; 'Paste Style'


25

A great solution is to use QGIS as a GUI for PostGIS. QGIS is a fully-functional GIS (I prefer to think of it actually as a meta-GIS given that it is built on many GIS packages). It has built-in support to connect to PostGIS and therefore gives you all the tools needed to view, edit and create maps from your data.


25

I had the same issue, first thought it was intentional, but discovered if you delete the .qgis2 directory from user account this fixes the problem. See https://hub.qgis.org/issues/15265


24

You can add a custom menu to the QGIS GUI this way: self.menu = QMenu( "&My tools", self.iface.mainWindow().menuBar() ) actions = self.iface.mainWindow().menuBar().actions() lastAction = actions[-1] self.iface.mainWindow().menuBar().insertMenu( lastAction, self.menu ) As you can see in the code snippet above, you are adding a menu to the second to last ...


22

The fTools plugin offered these menus and it has been removed from QGIS and is replaced with the processing plugin. Just enable the processing plugin and the menu will be back. Note that you can go to Processing => Options => Menus, to configure in detail which algorithms will be available in the menu. fTools and processing both offered the same tools in ...


15

Agree with @JochenSchwarze that it makes sense to have it (and thanks for making it a feature request). Saying that, it is possible to do it with a bit of Python. Make sure the Open attribute table in a dock window setting is enabled from the menubar: Settings > Options > Data Sources > Feature attributes and table > Open attribute... Restart ...


14

Sure is. QGIS stores stuff in two places: {USERHOME}.qgis2 Registry (Windows) | .config (Linux) .qgis2 is for all templates, plugins, python code, processing models, etc However you can also use the --configpath and --optionpath command args to set the folder to store the .qgis2 folder and settings. The settings will be saved as a ini file. The ...


13

These are the icons used in the latest QGIS (by default I think) and GRASS GIS: http://robert.szczepanek.pl/gis-icons-0.1/ They are licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License which means you can use, alter and share them as long as you attribute the original creator and share your icons under the same or similar ...


13

This is an example of how to open the Processing "Join attributes" algorithm by pressing Ctrl + Shift + 1 (you can copy and paste it into the QGIS Python console): For QGIS v3.x # Function to open the "Join attributes" algorithm's UI def openAlgorithm(): processing.execAlgorithmDialog("native:joinattributestable") # Assign &...


13

In my case deactivating and then reactivating the processing plugin in Plugins -> Manage and Install Plugins fixed the issue. Everything is back on my Vector menu.


12

We can build a flashFeatures method in this way (give it a try in the QGIS Python Console): from qgis.gui import QgsHighlight from PyQt4.QtCore import QTimer from PyQt4.QtGui import QColor timer = QTimer( iface.mapCanvas() ) lstHighlights = [] def flashFeatures( featureIds ): global lstHighlights for f in iface.activeLayer().getFeatures( ...


11

Have a look at this: http://anitagraser.com/2010/11/08/adding-a-dock-widget-to-qgis/ The relevant part being: self.dock = MyPluginDialog() self.iface.addDockWidget( Qt.RightDockWidgetArea, self.dock )


11

You can do that from the QGIS Python console in this way: # Import both Processing and CommanderWindow # classes from the Processing framework. from processing.core.Processing import Processing from processing.gui.CommanderWindow import CommanderWindow # Then get the algorithm you're interested in (for instance, Join Attributes): alg = Processing....


11

Starting from QGIS 3.14, they will open as tabs by default. If the option "Open new attribute tables as dock windows" is active, new attribute tables will be open as tabs on top of other existing attribute tables.


10

In 3.0 you can use QGIS's built in flashFeatureIds method on MapCanvas objects canvas = iface.mapCanvas() layer = iface.activeLayer() my_features_ids = [42, 43, 45] canvas.flashFeatureIds(layer, my_features_ids) This method also lets you modify the style of the flashing


10

QGIS is open source, so you can always see what its doing. The source code is here: https://github.com/qgis/QGIS if you follow the instructions to build QGIS from source then you can run it with a debugger and step through the code, or add extra logging to see what is going on. You will need some knowledge of C++ and build systems (QGIS uses cmake) and you'...


10

QGIS already shows the coordinates at the bottom of the screen when the cursor moves. See for more details: https://docs.qgis.org/testing/en/docs/user_manual/introduction/qgis_gui.html#control-the-map-canvas


9

Yes, it's possible to customize the QGIS UI from a Python plugin by both adding your own toolbars and menus as well as removing/hiding QGIS toolbars and menus. These would be the code snippets for each situation: Adding a toolbar: # Add a custom toolbar self.toolbar = self.iface.addToolBar( "My tools" ) self.toolbar.setObjectName( "My tools" ) self....


9

I had this problem in QGIS 3.8. I just went into manage and install plugins searched for processing, which is a core plugin. I unclicked this to disable the plugin and then reclicked to enable. This fixed the problem and vector reappeared on the toolbar.


8

If you save the style options for the one vector layer as a .qml file, you can apply it onto multiple layers at once with the MultiQML-plugin. Basically, it's an interface window that lets you select which layers you want the style to apply to (by hand, or 'select all'), the 'apply style' button lets you select the qml with the style info. Info to be found ...


8

The information you are looking for is hidden in a panel that is collapsed/minimized on the right-hand side of the dialog. Here's how you can access it:


8

Great idea you need place startup.py in C:\Users\<username>\AppData\Roaming\QGIS\QGIS3 and add missing import ,and voilá from qgis.utils import iface from PyQt5.QtWidgets import QAction import webbrowser def open_gis_se(): webbrowser.open('https://gis.stackexchange.com') iface.helpMenu().addSeparator() gis_se_action = QAction('Go to gis....


8

Review this script. It creates a new QMainWindow and moves the existing map canvas to that window. I've made some changes. Firstly, add a file path (to QgsVectorLayer) to be displayed in map canvas. from PyQt5 import QtCore, QtGui, QtWidgets from qgis.gui import QgsMapCanvas from qgis.core import QgsVectorLayer class Ui_MainWindow(object): def setupUi(...


8

Drag the window and drop onto the indicator. Click the "Pin" button at the top right of the window.


7

As @Dave Pitman points out in his answer, that a user, Stu Smith, got the manifest hack to work. I actually got it to work too. Follow the instructions using the link: http://www.danantonielli.com/adobe-app-scaling-on-high-dpi-displays-fix/ Once the manifest.txt file is downloaded, copy it to the QGIS bin folder. In my case: C:\Program Files\QGIS 2.18\...


7

They are being packed into the application during the compilation phase. You can find them at the source unpacked: https://github.com/qgis/QGIS/tree/master/images/themes/default Edit: QGis 2.12 and up supports (?) themes. I suspect you want to create your own theme based on the default pack. You can find more info at : How to enable UI Theme Support in ...


7

Seems impossible at the moment. But I strongly agree that it makes sense. I have just started a feature request in the QGIS issue tracker https://hub.qgis.org/issues/14941


7

You put the attribute table into a dock widget in settings => options => data sources. Docks can easily be stacked as tabs. There is still a manual process to it to stack the two tables. As far as I know it's not possible to do this automatically (yet).


7

Create bar: bar = QProgressBar() Set range from 0 to 0: bar.setRange(0,0) And now you have: Just set normal values like (0,100) if you want to end this "busy" state. If you want to place this bar in that place, you have to add it to this object: iface.mainWindow().statusBar().addWidget(bar) Here is a documentation and you can find more informations ...


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