Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
1
vote
1answer
31 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
1answer
42 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.
2
votes
1answer
52 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 ...
0
votes
0answers
38 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....
1
vote
1answer
177 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 ...
2
votes
1answer
57 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 ...
1
vote
0answers
42 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 ...
4
votes
1answer
147 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') ...
0
votes
1answer
30 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. ...
0
votes
1answer
44 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 ...
0
votes
0answers
43 views

``Qt: QUndoStack::endMacro(): no matching beginMacro()`` error on PyQGIS script

I am working on a QGIS plugin that allows redrawing a selected feature without losing its original attributes. The plugin works properly and the process ends well but I am receiving a QT error that I ...
2
votes
1answer
143 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 ...
0
votes
0answers
22 views

How to make an instance of a GUI every time when click button

I create a custom plugin in QGIS 2 with Qt Designer. When I press button of the plugin I want to open a dialog with a table that has loaded data from the db. The problem is that I am confused on how ...
4
votes
1answer
5k 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....
2
votes
1answer
152 views

Image Adding Problem to QGIS Plugin GUI with Qt Designer

I'm using QGIS 3.1 and I created a plugin. Finally, I want to add a image(.png) to my plugin's GUI with Qt Designer. But when I add it, QGIS gives an error when it opens and my plugin does not work. ...
0
votes
0answers
30 views

QDockWidget losing its objectName after getting added to QGIS Interface in custom Plugin

I'm creating a custom QGIS (3.10) plugin, using Python 3, PyQt5 and PyQGIS. I'm facing an issue when adding a QDockWidget to QGIS Interface using iface.addDockWidget() functionality. Consider this ...
0
votes
0answers
22 views

Adding tile xyz layer via PyQt + QGIS?

I am trying to visualize the trajectory, but the online Tianditu map cannot be loaded. I'm using QGIS 3.14.16-Pi, Python3.7. def remoteAction(self): urlwithparams = 'https://t0.tianditu.gov.cn/...
1
vote
0answers
34 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 ...
3
votes
2answers
199 views

Converting PyQt5.QtCore.QVariant to string

I am using QGIS with the in-built Python console. I want to replace some values in a shapefile with some other values. But when I try to change the attribute values, I get an error about the data ...
0
votes
0answers
35 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
1answer
163 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'...
0
votes
0answers
356 views

How to Open QFileDialog In QGIS 3 plugin?

i tried to open file dialog with Qgis Plugin its through argument 1 has unexpected type Error here My code # -*- coding: utf-8 -*- """ /**************************************************...
0
votes
1answer
62 views

Use plugin code in QGIS python script

I would like to write a Python script in QGIS and would like to use functions from a plugin. For example, QuickOSM plugin has an import function and an "Open" button, that creates a ...
1
vote
0answers
58 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 ...
2
votes
1answer
175 views

How can I launch a QWidget after pressing a submenu (QAction) in QGis3.4?

I need your help I am developing a dialog box (which I will call toolraster) in QGis to interact with raster layers. I want it to display when I click on a menu I insert in the QGis interface. I ...
0
votes
1answer
75 views

Creating QGIS Shapefile in PyCharm leaving some attributes NULL

I've created the shapefile and can manually enter in all the attributes to come in fine, but when I call it any other way (which I will need to do), the values for the floating types appear as NULL, ...
1
vote
0answers
60 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?
3
votes
1answer
143 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
1k 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
87 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
232 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
62 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
742 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
83 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
4k 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 ...
4
votes
2answers
7k 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
292 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
237 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
101 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
341 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 ...
3
votes
1answer
392 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
219 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
3k 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
179 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 ...
2
votes
0answers
134 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
70 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 ...
3
votes
1answer
70 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
292 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
86 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
2 3 4 5