Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

1
vote
1answer
28 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 ...
2
votes
2answers
56 views

Can I use PYQT drawing function in QGIS?

I work on a wood fire simulator project in university that uses QGIS. I have to draw various symbols on the map. As I'm not able to design it with qgis functions so I made it with in a stand alone ...
1
vote
1answer
54 views

Adding x,y labels in QGraphicsview using pyqt4? [closed]

Here is my sample program. When I need to draw a line for x axis and y label for y axis .so can any one help me how to add a line and labels to scene.i tried different ways but i didn't get the proper ...
0
votes
0answers
17 views

Find diagram for understanding pyqgis

In orther to undestand the api of pyqgis, i'd like to konw where can i find a diagram of pyqgis api ?
1
vote
0answers
27 views

QGIS (maptool) Plugin Crashes on some computers

I developed a custom Plugin which inherits from QGIS MapTool.The plugin has user interfaces and can add features to the map based on a GUI. The Plugin works Fine on some computer(when they installed ...
3
votes
1answer
52 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())) ...
0
votes
0answers
48 views

Displaying picture in QGIS 3.X custom form (QT designer)

I have a problem with a function that worked well with QGIS 2.X but not with QGIS 3.X I want to display an image in a form made with QT designer. I followed this: In QtDesigner Add a new QWidget ...
1
vote
0answers
30 views

Locking QGIS and parent forms [closed]

I am trying to make a plugin for QGIS. This plugin has lots of forms and based on the condition the form calls a child Form. The following is an example I am using PyQt for creating forms. I want the ...
1
vote
0answers
47 views

QGIS Python Plugin - Prevent Dialog From Closing Immediately after OK Clicked

I've generated a QGIS plugin using the QGIS Plugin Builder v3.0.3. One issue I am encountering with it is - as soon as I click the "OK" button (that invokes the run method) - the dialog closes. Is ...
0
votes
0answers
18 views

Qdialog control events not working for own ui design

Created new postgis line layer and after capturing single feature need to show my own form design i.e. Qdialog,instead of default qdialog. used this coding for showing my own ui dsign. QgsVectorLayer....
0
votes
1answer
81 views

Toggle Editing Add Feature

i have loaded the layers in qgis from database. so after picking "toggle editing" plugin,the other corresponding plugin are in disabled state only,they are not enabled.how to set "add feature" plugin ...
1
vote
0answers
23 views

Using graphical modeler script via command line

I have made a script through the graphical modeler and I exported it. This is the code that it exported: [Python code] https://imgur.com/a/ivgWXUh How do I run this code outside of QGIS? Which ...
2
votes
1answer
328 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) ...
1
vote
0answers
37 views

Simple user input in QGIS with pyqt plugin

SplitPolygon plugin allows the user to enter an angle by which the polygon(s) will be split. I would like to modify the plugin and take that value from graphical user input (say, parallel with one ...
0
votes
0answers
16 views

QGIS Plugin mapCanvas() focus

I have created a test plugin using plugin builder in QGIS3 as a framework. This creates a popup window based upon Qdialog. I want to pan the map from this dialog and have calculating a new location (...
3
votes
2answers
76 views

Stopping execution of plugin or deactivating running plugin using plugin name without closing QGIS in pyqgis?

How do I stop the execution of plugin or deactivate the running plugin using plugin name without closing QGIS in pyqgis? lstofplugins=qgis.utils.active_plugins for k in range(len(lstofplugins)-2): ...
1
vote
0answers
50 views

Lock the nativity of the QGIS using PyQGIS [closed]

How to lock the nativity of the QGIS using PyQGIS icon = QtGui.QIcon(folPath + '\Dsmsoft.png') pixmap = icon.pixmap(302, 302, QtGui.QIcon.Normal, QtGui.QIcon.On) icon = QtGui.QIcon() ...
1
vote
1answer
495 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
1answer
2k views

AttributeError: 'NoneType' object has no attribute 'pushButton'

I am using pyqt5 working in Qgis to create a simple plugin, i started by creating a pushButton wit QtCreator and create an event using this code : from PyQt5.QtCore import QSettings, QTranslator, ...
0
votes
0answers
26 views

Changing display name without changing layer name in PyQGIS? [duplicate]

for layer in QgsMapLayerRegistry.instance().mapLayers().values(): basename = os.path.splitext(os.path.basename(layer.source()))[0] layer.setLayerName(basename) How do I change only the ...
0
votes
2answers
63 views

Intercepting QGIS panels closings?

I would like to be able to intercept QGIS panels (QDockWidgets) closings. I read the API online help but i don't clearly understand it.Is there any usable close signal linked with dockWidgets? In ...
1
vote
1answer
279 views

How to use QT QGis custom widget in a plugin?

I am writing a new plugin for QGIS 2.18. I can't find what are the libraries to import in my main code to access widgets such as QgsSpinBox or QgsFileWidget.
0
votes
1answer
232 views

How to get the click coordinates for the use in a custom form

I'm having a Spatialite layer to store photo locations from objects (stored in another Spatialite layer) taken in the field. Therefor I'm using a custom photo form like explained here. Since now I ...
0
votes
1answer
2k views

Running Python produces 'No module named 'PyQt4' in Qgis on Mac High Sierra

I was following the instructions in this guide: Create a Polygon Shapefile from Point data and fairly sure I substituted field variables to match my data. However, when I run the script on my Mac (...
1
vote
0answers
386 views

QPixmap: Must construct a QApplication before a QPaintDevice

I am creating a PyQT and QGIS application and im trying to add a combobox to the UI. I have defined the layout of my UI in a separate module to the main module. I know it is an issue with the combobox ...
0
votes
1answer
115 views

auto complete input widgets

I am building a plugin in python for Qgis. I want the users to be able to start typing a text and that auto compellation to pop up based on values in a certain field I will define. Is this possible ...
2
votes
2answers
366 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
103 views

Getting response right in QGIS plugin?

I am trying to get my plugin working and have some issues with the count of currently selected layers. As am listening to legendInterface().currentLayerChanged(), triggering a function that is ...
2
votes
1answer
859 views

qgis2web cannot find QtWebKit

I have QGIS 2.18.16, in Arch Linux; I wanted to use the qgis2web plugin and I realized it is not working anymore (it used to work last time I used it a few months back) I get the following error ...
1
vote
1answer
152 views

Different performance of counting features in ogr.Layer returned from ExecuteSQL

I am working on a PyQt5 desktop application GDBee which allows executing SQL queries against Esri file geodatabases using GDAL. My development environment is Windows 10 64bit, Python 3.5, and Python ...
1
vote
0answers
112 views

Controlling messages that are pushed to QgsMessageBar() [duplicate]

I've got a QGIS processing script which displays progress in the message bar, using the code in the PyQGIS cookbook. It displays properly at the beginning of processing, but my code calls some other ...
1
vote
1answer
155 views

pyqgis correct activate signal for combo box list

I am a pyqgis user and I am trying to create a QGIS plugin where that plugin have two tabs widgets and two combo box where first combo box have a list from layers and second combo box have list of ...
1
vote
1answer
81 views

PyQGIS plugin doesn't work layer list combo box

I want to create a simple QGIS plugin with a simple combo box with list from my layers in _ _init_ _ : legendInterface = self.iface.legendInterface() listLayerName = [i.name() for i in ...
0
votes
0answers
12 views

Adding a delete function for shapefile to QTFileDialog.getSaveFileName

I am writing a QGis plugin, with a QT interface. The plugin output is a shapefile. The interface let the user define the output filename with dialog = QFileDialog() thisFile = dialog....
2
votes
1answer
158 views

pyqgis zoom using pyqt list widget

I have created a layer filter Expression to get specific results query from my layer and i add these results in list widget using pyqt. my Expression and my add to list widget work fine(i take ...
0
votes
1answer
264 views

ComboBox Field not updating when layer is selected

I try to develop my plugin. The problem is that when the layer is selected in upper comboBox (QgsMapsLayerComboBox), in lower two boxes (Latitude, Longitude: usual ComboBoxes) shall appear fields ...
8
votes
0answers
156 views

Remove “Save As” from QGIS Context Menu Using PyQGIS

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 ...
1
vote
1answer
347 views

PyQt.QtSql - get database connection fail informations

Python 3 - PyQt4 - Qgis 2.14 I need to display message when my connection is success or fail with PyQt4.QtSql. How retrieve message after db.connect() ? Here is my code : def testConnect(self): ...
1
vote
1answer
246 views

pyQt open dialog error

Python Version 3 - Qgis 2.14 1 / what's wrong ? Lot's of solutions are exposed in differents forum but any work for me. I need to get path to save documents later and i had this error : ...
1
vote
1answer
143 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....
1
vote
1answer
130 views

Reading values from dynamically created Qlineedit boxes using PyQGIS?

I am creating dynamic labels and line edit boxes based on the number of fields in the shapefile and populating the lineedit boxes using the feature attributes using the below code. Each lineedit box ...
2
votes
3answers
577 views

PyQt - default option don't close dialog [closed]

I have a plugins generated by "plugins builder" with simple Ok / Cancel button / combo box to display canvas layers. When i cick on "OK" button, plugins is not close and if i use it again, my ...
3
votes
1answer
151 views

How to silence QGIS 3 nightly build's debug output with PyQGIS?

When I run the following file sample.py it prints more than 100 lines of debug output. When porting a PyQGIS script to QGIS 3 it is hard to find the expected log statements in between all debug ...
2
votes
2answers
344 views

PyQt - merge selected features function

VERSION QGIS 2.1x i realize plugins to do this actions without use toolbar: copy features / paste to layer / merge selected features => define attribute to use in merge. So, all is okay but i don't ...
1
vote
1answer
282 views

How to navigate through a vectorgrid with arrow keys in QGIS

I have a written a python-script below which creates a vector grid based on the resolution of a .tif image (satellite imagery). import processing layer = iface.activeLayer() #define parameters for ...
1
vote
1answer
878 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 ...
1
vote
1answer
102 views

Standalone app does not show the content

I am trying to show the shapefile in canvas using standalone application. However it does not show the content. Here is my code and I am using PyQt5, Qgis 2.99, PyCharm 3.6 from qgis.core import * ...
1
vote
0answers
26 views

Can I get value from attribute table when I click on it for using in my plugin?

I created a plugin which helps us to calculate the azimuth(bearing) between points. Here is the user interface; When I click the points, it must fill the blanks automatically. Of course this point ...
3
votes
0answers
101 views

QGIS Build error : zzz-db_manager-5-depend error - qgis master 2.99

I am compiling QGIS from master in VS 2015 on x64. I am getting error as : Error MSB6006 "cmd.exe" exited with code 1. zzz-db_manager-5-depend 7 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\...
1
vote
0answers
59 views

Qt folder browser opening more than once in QGIS plugin [duplicate]

I have a Qt plugin, and i have a button browse_btn to browse for an output folder. I use the QFileDialog.getExistingDirectory function and it all works fine. However if I close the plugin and open it ...