Questions tagged [pyqt5]

Python bindings for Qt5

Filter by
Sorted by
Tagged with
0 votes
1 answer
65 views

Can't connect with Web Map Services - problem with OpenSSL 3.0.2 Ubuntu 22.04

This problem is connected with Qt5 I believe, starting QGIS from the command line gives, amongst many other messages: Warning: Incompatible version of OpenSSL Warning: QSslSocket: cannot call ...
Will Jackson's user avatar
1 vote
0 answers
42 views

Reuse Extent menu from processing tools

Actually I'm using QgsExtentGroupBox in my plugin and it works fine. Now I want to make the GUI more compact and therefor I want to implement the extent menu a lot of processing tools are using: I ...
geraldo's user avatar
  • 960
0 votes
0 answers
22 views

QgsMessageBar in Qt Creator

By default Qt Creator does show the list of QGIS Custom Widgets - but not the QgsMessageBar. I can make it work inserting it directly in the Code View using something like but really would like to ...
geraldo's user avatar
  • 960
1 vote
0 answers
81 views

Message Bar called from script shows in its own little window

I'm trying to show a message bar in the main window, reporting on the result of a processing script. However, an empty message bar appears in the main window, and the text appears in a small little ...
Andre Geo's user avatar
  • 538
0 votes
0 answers
84 views

QFileDialog.getOpenFileName Loop problem in a QGis plugin

I wrote a QGIS plugin and in the pyQt5 Dialog , I use a button connected to a QFileDialog.getOpenFileName function to select a dxf file. I aim to open the dxf file for controls. In the def run() ...
aurel_nc's user avatar
  • 612
0 votes
0 answers
93 views

Import QWebEngineView into PyQGIS script

I'm working on a project that should interact with Google Maps API. Usually I use QWebView as a widget to load web pages. But my simple html page is not loading there. However if I load the original ...
Pavel Pereverzev's user avatar
6 votes
1 answer
164 views

PyQt signal when layer name is changed in PyQGIS

Use this when layers are added, deleted, or their order is changed. Can you get a signal when a layer name is changed? QgsProject.instance().legendLayersAdded.connect(self.polygonList) QgsProject....
Jihyun Kim's user avatar
-1 votes
1 answer
64 views

QGIS3 quits after PyQt Script 2 run [closed]

I wrote the PyQt script below and I am running it through QGIS3. When I run it for the first time after opening it in QGIS3, the application's window pops up smoothly. However, when I close the window ...
HelpOverFlow's user avatar
3 votes
1 answer
70 views

AttributeError when creating list field with QVariant in QgsVectorLayer using PyQGIS

I am trying to create a list-type field for the active layer using the code below, which is not working. Is there any other way to create a list-type field and update the list([1,2,3]) as an attribute ...
Ganesh S's user avatar
1 vote
1 answer
820 views

Folder Dialog in PyQT5

I want to create a Python Plugin for QGIS 3. I used the Plugin Builder tool to create the base of the plugin. One of the functionalities I would like to implement is a Folder Dialog where one presses ...
Kai's user avatar
  • 349
0 votes
0 answers
90 views

Update ui progress bar from calculation class (pyqt5)

I have 2 classes : first class : a "processing class" running some calculation; second class : a "ui" class that displays a progress bar and a label. The goal is, as the ...
theonewhodidnotknow's user avatar
0 votes
0 answers
33 views

Replace Attributes Form and Automate Fields

I used QT Creator to create an .ui for my form. I want to change the form attribute and automate some fields. Imagine I have an layer with field name, I want that field when the form appears, to ...
Diogo Barros's user avatar
0 votes
1 answer
542 views

Pyqt5 : dynamically change label value, with no clicking signal

I have a question regarding PyQGIS. I am currently developing a plugin, and I wish to update a window's label as soon as the window opens, without having to click on a button. Here is what I do: I ...
theonewhodidnotknow's user avatar
0 votes
0 answers
55 views

Create standalone EXE PyQGIS application

Has anyone managed to create a separate PyQGIS exe application? Versions: QGIS 3.22 or 3.28, Python 3.9, IDE PyCharm 2022.2 I've already tried almost everything, including the instructions from this ...
Stano's user avatar
  • 41
0 votes
0 answers
110 views

After adding the line "from qgis.core import QgsApplication", the exe application does not work

I am testing a simple PyQGIS application. When I add the line "from qgis.core import QgsApplication" and make an exe via pyinstaller, the application crashes with an error: Traceback (most ...
Stano's user avatar
  • 41
0 votes
1 answer
82 views

Error when importing another py and ui files in my QGIS plugin [closed]

I am currently trying to create a QGIS plugin with several windows, and it fails. Here is what I did : With QGIS tool Plugin Builder, I created a plugin my_test This generated a folder with the 3 ...
theonewhodidnotknow's user avatar
0 votes
0 answers
26 views

how to write add-in in arcgis pro with python [duplicate]

I want to develop add-ins with python (arcpy) in arcgis pro. I searched a little but I couldn't find many examples. There was also an editor in arcmap that we used when developing add-ins. I couldn't ...
Cnrgrsc's user avatar
0 votes
0 answers
54 views

QGIS 3.10 PyQGIS . Snapping tolerance units (Equivalence pixels - length units)

Lately I have been dealing with snappings in QGIS. I have been able, with help of people from this site, and also, having a look at other peoples plugins, to ensemble a small plugin with forms. My ...
nanunga's user avatar
  • 533
2 votes
0 answers
32 views

How to capture featureDeleted() info in PyQGIS3

I have a system of scratch layers generated from table data in QGIS. Users may interact with the attribute tables directly (not good practice, but I did not design the system) or through a PyQt5 UI. ...
CNIDog's user avatar
  • 479
3 votes
0 answers
156 views

Finding center point of opened QGIS application using PyQt

How can I find the center point of the opened QGIS application by means of PyQt? By center point I mean this red cross in the middle of my screen where I have opened QGIS, see the image below. I ...
Taras's user avatar
  • 32.8k
3 votes
2 answers
723 views

Counting seconds using QTimer in PyQGIS [closed]

I am having a hard time counting seconds in PyQGIS using QTimer. The current code waits for 1 second and prints 5 times "1" as output. I desire that after every second the output should be ...
Sajeel Zafar's user avatar
4 votes
0 answers
114 views

Restore default signals to QgsVectorLayer using PyQGIS

I have a connected a function to the QgsVectorLayer.selectionChanged signal of one of my layers. For the sake of simplicity let's assume it is a simple print statement: def print_confirmation(): ...
Matt's user avatar
  • 16.3k
2 votes
1 answer
331 views

Importing QtWidegets, uic from PyQt5 in an OSGeo python environment

In PyCharm I have a python environment setup with a Bat file so that I can use QGIS and OSGeo python environment in my scripts. I started looking into ui's and using this code from PyQt5 import ...
MrKingsley's user avatar
  • 1,443
0 votes
1 answer
490 views

Setting the alpha channel value of the colour of selected features using PyQGIS

I want to be able to set the value of the alpha channel of the selected features' colors in order to see what's under those features. This thread gives a good answer to set the color of the selected ...
swiss_knight's user avatar
  • 10.2k
3 votes
1 answer
373 views

Connect QgsMapLayerComboBox to QgsFieldComboBox and get text inputs

I've used the Plugin Builder tool to create the template python code. In QT Designer I have added a QgsMapLayerComboBox and QgsFieldComboBox I have gone through a couple of tutorials and checked the ...
GeorgeC's user avatar
  • 8,196
1 vote
1 answer
277 views

AttributeError converting Python function from SQLite DB to use geopackage in PyQGIS

I would like to change my functions in PyQGIS from SQLite databases to Geopackages. However, the SQL statements don't quite work as I had hoped. My table has the columns: task, completed, date With ...
Omegon's user avatar
  • 611
3 votes
1 answer
203 views

Docking QGIS Plugin

How to dock QGIS plugin window? I am trying self.iface.addDockWidget(Qt.RightDockWidgetArea, dlg) in run method of QGIS Plugin Implementation class, but the dialog keeps appearing as a floating ...
Kubson's user avatar
  • 602
1 vote
1 answer
379 views

Saving temporary vector layer after adding into group using PyQGIS

This code is not displaying any feature in QGIS , so I want to save the temporary layer so that the features can be visible. extract1 = processing.run("native:extractbylocation", { 'INPUT': ...
Satya Dalei's user avatar
3 votes
1 answer
981 views

PyQT progress bar freezing

I create a progress bar using the code below on the QGIS console. However, the bar freezes in the beginning, doesn't increase at all, and suddenly appears as 100% in the end. What could be the reason ...
Melanie's user avatar
  • 159
1 vote
0 answers
109 views

QGIS 3.x Python - Some VectorLayer signals not working?

I'm writing a plugin and was really hoping to get the featureAdded signal when the user is interacting with a VectorLayer object in the plugin, but I never see that signal. To try and figure out what'...
ArgentMage's user avatar
2 votes
1 answer
161 views

Making imports explicit in PyQGIS and PyQt

There is a QGIS plugin based on the PyQGIS/PyQt code with some imports defined in the beginning: from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from qgis.core ...
Taras's user avatar
  • 32.8k
1 vote
0 answers
60 views

Publishing QGIS Plugin without giving access to API keys that the plugin relies on

I am building a plugin that requires an API key that I would not like to be shared publicly. Is there anyway that I can do this? I am new to QGIS but I know you have to publish your code.
caro's user avatar
  • 11
1 vote
1 answer
209 views

Set QComboBox to disabled on form load based on feature attribute value

I am trying to display a QGIS 3 custom form combobox (QComboxBox) as disabled/greyed-out on initial form load based on an attribute value. The custom form was created with Qt Designer 5.15.2. I can ...
cm1's user avatar
  • 2,270
3 votes
1 answer
248 views

Error with PyScripter and QGIS 3.22, can't find DLL

Since using the new installer for the x64 only version OSGeo4W/QGIS (new 3.22 LTR), I can't no longer use PyScripter with the bundled PyQt5. When I try to import QSettings for example, PyScripter can'...
Andreas Müller's user avatar
0 votes
0 answers
744 views

How to populate QTableView/QTableWidget with attribute table of a layer using PyQIS?

I am developing a a plugin in QGIS. I want to add attribute table of a vector layer as data model in QTableView. I am using following lines of code but it is adding empty column. ...
vigna purohit's user avatar
3 votes
1 answer
743 views

How to show the attribute table inside the dialogue of a custom plugin with QGIS

I need to create a custom table attribute inside a plugin where I can choose which layer I need to open and add new custom buttons to this custom table attribute To become like this :
lackti's user avatar
  • 31
1 vote
0 answers
47 views

Accessing scene item list without crashing QGIS?

Temporary graphics items can be added to the canvas, e.g with. canvas = iface.mapCanvas() point = QgsPointXY(10, 55) vm = QgsVertexMarker(canvas) vm.setCenter(point) and can be removed by using iface....
mins's user avatar
  • 207
1 vote
1 answer
265 views

PyQGIS: Querying PostGIS Table

I am trying to run a query on a PostGIS table via PyQGIS (QGIS3.16-Hannover installed on an Ubuntu 20.04LTS Desktop). Everything works fine if I SELECT ALL FIELDS using the wildcard pattern (*) ...
HelpOverFlow's user avatar
0 votes
0 answers
1k views

Saving map in folder for further use

I want to use my map for further offline calculations. I used the below code referred from ' https://gis.stackexchange.com/questions/313382/click-event-on-maps-with-folium-and-information-retrieval/...
Mithra's user avatar
  • 1
0 votes
1 answer
91 views

In a QGIS plugin, how to let user click on canvas multiple times and store coordinates of all the points in a single list?

I am trying to get a list of coordinates for 3 different points in a single list. I am able to make a list of coordinates of a single point and then it overwrites the previous one while clicking to ...
vigna purohit's user avatar
3 votes
1 answer
2k views

Developing QGIS plugin: AttributeError: object has no attribute

I was tasked with making a small plugin for QGIS or add a small functionality to an existing one. What I am trying to do is take the "geocode with web service" from the plugin MMQGIS and add ...
qgisStruggler's user avatar
4 votes
1 answer
392 views

QgsFileWidget mandatory field in QWizard issue

I'm trying to create a mandatory QgsFileWidget in a QWizard form for a plugin but the result is a Next button that doesn't get active when I choose the path to save the project. Here is the snippet of ...
Marcelo Franco Patané Júnior's user avatar
2 votes
1 answer
125 views

Push button execution not returning any messages in the log

I need to work with some layers and provide output in the form of an Excel file. I have applied a push button in my QT tool design. I have also defined function which is supposed to work after I press ...
soumik chakraborty's user avatar
1 vote
0 answers
605 views

Convert .ui GUI file to python with QGIS Plugin Builder

I am using the QGIS plugin builder 3 with Qt Designer to create the GUI for my plugin. I've got a basic GUI done with QtDesigner and I need to dynamically populate a container in my GUI using python. ...
Ravindu's user avatar
  • 61
1 vote
1 answer
537 views

Using pyqtSignal in emitting signal for maptool in QGIS

For QGIS I have a plugin named GGAImporter: from .point_tool import PointTool class GGAImporter: ... def addFachdatum(self): self.mapTool = PointTool(self.iface.mapCanvas()) self....
Frau Schmidt's user avatar
  • 1,181
5 votes
1 answer
507 views

Getting point geometry by clicking at the map within QGIS plugin

From QGIS 3 Plugin Tutorial I need the example for getting a point geometry from clicking at the map. So I have a file point_tool.py: from qgis.gui import QgsMapTool, QgsMapToolEmitPoint from PyQt5....
Frau Schmidt's user avatar
  • 1,181
1 vote
1 answer
2k views

QTableWidget hoizontalHeaderItem is returning None

I am developing a tool is Qgis3 using PyQt5. I am adding columns using a button and the setting column names using 'setHorizontalHeaderItem'. But it gives None while trying to read it. Following is ...
vigna purohit's user avatar
1 vote
1 answer
330 views

Displaying QgsMessageBar from plugin

As suggested in docs, the QGIS message bar is usually the best option to show short messages communicating with the user. Is it possible to show the QGIS message bar inside a plugin's GUI developed ...
Arthur's user avatar
  • 69
1 vote
0 answers
745 views

PyCharm with pytest run configuration fail importerror PyQt5 with pipenv

I have difficulties setting up PyCharm to run my tests correctly while using a pipenv interpreter if i run my tests through a terminal with pipenv run pytest it works perfectly because it loads the ....
Kalak's user avatar
  • 3,703
1 vote
0 answers
779 views

Folium map not updating when adding Tooltip attribute in PyQt GUI

I am trying to create a geospatial Python GUI app using PyQT5, Geopandas, OSMnX, and Folium. I am converting the app into an .EXE file using pyinstaller. The app looks something like this: I am using ...
Magnum Python 93''s user avatar