Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
3
votes
1answer
88 views

Problem: QGIS-Plugin that involves setting a shortcut, does not work when run a 2nd time

I am trying to build a Qgis plugin which involves setting shortcuts to perform some function on the selected layer in the plugin. When I use my plugin for the first time, everything works as expected. ...
2
votes
0answers
36 views

Problem with font size depending on screen resolution - QT

I developed a QGIS plugin by designing the interface with QT Designer. The inferface appears correctly on my computer (left image). However, on some computers, I encounter size problems, especially ...
1
vote
0answers
32 views

Problem compiling ui to python for a QGIS 3 plugin

I've created a .ui using QT Designer for a QGIS 3.10 plugin called 'bhlayers' which has a docking widget to the right. When I used the: pb_tool deploy command it didn't seem to translate the .ui to ...
0
votes
0answers
20 views

Update QDialog live without freezing UI

So I am currently working on a QGIS Python plugin and I want to update a QDialog with textoutput while an import of data from one file the another is running. So while it is grabbing data from one ...
1
vote
0answers
27 views

Connect QgsMapTool to PyQt Application

I am trying to initialise my DrawPolygonMapTool within my application once the DrawPolygonButton is enabled. When the relevant button is pushed, it does run the __init__ function in my ...
2
votes
1answer
84 views

Connecting Qt GUI to python code in QGIS Plugin

I am completely new to PyQGIS/PyQt and am having lots of trouble getting started. I have managed to create my base dialog box like so: The (automatically generated) code for the dialog is: import os ...
1
vote
1answer
32 views

QGIS Plugin with DockWidget and MainWindow

For my QGIS Plugin, that I started with the QGIS Plugin Builder, I built a QDockWidget and populated it with some functions. Now I want to add a QMainWindow, since I need more space for further ...
1
vote
1answer
133 views

return the text entered in a QTableWidget

I am creating a plugin in Qgis and I need to enter values to a QTableWidget through the interface, but I cannot find a function that returns them to me. I do not do it with a LineEdit because I need ...
2
votes
2answers
1k views

QComboBox multiple selection - PyQT5

I'm making the gui for my QGIS3 plugin using PyQT5 and QT designer. I have a very long list of items in a QComboBox and I need the user to be able to select one or more items. I know that QComboBox ...
1
vote
1answer
151 views

Fields' layer listed into a QListWidget in PyQGIS

I use a QgsMapLayerComboBox nested with a QgsFieldComboBox in Qt. The problem is that I can select only one field with the field combobox and I need to select several fields. self.dlg....
3
votes
1answer
84 views

Check if PYQT5 Widget is Visible in QGIS Plugin

I'm trying to check if my widget is alredy open/visible before showing it (or before run this function). I need to check this because in my QGIS plugin it can happen that I call this function many ...
3
votes
1answer
69 views

Checking if attribute table is showed on the screen with PyQGIS

I'm using the code in this question (Checking the opening of an attribute table with pyqgis) to check if there are attribute table open in QGIS. More precisely, I need to check if some attribute ...
4
votes
1answer
144 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 ...
2
votes
1answer
109 views

Getting screen coordinates from canvas coordinate using PyQGIS

I'm trying to set the initial position of my QGIS plugin dialog. I'm using .setGeometry() but the problem is that I don't know how to get coordinates. I want to set the initial position in the top ...
1
vote
0answers
137 views

How to retrieve text from a QLineEdit in a tabifyDockWidget

I've write a plugin that calls a tool when a certain push button in my tabifyDockWidget is clicked. When the comboBox button is clicked it works perfectly carring the comboBox.currentText() to the ...
2
votes
1answer
921 views

PyQt5 QGIS Plugin - “native Qt signal is not callable” error

I'm having fun writing plugins for QGIS, but when I execute the code QGIS send me this message error: native Qt signal is not callable. This is the "incriminated" code (is a simple horizontal slider ...
2
votes
1answer
79 views

How to connect a QgsMaptool with a widget pushButton

I've write this QgsMaptool above and it works great in python console imports... class obsCreator(QgsMapToolEmitPoint): def __init__(self, iface): self.iface = iface self.canvas ...
0
votes
0answers
32 views

Can not Develop complete Standalone QGIS Desktop Solution QT as Front End and PYQGIS for displaying Queriiyng Map outside QGIS environment

My Main Purpose to Develope " Desktop Standalone Application " A Mainwindow with a QGSCanvas : for displaying Map. Mainwindow must have support of menu, on menu actions different windo/GUI will be ...
1
vote
0answers
52 views

QGIS3 - Using QML in a python plugin on OSX - missing modules

I have the following QML file I am trying to display in a python plugin import QtCharts 2.0 import QtQuick 2.0 ChartView { antialiasing: true title: "Chart Title" titleColor: "white" ...
1
vote
0answers
41 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
52 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
136 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
62 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
29 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
37 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
23 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
34 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
254 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
22 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
47 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
261 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
30 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 ...
3
votes
0answers
546 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
171 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
257 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,...
3
votes
1answer
249 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
93 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 ...
2
votes
1answer
91 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
174 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
166 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
52 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):...
8
votes
1answer
12k 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
329 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
661 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
24 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
37 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
256 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
56 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
156 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
348 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
2 3 4 5