Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
1
vote
1answer
547 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 ...
1
vote
1answer
2k views

How can i fix the dock widget to the the Qgis window using python

I am creating a dock widget for my plugin and i want my widget to be fixed to the Qgis window. How can i do that using python programming?
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): ...
1
vote
1answer
5k 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 ...
1
vote
2answers
56 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 (...
1
vote
1answer
851 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
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 ...
1
vote
2answers
1k views

Issue in the popdown box (QComboBox) in QGIS 2.6 Python plugin

I had developed a plugin that counts the number of features for a layer in Qgis2.6. When i load a layer say 'Airport' for first time and click the pop-down box in the plugin,it lists the airport once....
1
vote
1answer
454 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

Custom forms and Python logic: attribute error [closed]

As a beginner to Python, PyQt4, AND QGIS, I am attempting to work with the custom forms feature in QGIS. At this point I'm not sure if my error comes from the code or the .ui. This blog gave me a ...
1
vote
1answer
173 views

Is there a way to refresh the browser on QGIS programatically with PyQGIS?

I have tried the QgsBrowserModel but it doesn't seem to work. I am not even sure if that is the right class to use. The problem is that I add WMS and database connections through a plugin but they won'...
1
vote
1answer
88 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
30 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 ...
1
vote
1answer
34 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
1answer
345 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
1answer
147 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 ...
1
vote
1answer
491 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
1answer
336 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
485 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
227 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
1answer
128 views

Qgis PyQT app error:

Can somebody help me. Trying to run Qgis PyQT app, but have an error in command line C:\work\2q5>python program.py C:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(472) : (...
1
vote
1answer
662 views

Addition button in QGIS plugin form

I want to create PYQGIS plugin and for my task i need my QGIS GUI form to have one more button except to original button ok. the additional button to do something and original button to do something ...
1
vote
1answer
189 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() ...
1
vote
1answer
993 views

QGis cannot retrieve a text value from QLineEdit [closed]

I am a developing a small plugin with python for QGis. I have a QLineEdit widget and I need to take the input from there. The input is a 8 character number string. However when I try to retrieve the ...
1
vote
2answers
84 views

Putting result of selection of plots in frame of QGIS?

I have made a plugin for QGIS in pyQt. Then I can make a query from a PostGIS database and I get the plot or bunch or plots results of that query in a layer. This layer is overlapped on the top of a ...
1
vote
1answer
704 views

QGIS 2.4 plugin PyQT qWebview javascript interface problem

I have a QGIS plugin which contains a qtwebview and Javascript communication between the page and the plugin. It is working perfectly with QGIS 2.2 but not with 2.4 (both QGIS versions share the ...
1
vote
1answer
243 views

Error in LineEdit when show parsing value as string

I m trying to make QGIS plugin to open xml, parse it and then show value i parse from xml to line edit, i use this code : from PyQt4 import QtCore, QtGui from ui_testparse import Ui_testparse import ...
1
vote
1answer
1k views

PyQt4 pushbutton not connecting for my QGIS plugin

I'm trying to display information in a text browser with the push of a button in my QGIS plugin. The .ui is created using PyQt4 (button's object name is calcConso). No error message, but the button ...
1
vote
1answer
50 views

Store QGIS map themes (to XML)

I would like to store QGIS Map themes to be used later. In my workflow, I use a plugin which imports many (grouped) layers. Each layer contains several styles that I can switch between. I want to ...
1
vote
0answers
55 views

Taking picture from QGIS Plugin using PyQt [closed]

I have a button in a Plugin to take a photo and relate it with a feature of a layer in QGIS. My aim is to select a feature, open a camera view (viewfinder), take a photo and save it with the feature ...
1
vote
0answers
38 views

Reloading aprx that has been modified using ArcPy with ArcGIS Pro

I'm writing a python script tool for ArcGIS Pro that uses a custom GUI created with pyqt. I would like the tool to be able to add and remove layers from the main map in the ArcGIS Pro project it is ...
1
vote
0answers
39 views

Create a plugin to connect PostgreSQL db and run a query using QGIS Plugin

I have prepared a code to connect PostgreSQL database and run a query on the database using PyQGIS and it is running successfully on python console of QGIS. I want the same to happen using QGIS Python ...
1
vote
0answers
21 views

Is it possible to open below code on PyQt Designer? [closed]

I want to add some design via PyQt Designer to below GUI: class Ui_MainWindow ( object ) : def setupUi (self, MainWindow) : MainWindow.setObjectName ( "MainWindow" ) ...
1
vote
0answers
61 views

What's the role Qwidget and Qlayout in the QGIS interface?

I use miniconda3 to manage my software installations, including QGIS, so I can use packages like geopandas easily in the QGIS python console. Lately however, when I open qgis from the command line ...
1
vote
0answers
71 views

Display maps from QGIS in my GUI created using PyQt5 [closed]

I wish to create a GUI using PyQt5 for an application that displays a map created using QGIS. How do I integrate QGIS and PyQt so that the map I wish to display can be shown in my app?
1
vote
0answers
91 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 ...
1
vote
0answers
67 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 ...
1
vote
0answers
241 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 ...
1
vote
0answers
73 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 ...
1
vote
0answers
87 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
0answers
115 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 ...
1
vote
0answers
213 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
0answers
91 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):...
1
vote
1answer
1k 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 ...
1
vote
0answers
41 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 ...
1
vote
0answers
64 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
64 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
0answers
1k 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 ...
1
vote
0answers
325 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
0answers
43 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 ...