Questions tagged [pyqt5]

Python bindings for Qt5

Filter by
Sorted by
Tagged with
1 vote
0 answers
13 views

Call a button after creating with emit class python, pyqt, pyside2

How can I call a created button with emit because always when the new button is creating the old one will be delete automatic. for anim in self.online_friend: button_counter += 1 ...
user avatar
0 votes
0 answers
17 views

Using QgsAuthConfigSelect when connecting to PostgreSQL

How to use QgsAuthConfigSelect when connecting to database PostgreSQL using Python language in environment QGIS?
user avatar
1 vote
0 answers
32 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'...
user avatar
1 vote
0 answers
30 views

Extract value from raster layer according circular buffer from vector layer ,Anaconda

I have 2 layers raster and vector , vector is have one value coordinate , i try to read it and create buffer of 5 km , i did it and save the new buffer as polygon .shp file format, but the problem is ...
user avatar
0 votes
0 answers
33 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 ...
user avatar
  • 23k
1 vote
0 answers
28 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.
user avatar
  • 11
1 vote
0 answers
27 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 ...
user avatar
  • 1,981
3 votes
0 answers
56 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'...
user avatar
0 votes
0 answers
69 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. ...
user avatar
2 votes
1 answer
93 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 :
user avatar
  • 21
0 votes
0 answers
17 views

Failed to build QGIS from source. PyQt5

During the configuration, I got: ModuleNotFoundError: No module named 'PyQt5.Qsci' When I tried to build QGis, I got: [ 76%] Updating appinfo files... cd ....../QGIS && /usr/bin/python3.8 .......
user avatar
  • 101
1 vote
0 answers
33 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....
user avatar
  • 141
1 vote
1 answer
51 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 (*) ...
user avatar
0 votes
0 answers
127 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/...
user avatar
  • 1
0 votes
1 answer
36 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 ...
user avatar
3 votes
1 answer
271 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 ...
user avatar
4 votes
1 answer
88 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 ...
user avatar
2 votes
1 answer
37 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 ...
user avatar
1 vote
0 answers
124 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. ...
user avatar
  • 51
1 vote
1 answer
72 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....
user avatar
  • 1,186
3 votes
1 answer
94 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....
user avatar
  • 1,186
1 vote
1 answer
266 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 ...
user avatar
1 vote
1 answer
53 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 ...
user avatar
  • 69
1 vote
0 answers
326 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 ....
user avatar
1 vote
0 answers
220 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 ...
user avatar
0 votes
0 answers
66 views

Pause the folium timestampedgeojson plugin using a PyQt button

We can play the timestampedgeojson plugin over the folium map using a PyQt button but how can we pause the folium timestampedgeojson plugin using a PyQt button in PyQt GUI and without using the plugin ...
user avatar
  • 1
3 votes
1 answer
106 views

Efficient filtering of many options in QGIS Plugin

Using PyQGIS, I am developing a QGIS plugin that includes a filter function. It should make handling easier for users (internal) who rarely use QGIS. Now I have created a interface with the QT ...
user avatar
2 votes
1 answer
217 views

Dynamic parameters in Qt Designer

Started building my first plugin in qgis and looking for a way to create dynamic widget in pyqyt and Qt designer which allow user to add or delete parameters as much as he want (something like a '+' ...
user avatar
0 votes
0 answers
37 views

QGIS - win32api

I would like to send a docx file to a printer. So, with the win32api, "normally" it should works (QGIS 3.10). In a python plugin, i try to import the win32api import win32api ImportError: ...
user avatar
  • 463
6 votes
1 answer
130 views

GIF freezes when QGIS plugin runs

I have a QGIS plugin and would like to put loading GIF (spinner) somewhere in the Dialog Window. The problem is when I run the spinner with the following code and call next function, the spinner ...
user avatar
0 votes
1 answer
58 views

Open a new map view with PyQGIS [closed]

I'd like to use PyQGIS to open a new map view with its own map canvas & coordinate system. This seems like a very basic questions but I can't find any information about it! I suppose I can somehow ...
user avatar
  • 486
0 votes
0 answers
37 views

Rewriting QgsProcessingAlgorithm methods

I'm building Processing Provider plugin. As I understand, clicking on the "Run" button of the plugin leads to launching "run" method of the QgsProcessingAlgorithm. I don't want to ...
user avatar
1 vote
1 answer
46 views

qgis.pyQt5 button role returns different values on definition and button activation

The Goal is to implement 3 Buttons in pyQt5. The returned Values differ from the defined roles values. The returned values seem to depend on the order, the buttons are added. What is happening here? ...
user avatar
1 vote
1 answer
127 views

How to Access QSettings() of QGIS from outside QGIS Console

How can we access all the keys under QSettings() of QGIS 3.4 and above? Requirement is such that we need to set some QSettings() keys for smooth working of developed Plugins from outside of QGIS. But ...
user avatar
0 votes
0 answers
27 views

Use Qt modules in PyQGIS

I'm creating a PyQGIS standalone app that contains some charts. In PyQGIS I'm able to use the PyQt qtCharts module, but when using the PyQt that comes with QGIS I can't import qcharts module and even ...
user avatar
2 votes
0 answers
98 views

QGIS custom form : mixing Qt Widgets and QtQuick QML Widgets

On QGIS 3.16 I am trying to create a custom form with some Python logic for feature navigation and a QML widget to display nicely images. I embedded my QtQuick QML file in the custom form python file ...
user avatar
  • 83
1 vote
1 answer
114 views

Hiding specific layer using QCheckBox widget (PyQt5/PyQGIS)

I have a custom PyQGIS application that loads weather data on a basemap. Upon selecting an analysis type, the application loads a raster layer containing a colormap and two vector layers that contain ...
user avatar
0 votes
1 answer
77 views

Zooming to feature selected from QListWidget using PyQGIS

I have displayed in a QListWidget several features ranked according to their values from a field named "CODE". Based on this list I would like to select a feature and after a click on a ...
user avatar
  • 1,439
3 votes
1 answer
138 views

Export theme and its associated layers in xml file in PyQGIS

I was trying to export all themes and its corresponding layers information through PyQGIS so that xml can be read later .There is method in Class: QgsMapThemeCollection, writeXml(self, doc: ...
user avatar
3 votes
1 answer
399 views

Create a video from a track (GPX / KML) using Google Street View images

I am trying to create a video from a track in GPX or KML format from Google Street view images. If I enter the data of the coordinates of a location, I can generate a JPG with that image. My problem ...
user avatar
  • 622
2 votes
1 answer
97 views

PyQGIS 3: How can pie charts have a fixed size when automating the process?

I'm unsure how to automate the process for PyQGIS to update the pie charts to a fixed size of 12. The approach I used is not working out and no pie charts are being created. lyr = iface.activeLayer() ...
user avatar
1 vote
0 answers
115 views

QTextTable Insert a Line in a Cell [closed]

I'm trying to put a line in the header of a QTextTable. I have tried four ways to do it: Option 1 - I have used the option to modify the background color of the cell. The problem is, I can't narrow ...
user avatar
  • 622
2 votes
0 answers
507 views

How to keep PyQt GUI alive while doing heavy calculation and updating Progress bar and logger

I have a GUI designed with PyQt, this GUI has a progress bar and a logger. when the user clicks the Run button the GUI/QGIS will become "No responding" the actions normally take 45minutes to ...
user avatar
4 votes
1 answer
168 views

Emitting signal when project property is changed using PyQGIS

QGIS API provides QgsExpressionContextUtils to set project properties. But in the class, there isn't any signal. I hope to connect to a signal whenever some of the properties were changed. So is there ...
user avatar
  • 417
4 votes
2 answers
236 views

Showing dialog box even though QGIS is freezing

I have a long script in PyQGIS that contains three processing tasks after another. I want to display a pop up box (like "QProgressDialog"-Box) for each task when it is finished. Example: ...
user avatar
  • 286
7 votes
2 answers
1k views

NameError: name 'QMessageBox' is not defined

When I'm loading a CSV into QGIS, I get this error code, see below. Does anyone know what this means? This also is an issue when I attempt to run NNJoin Plugin too. An error has occurred while ...
user avatar
1 vote
0 answers
67 views

Make sure only one PyQt window is shown

I am developing a plugin for QGIS 3.10. In part of my plugin, I have a UI using PyQt. This form needs to be a singleton. But when I have click several times on the plugin it generates several forms ...
user avatar
2 votes
1 answer
67 views

Selecting file in Plugin

I want the toolbox to prompt out a file select window so that user can select the file and get the path to be used in my Plugin. Where do I start to code since I just have: def run(self): "&...
user avatar
1 vote
0 answers
40 views

Overlaying points on map in PyQGIS [closed]

I have added google map with PyQt5 and PyQGIS and I want to overlay points and images on map(specifically in python code) but I don't know how to do that. I am using PyQt5 and QGIS3.
user avatar
  • 11
5 votes
1 answer
246 views

How to put QgsCheckableComboBox() into standby

I'm trying QgsCheckableComboBox() in my simple python script in QGIS. How to pause code execution while a comboBox-window is open (like a dialog box)? In my example, I want to ensure that the print() ...
user avatar