Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

QLineEdit only allows me to write one character [on hold]

I am writing a plugin for QGIS3, and I want to implement a lineEdit function that allows the user to write in a text. I am using a simple example just to make it work, however it only allows the ...
1
vote
0answers
27 views

PyQGIS ogr provider not Found

I using PyQGIS in my python application,My program couldn't find org provider and failed to create layer. My code and environment are as follows. The env: The Code: from qgis.PyQt.QtCore import Qt ...
2
votes
1answer
35 views

PyQGIS/PlugIn: How do I pre-check if processing function is executable before I get a QGIS critical error?

I built a PlugIn with the 'native:shortestpathpointtopoint' tool to find the shortest path between two points on a multipolyline. When I run the Plugin I want to get a message with information about ...
2
votes
0answers
64 views

QGIS standalone plugin: Display a progress bar with a busy state

I have a standalone QGIS plugin and to inidicate that the plugin is processing, I want to add a progress bar that indicates a busy state, but not showing the exact progress like in the picture below: ...
1
vote
0answers
47 views

Storing information from a Combobox in layer in QGIS/PyQt

I am building a plugin for QGIS and want to add a string to a created polygon. In my dialog I was able to create a ComboBox filled with 10 different strings which can be added while creating the ...
1
vote
1answer
26 views

PythonQT QGIS print-command

For debugging purposes I would like to print the content of some variables in my PYGT-function, like: print(myGeometrylength) ... The variable has some content but nothing is printed? I just get ...
2
votes
0answers
33 views

QGIS map tile not printing some given extent in one time why?

I made a plugin in QGIS using pyqgis and qt designer to plot OSM tile in which I have one button which connects me to function in which I wrote a program to plot raster layer using param and I am ...
0
votes
0answers
16 views

Rendering Polygon from geom data onto pyqt widget

I am developing a program that will show the polygon of a selected location. My geometry data is in a spatial PostgreSQL database and I want to use the geom column. I have searched the internet for a ...
2
votes
0answers
28 views

How to get display of individual polygons from vector shapefile?

I am creating a shapefile with adding 20 polgons to it. poly = ogr.Geometry(ogr.wkbPolygon) for p in range(20):#20 should be replaced by pix_no ridx = rind1[p] ...
1
vote
1answer
61 views

Listing active radio buttons within tab widget or layout?

I have a plugin widget with some tabs, and within the tabs a layout of radio buttons as shown below: I would like to capture the list of active radio buttons within each tab like so: Is there an ...
1
vote
1answer
16 views

Pulling images into QTWidget (plugin dialog box) from web server? [closed]

I'm trying to show images in a dialogue box (built using QT Creator and interacted with through my plugin). I have the images as a list of URLs, but can't figure out how to get them to display in the ...
1
vote
2answers
40 views

Developing “Action” that shows changed value of form-field using PyQGIS?

for a vector-layer I would like to produce an action, that shows the changed value in a formular. E.G. I am editing a vector-point-layer, click on a point, the fomular is opening. I change a value (...
2
votes
1answer
65 views

How do I call the objects created with QtDesigner (or QtCreator) in my code in python? Where is this information in python? PyQt4 please

Where can I find a good documentation on how to refer (to call) to the Dialog created with QtDesigner? For example, a buttomBox (or any other) just created. I’m trying to make a plugin, but the ...
0
votes
0answers
15 views

Referencing image using GCP-file?

I'm trying to automate the actual geo-referencing in PyQgis/PyQt5. I went manually over the built-in GDAL Georeferencer in QGIS and saved a GCP-file. Also, the actual commands used for the conversion ...
0
votes
0answers
39 views

Automating GDAL Georeferencer

I'm using the GUI of the GDAL Georeferencer in qGIS for referencing a lot of images. For a single image it is fine to open qGIS, open the referencer and changing the settings and GCPs manually. ...
3
votes
0answers
245 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()....
2
votes
0answers
88 views

QGIS Python plugin crashes when using processing algorithms and QThread

I'm developing a QGIS plugin which calls several processing algorithms. I call them in a pipeline where the input layer of each algo is the output of the previous one. The pipeline is called on each ...
2
votes
1answer
53 views

Toolbar button with drop down menu

I want to create my own Toolbar with a Toolbar button which has a drop down menu: The following code works fine in the QGIS console: from qgis.core import Qgis from PyQt5.QtWidgets import QToolBar,...
2
votes
1answer
73 views

How to add DockWidget above the Layer panel using PyQGIS

I'm trying to dock an attribute table on the left hand side of my window, above the Layers panel. By enabling "Open new attribute tables as docked windows" (under Settings Options > Data Sources ...
1
vote
0answers
42 views

How to run PyQT code inside python console(editor) in QGIS? [closed]

I have built a simple PyQt application(inserting list item in QListWidget) which runs outside the QGIS environment.I want to integrate that inside the QGIS so that all the map layers will be inside ...
0
votes
0answers
29 views

PYQT - how to regenerate QGridLayout with photos from user selected folder

I'm trying to regenerate a layout in PYQT to display image thumbnails after the user has chosen a photo folder but I've I have only been able to hardcode a folder when building the QGridLayouts to the ...
2
votes
1answer
66 views

QGIS plugin: set the position of the featureForm

Im developing QGIS plugin (Python3) to open the featureForm (depending on some of my conditions (matching geometries,...))I use this code: layer = self.iface.activeLayer() ...
1
vote
0answers
122 views

Can't load Python in QGIS

I am following a tutorial developing a Python plugin in QGIS. After completing the script for the plugin I got the following message the next time I started QGIS. Warning I am a complete novice with ...
1
vote
1answer
77 views

QgsMapToolEmitPoint.canvasReleaseEvent not firing with SHIFT modifier

I've created a plugin that implements a Map Tool. It captures mouse click events, which works fine. Now I want to capture Shift+Mouseclick. This doesn't work at all, while Alt+Mouseclick and Ctrl+...
1
vote
0answers
32 views

QgsVectorLayerCache causes QGIS to crash when called within def run(self)

This is in reference to the similar question regarding QgsVectorLayerCache . The original code is taken from here I'm trying to implement this method within the def run(self) method. def run(self):...
7
votes
1answer
4k 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
193 views

Using 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
331 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
22 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
36 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
182 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())) ...
1
vote
0answers
45 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
110 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
1answer
238 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
33 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
843 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
80 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 ...
3
votes
2answers
147 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
59 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() ...
3
votes
1answer
1k 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. ...
0
votes
1answer
3k 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
2answers
97 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
483 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
359 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
663 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
219 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
702 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
121 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
2answers
1k 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 ...