Questions tagged [pyqt]
PyQt provides bindings for Qt 2 and Qt 3.
58
questions with no upvoted or accepted answers
6
votes
0
answers
2k
views
Connect to QGIS 2.6 Python Plugin function via button on custom feature form
I am trying to connect to a QGIS 2.6 Python plugin function via a custom feature form button.
On my feature form, I'm attempting to do a few things :
enable the updateButton only if the ...
5
votes
1
answer
500
views
QGIS Python Plugin - Prevent Dialog From Closing Immediately after OK Clicked
I've generated a QGIS plugin using the QGIS Plugin Builder v3.0.3. One issue I am encountering with it is - as soon as I click the "OK" button (that invokes the run method) - the dialog closes. Is ...
4
votes
0
answers
3k
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 ...
4
votes
0
answers
589
views
Why PyQt http request works in QGIS console, but not in a plugin?
I want to send http request in a QGIS plugin using PyQt.
I found in this post working syntaxes to do so, but something odd occurs.
The script given in the question works both in the console and in my ...
4
votes
0
answers
83
views
QGIS plugin window qt creator formatting is ineffective
I am developing a QGIS plugin. I have assigned the QGIS main window as the parent window of custom plugin using:
QtGui.QDialog.__init__(self, iface.mainWindow())
But after doing so the problem is ...
3
votes
0
answers
173
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
...
3
votes
0
answers
1k
views
Canceling task currently running in background using PyQGis?
I am trying to close QgsProject on loading layer (if password and username from QgSProject - datasource are incorrect) before QgsCredentialDialog is shown.
on signal :
QgsProject.instance()....
3
votes
0
answers
160
views
QGIS Build error : zzz-db_manager-5-depend error - qgis master 2.99
I am compiling QGIS from master in VS 2015 on x64.
I am getting error as :
Error MSB6006 "cmd.exe" exited with code 1. zzz-db_manager-5-depend 7 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\...
3
votes
0
answers
176
views
Generating pdf documents with geometries and raster using python
I'm looking for a way to generate PDF document containing:
1. Text in specified position
2. Raster file with border
3. Geometries overlaying raster.
Basically it should look like this
Geometries ...
3
votes
0
answers
565
views
QGIS QgsAttributeTableModel only loads when called without a function in Python
I tried to load QgsAttributeTableModel into QgsAttributeTableView or a plain Qt QTableView but it could run from inside a class method or function but it runs without any function or method. Below is ...
3
votes
0
answers
607
views
Cannot run QGIS algorithm with python script without interface
I'm trying to run the QGIS 'intersection' algorithm from a Python script:
(Working with Ubuntu)
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
from qgis.core import *
from PyQt4.QtGui ...
2
votes
0
answers
111
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
0
answers
202
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
0
answers
193
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"
...
2
votes
0
answers
807
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:
...
2
votes
0
answers
77
views
QGIS map tile not printing some given extent in one time why?
I made a plugin in QGIS using pyqgis and qt designer to plot OSM tile in which I have one button which connects me to function in which I wrote a program to plot raster layer using param and I am ...
2
votes
0
answers
40
views
How to get display of individual polygons from vector shapefile?
I am creating a shapefile with adding 20 polgons to it.
poly = ogr.Geometry(ogr.wkbPolygon)
for p in range(20):#20 should be replaced by pix_no
ridx = rind1[p]
...
2
votes
0
answers
403
views
QGIS Python plugin crashes when using processing algorithms and QThread
I'm developing a QGIS plugin which calls several processing algorithms. I call them in a pipeline where the input layer of each algo is the output of the previous one. The pipeline is called on each ...
2
votes
0
answers
70
views
Using graphical modeler script via command line
I have made a script through the graphical modeler and I exported it. This is the code that it exported:
[Python code] https://imgur.com/a/ivgWXUh
How do I run this code outside of QGIS? Which ...
2
votes
0
answers
192
views
Simple user input in QGIS with pyqt plugin
SplitPolygon plugin allows the user to enter an angle by which the polygon(s) will be split. I would like to modify the plugin and take that value from graphical user input (say, parallel with one ...
2
votes
0
answers
573
views
QTableWidget Resize with Dialogue Python QGIS
I am developing python qgis plugin with QTableWidget inside a tabWidget. How can i set my QTableWidget size and QTabwidget with the Dialogue box. So that when someone expand the dialogue box of the ...
2
votes
0
answers
117
views
Create new Mapset with Python
I've tried to create a new Mapset/Location with Python for hours but I can't figure out how it works.
The problem is that I can't use GRASS.SCRIPT because it already needs an existing Mapset and ...
2
votes
0
answers
113
views
Finish inserting new line-feature (PyQgis + GUI)?
I'm writing a small graphical plugin where users should be able to add new (multi-)line features to an existing layer.
This is what I've already done:
I have two buttons, one to trigger the insert, ...
2
votes
0
answers
263
views
QGIS MapCanvas with Round Border
I have a canvas within a QWidget (also tried QFrame) which uses a stylesheet:
border: 2px solid black;
border-radius: 10px;
The stylesheet looks great in the designer, but as soon as I put the ...
2
votes
0
answers
2k
views
How to open a second window in QGIS plugin from a button inside the main window
If I already created a qgis plugin, and i need to create a button inside that plugin that opens a new window, how is that possible? Qt creator won't add a slot unless there are a header file. I looked ...
2
votes
0
answers
307
views
Restarting plugin from PyQGIS
I'm writing a plugin for QGIS and inside the method def run(self), after the OK button of the plugin is clicked, i.e., inside
# Run the dialog event loop
result = self.dlg.exec_()
# See if OK was ...
2
votes
0
answers
265
views
Is it possible to sync multiple radio buttons on a QGIS 2.0 custom feature form?
Is it possible to sync multiple radio buttons on a QGIS 2.0 custom feature form to one attribute? For example i have three choices (owner, renter, and other) and choosing the radio button would fill ...
2
votes
0
answers
751
views
PyQGIS Dialog Plugin not resetting
I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution
1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0
answers
364
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
0
answers
202
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
0
answers
114
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
0
answers
167
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
0
answers
762
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
0
answers
420
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
0
answers
141
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
0
answers
114
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
0
answers
279
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
0
answers
140
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
0
answers
51
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
0
answers
2k
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
0
answers
46
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 ...
1
vote
0
answers
893
views
Writing standalone python script that opens canvas with map tools in QGIS?
I'm trying to write a stand alone script that will open a canvas with map tools and zoom to a lat/long with raster images. I'm starting by trying to run the script here http://docs.qgis.org/testing/en/...
1
vote
0
answers
157
views
How to load a style from postgres on a sub request in PyQt
In a qgis-processing script, I'm loading sub-requested layers with x, y, radius to have less data in qgis-desktop. The data is well loaded but I can't apply styles stored in postgresql layer_styles ...
1
vote
0
answers
175
views
Unable to compile plugin (pyqt) for Qgis
I have installed the
latest version of Qgis (2.18.0, 64 bit) using the OSGeo4W network
installer from the download page of Qgis.
QT 5.7.0 (64 bit) available at
https://www.qt.io/download-open-...
1
vote
0
answers
2k
views
Pyintaller cannot find pyqt4 plugin directories for a PyQGis program
I have a PyQt application that I am trying to compile into one exe using PyInstaller 3.1. It does compile into an exe, however, the GUI doesn't show up upon launch (clicking the exe). One of the ...
1
vote
0
answers
318
views
Create new layer and populate attribute table from QtWidget PyQGIS
in my QGIS plugin, one of the dialog has a QtWidget table where the user can add items to the columns.
Each column of the table is a single list and the final result is a dictionary where the keys ...
1
vote
0
answers
218
views
Cannot import name QtTest running unittests for QGIS plugin
I have the following imports in my unittest code:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import QtCore, QtGui, QtTest
When I run my unit test from the command line I get the ...
1
vote
0
answers
1k
views
Is it possible to remove the QGIS icon from dialogs windows using pyqt?
I am developing a QGIS plugin using PyQt 4.x and the QGIS API. The plugin uses several dialog windows (QDialog Class). Some of them (I don't know why some do and others don't) show the Qgis icon on ...
1
vote
0
answers
2k
views
How to integrate QT User Interface with QGIS Python Plugin?
I created a very simple python program using GDAL to calculate the summary and reduction between two raster value like this :
import os
from osgeo import ogr, gdal
from gdalconst import *
...
1
vote
0
answers
1k
views
Custom QGIS 2.6 map tool - mouse click and release issue
I have create a custom map tool for QGIS 2.6, implementing a canvasReleaseEvent and canvasPressEvent. I can't though get the signals to work on one single mouseclick (I have to click twice).
My map ...