Skip to main content

Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

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

How to disable fullscreen mode for pyQGIS/PyQt plugin dialog

With my PyQGIS plugin (built using Plugin Builder 3), whenever I drag the main dialog (built using PyQt) to the top of the screen, it automatically goes into full screen mode and takes up the entire ...
oliver's user avatar
  • 83
0 votes
0 answers
141 views

'ImportError: No module named resources_rc' while adding image in custom plugin using Qt designer

I am trying to add an image in the UI file of my custom plugin which will be used in QGIS. But I am facing this error: ImportError: No module named resources_rc Could anyone tell me how to add an ...
BenStone's user avatar
  • 333
6 votes
2 answers
200 views

What is QDomNode and QDomDocument in terms of PyQGIS?

On a low level what is QDomNode and QDomDocument in the PyQGIS context? I comprehend that both QDomNode and QDomDocument are derived from PyQt. Hence, with my limited knowledge of PyQt, I simply do ...
Taras's user avatar
  • 33k
0 votes
1 answer
56 views

QGIS Processing Algorithms Fail After Second Execution with "Algorithm not found" Error

I'm encountering a persistent issue in my QGIS environment where Processing Algorithms fail to run after the second execution, consistently showing an "Algorithm not found" error. This ...
Simon's user avatar
  • 89
0 votes
0 answers
146 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
2 votes
1 answer
166 views

AttributeError: 'QgsFieldComboBox' object has no attribute 'setPlaceholderText'

I have a QGIS action to copy field name to clipboard and display a message to the user when copied. I manage to get the field name but when I try to use QComboBox function setPlaceholderText() to ...
dmjf08's user avatar
  • 1,273
0 votes
2 answers
42 views

QtPy Running a process looping through features

I'm writing an iterator to run a processing on an individual feature of a layer. In this example: gray region included green bordered cells and black points. I want to run a processing 'count points ...
Adam Korejwo's user avatar
1 vote
2 answers
131 views

Where in QGIS Plugin code should I set the QgsFileWidget to GetDirectory?

I have a QgsFileWidget in my dialog that enables the choosing of a file. I need to set it to choose a folder instead. I understand that I need to use something like: self.dlg.outputFilePathChooser....
TuftyPuff's user avatar
0 votes
1 answer
105 views

Bringing to front QGIS plugin dialog with toolbar icon click

Is there a way to bring the already opened QGIS plugin dialog that I wrote to the front with a click on the icon in the QGIS toolbar? By default, it only opens on click, and to bring it to the front I ...
Ivan Marjanović's user avatar
2 votes
2 answers
272 views

Create always open dialog after layer configurations are set in a PyQGIS plugin

I'm creating a small plugin, where you can copy-paste values from one layer to the other by selecting relevant features in both layer (see here : QGIS: PlugIn for semiautomating copying attribute ...
i.i.k.'s user avatar
  • 1,575
1 vote
0 answers
37 views

Navigate to next group of features in QGIS form view of attribute table [closed]

I'm using QGIS to visually interpret land dynamics over sample locations. Samples are spatially clustered and in many cases all samples of a cluster share the same dynamic and can be edited all at ...
Loïc Dutrieux's user avatar
4 votes
1 answer
138 views

PyQGIS Contour Labelling

I have generated contours using gdal:contour in a pyqgis plugin but am unable to add labels to them. This is the code that I have been trying to get working, but obviously doing something wrong. ...
nospec's user avatar
  • 171
3 votes
1 answer
249 views

Setting the output type using QFileDialog.getSaveFileName

I am trying to set my output parameters in a script for Qgis using QFileDialog This is the code that I am using parent=iface.mainWindow() outputFn, outfnOK = QFileDialog.getSaveFileName(parent, ...
geotyr's user avatar
  • 426
5 votes
1 answer
153 views

Connecting signals to different functions based on combobox selection

I'm working on a Qgis plugin (using QT Designer). The goal of the plugin is, depending on the combobox, clicking on a button will launch different functions. For example, choosing "Images - WMS&...
emanas's user avatar
  • 113
0 votes
1 answer
84 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
1 answer
116 views

Install and run GDBee file geodatabase SQL tool

GDBee is a Python tool for querying file geodatabases using SQL (outside of ArcGIS): https://github.com/AlexArcPy/GDBee I want to install and run GDBee in Windows 10 (64-bit). As a novice, here's what ...
User1974's user avatar
  • 1,132
0 votes
1 answer
332 views

QThread crashes QGIS

I'm trying to use a QThread for CSV export that can freeze my UI. Therefore I have a polyvalent Thread class below : class Thread(QThread): finished = pyqtSignal() def __init__(self, fn, *...
dmjf08's user avatar
  • 1,273
2 votes
1 answer
163 views

How to display the attribute value in an information window?

The following code is used to test if a selected object from layer A is inside an object from another layer B. Depending on the result, a window is displayed and indicates the answer. The object ...
fcka's user avatar
  • 919
3 votes
1 answer
294 views

Accessing custom Toolbar using PyQGIS

I created a toolbar in a plugin with: toolbar = iface.addToolBar("new Toolbar") I know I can toggle visibility of this toolbar with: toolbar.setVisible(False) and toolbar.setVisible(True) ...
fsg's user avatar
  • 682
0 votes
1 answer
114 views

How to retrive field name from selected field in QgsFieldComboBox

I want to read the field name as string format from a QgsFieldComboBox. How to read? I tried like following but not working for some comparison. selectedField = self.dlg.QgsFieldcomboBox.currentField
raaj's user avatar
  • 37
2 votes
1 answer
216 views

Shapefile (vector layer) for particular selected features in PyQGIS

I want to create a new shapefile (vector layer) from selected features. I select one feature then save that feature to a new shapefile. When I use following code, I got a new shapefile but it's blank (...
raaj's user avatar
  • 37
0 votes
1 answer
527 views

How to use QgsFieldComboBox in building QGIS plugin

I am developing a plugin in QGIS which involves the use of QgsFieldComboBox, what I want to do is that the combo box only shows fields(column names from attribute table), and from this ...
raaj's user avatar
  • 37
3 votes
0 answers
266 views

Bringing PyQGIS and PyQt into already settled Anaconda Python environment in PyCharm

I have Anaconda Python environment with different packages required for developing a QGIS plugin (including the Plugin Builder Tool etc.). (qgsdata) C:\TempDaten\_dev\QgsData>conda info ...
Taras's user avatar
  • 33k
1 vote
2 answers
401 views

PyQGIS Problems Update to 3.24.3 with Qt Library 5.15.3

I update QGis to 3.24.3, with this new version, QGIS update Qt library to 5.15.3. Now when I run my PyQgis App, I have this error: Cannot mix incompatible Qt library (5.15.3) with this library (5.15....
RBenet's user avatar
  • 780
6 votes
1 answer
647 views

Running function from double click with PyQGIS

How can a double-click in the QGIS canvas be used to run a function in PyQGIS? For example, I want to access the name of each feature I'm selecting with a double-click. Code sample to access the ...
wanderzen's user avatar
  • 2,140
3 votes
1 answer
221 views

Get M-value from shapefile by mouse click on canvas

I am new to QGIS plugin scripting (3.16 Hannover) (in Python 3.7). I have lots of different layers in my layers panel and I want to be able to click on a button on my GUI, which then activates a ...
KevinCasipillai's user avatar
1 vote
1 answer
99 views

QgsAttributeTableView shows nothing in my QGIS plugin

I have created a plugin using the Plugin Builder plugin, and I tried to adapt it to show a QgsAttributeTable (by following this example). I get absolutely no errors or warnings, but it simply shows an ...
Mads Skjern's user avatar
0 votes
0 answers
120 views

PyQGIS plugin, disable Qt dial at start, from outside __init__ function?

I know I can disable the dial widget from the main function that loads the Qt dialog form with self.dial_name.setEnabled(False) but don't want to modify the function, to keep all modifications ...
S.E.'s user avatar
  • 336
1 vote
1 answer
147 views

Placing plugin or action in submenu using PyQGIS or PyQT

I am trying to place a plugin into a submenu of "Vector". In this case "Geoprocessing Tools". When I use: iface.addPluginToVectorMenu('Geoprocessing Tools',action) or: iface....
JAS's user avatar
  • 485
4 votes
1 answer
160 views

Change Qt dial size in .ui file, PyQGIS plugin

The main dialog in the plugin is entirely defined by an .ui file. No css stylesheet yet, nor processing (except for some values, not to define the controls). I need a 2nd dial but its function is ...
S.E.'s user avatar
  • 336
3 votes
1 answer
1k views

Display a progressBar and use the execution time of several functions in QGIS plugin

I developed a plugin under QGIS and I added a progressBar using QT Designer. Using a pushButton, I execute several functions directly in the __init__(self, iface) function. What I want to do is to ...
nmokht97's user avatar
  • 143
0 votes
0 answers
458 views

PyQt SpinBox value is always returning value of 0 / SpinBox not recognized

I'm creating a plugin in which I use spinboxes. The value set by the user on the spinboxes is meant to define precision in which the result will be printed. Even though my spinbox has different values ...
Bartosz Łęczycki's user avatar
3 votes
2 answers
3k views

Looking for manual on how to properly setup standalone PyQGIS without GUI

My goal is to create a standalone PyQGIS script that is able to run QgsProcessingAlgorithm scripts without GUI. My setup runs on Windows and my IDE of choice is VS Code. I've followed the Windows ...
Mar Tijn's user avatar
  • 503
6 votes
1 answer
2k views

Disabling automatic selection in QgsMapLayerComboBox

I build a plugin. It has a lot of comboboxes (QgsMapLayerComboBox). They are all empty when no project is loaded. When I open a project in QGIS, a layer is automatically shown in all comboboxes. All ...
Kadir Şahbaz's user avatar
4 votes
1 answer
333 views

Collapsing legend in ToC via PyQGIS

I am creating QGIS simple plugin which adds and set styles. It works like a charm, however i want to collapse all legends(categories) from styles in given layer i tried layer....
vealen's user avatar
  • 113
6 votes
1 answer
3k views

Capturing CTRL+Key In KeyPressEvent in PyQGIS QgsMaptool

I created a Line with help of QgsMapTool and I'm able to capture the single key in keyPressEvent like this: class buildingEditTool(QgsMapToolEdit): def keyPressEvent(self, event): ...
Velugoti Venkateswarlu's user avatar
3 votes
1 answer
843 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 '+' ...
GallPeters's user avatar
2 votes
2 answers
642 views

QGIS' pyrcc5 gives error on macos Catalina

When trying to build a QGIS plugin with Plugin Builder 3, I get the message that pyrcc5 was not found in my path. I installed PyQt using brew install pyqt, but still nothing. Instead, I tried to run ...
Christian's user avatar
  • 131
2 votes
1 answer
491 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 ...
Eversa's user avatar
  • 21
2 votes
1 answer
2k views

PyQT plugin window is always smaller than when run in QGIS

I'm making this plugin and it's big as seen in the screenshot below However, when I open it in QGIS, it's small and it's troublesome to keep adjusting the size.
BallpenMan's user avatar
  • 1,217
2 votes
1 answer
941 views

Enabling/Disabling layer feature selection in QGIS

I have been looking for a QGIS toggle to disable layers' feature selection like in ArcMap/MapInfo. Found Setting layer as unselectable to avoid identifying features in multiple layers using QGIS but ...
Pavel Pereverzev's user avatar
1 vote
0 answers
406 views

PyQt Push Button randomly stops working in PyQGIS plugin

I keep running into a very weird issue with clicked.connect not working in various plugins I am working on. The error happens randomly in QGIS 3.x versions and it seems to happen on some machines only....
BritishSteel's user avatar
  • 6,647
3 votes
2 answers
932 views

Opening Plugin with another Plugin

I would like to open a Plugin with the help of another Plugin. Is it possible, if I want to switch the workflow of different plugins one after the other, that when I click the submit button of one ...
Moritz Sproll's user avatar
4 votes
1 answer
251 views

QgsVectorLayer creation in Qthread (PyQt)

Our QGIS project is dynamically generated on startup based on user roles. There are nearly 120 QgsVectorLayers that need to be generated. If created sequentially, the login process takes up to 2 ...
TheGrudge's user avatar
  • 423
1 vote
0 answers
185 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 ...
Raúl Casado's user avatar
  • 1,069
4 votes
1 answer
4k views

Error "No module named PyQt5.QtCore" in QGIS standalone application

import os, sys sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\python') sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\bin') sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37') ...
Moritz Sproll's user avatar
0 votes
1 answer
233 views

QgsNetworkReplyContent.content() empty after HTTP error

I have a custom Flask backend and a QGIS plugin as client. I make a request with the QgsNetworkAccessmanager with blockingPost() to an endpoint which returns a JSON response on either HTTP status. ...
nilsnolde's user avatar
  • 487
0 votes
1 answer
306 views

How to create custom shortcut to set visibility in QGIS with PyQT?

I have been trying to make custom shortcut to set visibility to given layer. For example, I have two layers I work on LAYER_1 however I use LAYER_2 as reference, but sometimes I need to hide LAYER_2 ...
vealen's user avatar
  • 113
2 votes
1 answer
3k views

Using PyQt in PyQGIS inside QGIS 3.16

This code Using PyQt5 extracted from http://www.tutorialspoint.com does not work when I add it in a script in the console of QGIS 3.16. Can you enlighten me on this subject? import sys from PyQt5 ...
M. Labriki's user avatar
6 votes
1 answer
8k views

Making a Feature Form for a standalone PyQGIS application as in QGIS

In QGIS, there is a method named openFeatureForm defined in QgisInterface class. It opens a form that shows value of attributes for a given feature. layer = iface.activeLayer() feature = layer....
Kadir Şahbaz's user avatar

1
2 3 4 5 6