Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
16
votes
9answers
16k views

QGIS plugin: Problems importing resources (resources_rc) file - plugin doesn't load - PATH problems?

I'm building qgis plugin and I can't find solution for this error. File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 478, in _import mod = _builtin_import(name, globals, locals, ...
13
votes
4answers
9k views

Developing GUI in Python for ArcGIS geoprocessing using PyQT/Tkinter/wxPython?

I want to develop a GUI in Python for ArcGIS geoprocessing. Can I use PyQT for GUI programming in ArcGIS? I have also considered using Tkinter and wxPython.
4
votes
2answers
2k views

Usage of QgsTask and QgsTaskManager

I'm trying to test the new QgsTask and QgsTaskManager, I found some examples in the PullRequest in github. I modified it slightly and added a print(i) in the code bellow: from qgis.core import ...
1
vote
1answer
1k views

Capturing mouse movement on QgsMapCanvas?

I have a python app that uses QgsMapCanvas as map display. I put it inside a QWidget, which is then inside another control. The problem is that there seems to be no way of tracking mouse move event on ...
8
votes
3answers
3k views

How to use Threads in PyQgis, mainly to keep UI active?

I'm trying to develop a plugin, which does heavy computations and as a result, user interface becomes inactive. I know that I should use threads to keep the UI alive (specifically, I have a progress ...
4
votes
1answer
452 views

How to create sub-menus in QGIS 3 plugin

I'm trying to create a sub-menu in a QGIS plugin like in the image. I found this Add extra item to drop down menu plugin. "Layers menu from project" plugin but I'm using QGIS 3 and PyQT5 and ...
5
votes
2answers
660 views

Properter to get travel time as cost for network analysis

What I want to do is calculate travel times between points within a road network. I know there are options with GRASS (via v.net) and pgRouting (and possibly many more). I intent to stick to the ...
3
votes
1answer
2k views

PyQGIS reload a QGIS plugin

I have a plugin that has a psycopg2 connection to a PostGIS database. When i close GUI with the X-Button and open it again, all the widgets are filled with the data from before. It looks like the X is ...
1
vote
1answer
2k views

QGIS 2.99 "qgis._core import error: DLL load failed"

I am trying to run a standalone application. However, it does not run the program because of mentioned error in title. Here is my code: from qgis.core import * from qgis.gui import * from qgis.utils ...
5
votes
1answer
2k views

Work around for “Couldn’t load PyQt” error with QGIS 3.0.3 on Ubuntu 18.04?

I am working with a fresh install of Ubuntu 18.04 and installed QGIS using https://qgis.org/debian. I get the following error when I launch QGIS: Couldn't load PyQt. Python support will be disabled. ...
1
vote
2answers
2k views

QGIS 2.4 - Python 2.7 PyQT4.Qtcore.QStringList Import failed

I receive an import error when trying to import QStringList from the QGIS Python console (or when loading a custom plugin). from PyQt4.QtCore import QStringList Traceback (most recent call last): ...
8
votes
2answers
750 views

Remove "Save As" from QGIS Context Menu Using PyQGIS [closed]

I want to remove an existing option ("Save As") from context menu of QGIS layer, what I have found so far is, to add new action in the LegendItems, or overwrite completely with new options. But could ...
8
votes
1answer
18k views

How to fix 'Could not find the Qt platform plugin “Windows” in “”' when implementing qgis in custom Python3 application?

I am implementing qgis 3.4.3 in a custom application, but when I instantiate the QgsApplication() class, I receive the error "Could not find the Qt platform plugin "Windows" in "". I've attempted ...
5
votes
1answer
2k views

how to open second window in my plugin for QGIS?

I create a Mainwindow for my plugin, but if I want to open a second window from this Mainwindow, with click on push button. How can I do? I tried the following function in my Main Class: dialog = ...
4
votes
1answer
1k views

How to add loading bar in QGIS Plugin development?

Every time i use tool or plugin in QGIS, i saw a kind of bar like this for indicating loading progress : The different between that bar and Progress Bar is that progress bar will increase until our ...
6
votes
1answer
685 views

Moving cursor using PyQGIS?

I would like to move the cursor to a given x,y coordinates of the MapCanvas. Is there an easy way to do this using PyQGIS?
8
votes
2answers
6k views

QGIS relations widget in custom form

I've just begun exploring QGIS relations option, now in version QGIS 2.2, details here: http://blog.vitu.ch/10112013-1201/qgis-relations This is a great implementation of something I've been ...
3
votes
0answers
522 views

QGIS QgsAttributeTableModel only loads when called without a function in Python

I tried to load QgsAttributeTableModel into QgsAttributeTableView or a plain Qt QTableView but it could run from inside a class method or function but it runs without any function or method. Below is ...
2
votes
1answer
487 views

How to get a group layer delete signal in QGIS

I'm developing a plugin into QGIS 2.18. I need to catch if the user deletes a group layer. I tried the signal layerWillBeRemoved from QgsMapLayerRegistry class but it sends only layers not group layer....
7
votes
1answer
364 views

Get xy coordinates of QgsMapCanvas in PyQGIS 3?

I am trying to get the QgsMapCanvas coordinates when they change using PyQt5 and PyQGIS 3. What I have used for that: self.canvas.scaleChanged.connect(lambda: self.showScale(self.canvas.scale())) ...
5
votes
1answer
1k views

Download file from network using PyQGIS 2.x

I have a python plugin targeting QGIS 1.8 that uses QgsNetworkAccessManager and QNetworkRequest to issue a GetCapabilities request to WMS servers. With 1.8 everything was working fine. Now we are ...
5
votes
3answers
3k views

Should you switch from ArcMap to QGIS? [closed]

Background: Our group has full ESRI licenses and applications built with ArcGIS Desktop. We are invested in the arc geodatabase itself and will not change that tier. There is a proposal to switch ...
2
votes
2answers
3k views

PyQT: QFileDialog keeps on opening window after clicking on cancel or ok

I use to write QGis plugins, which is based on PyQT. I use to create QButtons and connect their click to a function that itself calls a QFileDialog. For example: def doOpenFile(self): fname =...
1
vote
0answers
996 views

Overlaying Google Map in standalone PyQgis application? [closed]

I have created a standalone PyQGIS app (within Python itself, not a plugin) with PyQt and PyQGIS API. It generates my map really well. I would like to overlay a Google Map layer as base map just like ...
5
votes
1answer
728 views

Add extra item to drop down menu plugin. "Layers menu from project" plugin

I have created a drop down menu in QGIS. The code is mainly from the "Layers menu from project" plugin. I have cleaned it so it only have the drop down. My problem is that I will like to add an ...
5
votes
1answer
321 views

Referencing Qt UIs external to plugin with python

I'm developing a plugin that sets up a working environment for a user: loading layers (from db), applying styles and several custom designed (Qt) UI files etc. Primary user interaction is in the ...
5
votes
4answers
983 views

QGIS Plugin with save settings dialog

I am writing on an update of the qgis2leaf plugin. It would be great to store the settings of the plugin UI (like which checkboxes are checked, which strings are used) in a separate file (like xml or ...
4
votes
1answer
2k views

Adding a Tiles/wms? (openStreetMap) layer with python in QGIS

In my QGIS python plugin I want to add a background map (if the user haven't added one), hence I think I missing something in the url for the Tiles/wms service.. (the function returns invalid layer) ...
3
votes
0answers
1k views

Canceling task currently running in background using PyQGis?

I am trying to close QgsProject on loading layer (if password and username from QgSProject - datasource are incorrect) before QgsCredentialDialog is shown. on signal : QgsProject.instance()....
3
votes
1answer
10k views

How to position the Qwidget form/QDialogBox in the left corner using python programming

1) I am creating a Qwidget Form or QDialogBox using QT Designer. I am using the following code to move the form: sDialog.move(50,450) But i want to fit the dialogBox to fit in the left corner.How ...
3
votes
1answer
2k views

PyQGIS - QgsMapToolEmitPoint

I would like to make use of Signal and Slot while using PyQgis along with PyQt4. Despite spending some time trying out tutorials and some somewhat related post on gis.stackexchange I can't figure out ...
3
votes
2answers
1k views

Segmentation fault (core dumped) QgsApplication

import os, os.path,sys from qgis.core import * from qgis.gui import * from PyQt4.QtGui import * from PyQt4.QtCore import * class MapExplorer(QMainWindow): def __init__(...
2
votes
0answers
268 views

QPyNullVariant not recognized outside of QGIS [duplicate]

I'm getting an error about an operation involving a QPyNullVariant: TypeError: unsupported operand type(s) for *: 'QPyNullVariant' and 'float' I wanted to put a check into my code to skip these ...
2
votes
1answer
472 views

Using QGIS modules in standalone application with PySide?

I want to make small standalone application using PySide and QGIS Python modules to display satellite images and do standard GIS operations, like creating new a shapefile and placing polygons or ...
1
vote
1answer
461 views

Why does QGIS 2.4 prematurely terminates on startup at "Starting Python"?

After reinstalling Python (3.4) as well as OSGeo4W and the QGIS Standalone, my QGIS always crashed when "Starting Python" on my Windows 7 64 Bit environment. It simply did not proceed to the QGIS-GUI ...
1
vote
1answer
1k views

Layer properties dialog in my QGIS plugin [closed]

I am developing a plugin which should display some information like geometry of the layer, feature count etc. Now those are currently displayed in QMessageBox.information. I want it to be displayed ...
1
vote
1answer
201 views

GIS Action that loads a raster, creates pyramids and sets color

Using the code in "Developing QGIS Action which loads a raster". from PyQt4.QtCore import QFileInfo,QSettings from qgis.core import QgsRasterLayer, QgsCoordinateReferenceSystem s = QSettings() ...
0
votes
1answer
99 views

Creating QGIS Shapefile in PyCharm leaving some attributes NULL

I've created the shapefile and can manually enter in all the attributes to come in fine, but when I call it any other way (which I will need to do), the values for the floating types appear as NULL, ...