Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
1
vote
1answer
335 views

pyQt open dialog error

Python Version 3 - Qgis 2.14 1 / what's wrong ? Lot's of solutions are exposed in differents forum but any work for me. I need to get path to save documents later and i had this error : ...
2
votes
1answer
460 views

How to get a group layer delete signal in QGIS

I'm developing a plugin into QGIS 2.18. I need to catch if the user deletes a group layer. I tried the signal layerWillBeRemoved from QgsMapLayerRegistry class but it sends only layers not group layer....
1
vote
1answer
520 views

Reading values from dynamically created Qlineedit boxes using PyQGIS?

I am creating dynamic labels and line edit boxes based on the number of fields in the shapefile and populating the lineedit boxes using the feature attributes using the below code. Each lineedit box ...
3
votes
3answers
1k views

PyQt - default option don't close dialog [closed]

I have a plugins generated by "plugins builder" with simple Ok / Cancel button / combo box to display canvas layers. When i cick on "OK" button, plugins is not close and if i use it again, my ...
3
votes
1answer
215 views

How to silence QGIS 3 nightly build's debug output with PyQGIS?

When I run the following file sample.py it prints more than 100 lines of debug output. When porting a PyQGIS script to QGIS 3 it is hard to find the expected log statements in between all debug ...
2
votes
2answers
723 views

PyQt - merge selected features function

VERSION QGIS 2.1x i realize plugins to do this actions without use toolbar: copy features / paste to layer / merge selected features => define attribute to use in merge. So, all is okay but i don't ...
1
vote
1answer
477 views

How to navigate through a vectorgrid with arrow keys in QGIS

I have a written a python-script below which creates a vector grid based on the resolution of a .tif image (satellite imagery). import processing layer = iface.activeLayer() #define parameters for ...
1
vote
1answer
2k views

QGIS 2.99 “qgis._core import error: DLL load failed”

I am trying to run a standalone application. However, it does not run the program because of mentioned error in title. Here is my code: from qgis.core import * from qgis.gui import * from qgis.utils ...
1
vote
1answer
221 views

Standalone app does not show the content

I am trying to show the shapefile in canvas using standalone application. However it does not show the content. Here is my code and I am using PyQt5, Qgis 2.99, PyCharm 3.6 from qgis.core import * ...
1
vote
0answers
43 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 ...
3
votes
0answers
150 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\...
1
vote
0answers
99 views

Qt folder browser opening more than once in QGIS plugin [duplicate]

I have a Qt plugin, and i have a button browse_btn to browse for an output folder. I use the QFileDialog.getExistingDirectory function and it all works fine. However if I close the plugin and open it ...
2
votes
0answers
454 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 ...
4
votes
1answer
232 views

Python QGIS plugin could not load on linux build in window

I have created a plugin in QGIS windows version using "Plugin Builder". which on a button click opens another window, that is calling another class in the dialgoue python file, with another .ui file. ...
5
votes
2answers
842 views

Drop down list QGIS Plugin based on keyword search

I am developing a QGIS plugin, using python and Plugin Builder plugin of QGIS. I have created a textEdit text box on the plugin. I want to show a list of matching words from the database as user will ...
2
votes
1answer
803 views

'QgsVectorLayer' object has no attribute 'selectedFeatureIds'

I have a stand-alone PyQGis program and I need to periodically access the selected features of some vector layers. But I noticed that there seems to be no python wrapper for the 'selectedFeatureIds' ...
0
votes
2answers
171 views

Python plugin development. how implement merge functionality in a window

I want to create a plugin and in a window I need to make the same functionality as the toolbar advance digitize (merge, split features ...). Is there any possibility of calling the functions already ...
2
votes
1answer
138 views

PyQGis animate layer symbology change using thread failed

I need to animate the symbology change over a number of steps in a stand-alone PyQt application that uses qgis.core as library for map, my setup is very similar to Animating objects on canvas to ...
3
votes
1answer
4k views

Creating polygon from list of coordinates: QgsGeometry.fromPolygon has unexpected type list

I do have a script that collects coordinates from map canvas clicks and stores them in a list called coordinates. Now I want to create a feature, set its geometry and attributes and add the feature ...
3
votes
1answer
5k views

Passing string from one Python class to a QTextEdit field of another class (QGIS plugin)

I've an input mask that feeds a spatialite database. I have one Python file which does all the work and two Qt Ui-Files (Ui_InputMask, Ui_Items). In the main form (class mask_n_functions(QDialog, ...
1
vote
1answer
124 views

Qgis PyQT app error:

Can somebody help me. Trying to run Qgis PyQT app, but have an error in command line C:\work\2q5>python program.py C:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(472) : (...
2
votes
1answer
687 views

PyQt QFileDialog custom proxy filter not working

This working code brings up a QFileDialog prompting the user to select a .csv file: def load(self,fileName=None): if not fileName: fileName=fileDialog.getOpenFileName(caption="...
2
votes
0answers
107 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 ...
1
vote
1answer
657 views

Addition button in QGIS plugin form

I want to create PYQGIS plugin and for my task i need my QGIS GUI form to have one more button except to original button ok. the additional button to do something and original button to do something ...
4
votes
2answers
426 views

How to show only postgres vector layers in a QgsMapLayerComboBox?

I started to develop a plugin for QGIS in python and I need to list postgres layers in a QgsMapLayerComboBox. I used a QgsMapLayerProxyModel to show only vector layers from canvas: self.dlg.comboBox....
5
votes
1answer
2k views

Using PyQGIS in standalone scripts without crashing

I am new to the PyQGIS API. For developing I use my Spyder IDE with QGIS and GRASS modules. In order to make my script executable I just run my code with the QGIS python.exe in my bat file. This all ...
-1
votes
1answer
325 views

QGIS plugin using plugin builder [closed]

I want to create a very simple Python QGIS plugin and I follow this manual, all works fine using QGIS plugin builder and QT designer but I am not sure how to connect my variable from the GUI to my ...
3
votes
2answers
223 views

Creating a plugin that presents a list of projects as buttons, and opens one when pressed?

I'm pretty new to creating plugins, and python. I've created a plugin called open_projects that has 10 buttons, and I'd like each button to open up a project when its pressed. The plugin works when ...
2
votes
1answer
2k views

Having problems installing pyqt on Mac Os sierra

I am trying to write my first plugin following the tutorial at http://www.qgistutorials.com/en/docs/building_a_python_plugin.html. Woking on a Mac running sierra. The problem is that home brew will ...
1
vote
1answer
185 views

GIS Action that loads a raster, creates pyramids and sets color

Using the code in "Developing QGIS Action which loads a raster". from PyQt4.QtCore import QFileInfo,QSettings from qgis.core import QgsRasterLayer, QgsCoordinateReferenceSystem s = QSettings() ...
1
vote
0answers
113 views

QGIS Python Console AddMaplayer but with low resolution (very dim) [closed]

Update: Figured. I used the wrong style file. I'm new to QGIS Python develop. I was trying to add raster layer (.asc file) into QGIS. Below are my srcrips. from qgis.PyQt.QtCore import * import gdal ...
2
votes
0answers
90 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, ...
1
vote
0answers
723 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/...
2
votes
1answer
343 views

Read Sld Style in pyQGIS

I am trying to set a layer's style using pyQGIS. My primary idea was to set the style from a string, but unfortunately I can only do it from a file. This code works as a charm: filename= QDir....
3
votes
2answers
1k views

Segmentation fault (core dumped) QgsApplication

import os, os.path,sys from qgis.core import * from qgis.gui import * from PyQt4.QtGui import * from PyQt4.QtCore import * class MapExplorer(QMainWindow): def __init__(...
5
votes
1answer
680 views

Add extra item to drop down menu plugin. “Layers menu from project” plugin

I have created a drop down menu in QGIS. The code is mainly from the "Layers menu from project" plugin. I have cleaned it so it only have the drop down. My problem is that I will like to add an ...
2
votes
1answer
202 views

Keep size of dock widget's actions

I have a plugin with QDockWidget and QActions. When I first load (or reload) the plugin, the actions' size is set according to current settings. However, when QGIS is closed and open, the actions are ...
5
votes
2answers
630 views

Properter to get travel time as cost for network analysis

What I want to do is calculate travel times between points within a road network. I know there are options with GRASS (via v.net) and pgRouting (and possibly many more). I intent to stick to the ...
3
votes
1answer
612 views

Plugin builder - how to validate input values from a plugin dialog

I have a question regarding adding a warning popup when a user pressed OK while forgetting to fill in all the required fields in the plugin dialog. I have the following definition which checks if all ...
1
vote
0answers
153 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
0answers
167 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-...
2
votes
2answers
353 views

Building QGIS 2.16.3 Plugins on Mac OS X Sierra

I'm having difficulty building QGIS plugins using the new Mac OS Sierra. I can compile the resources using pyrcc5 resources.py resources.qrc and the plugin displays in QGIS, but the message 'This ...
4
votes
1answer
835 views

Loading Shapefile in a standalone PyQGis App

I'd like to open a shapefile in a standalone PyQGis App. The App starts and runs without a problem but a get an false-Return in the isValid()-Function on the Layer and the Layer doesn't show up. I ...
1
vote
0answers
205 views

Python script causing python.exe crash and wrapped C/C++ object failure [closed]

I am working on automating some of the normal processes that I want to do and I have run into some problems I have not found solutions for after a couple days of searching. I am relatively new to ...
2
votes
2answers
609 views

QGIS Network Analysis: QgsLineVectorLayerDirector.makeGraph(), attribute type QVector not available

relates to QGIS 2.14.6LTR on Win10, PyQt Version 4.10.2 When trying to makeGraph() on QgsLineVectorLayerDirector as described in the "QGIS Network analysis library" documentation (http://docs.qgis....
3
votes
1answer
135 views

QGIS processing scripts, more than one progress bar in the generated GUI?

Since I sometimes have to process cross product of two vector layers with geoprocessing scripts, causing me to use nested loops like source_count = source_layer.featureCount() target_count = ...
2
votes
1answer
897 views

TypeError: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated

Initially I have read a csv sheet of atmospheric parameters of 300x300 array of spatial points, the sheet contains 8 columns and 900 rows of data which is read into a numpy like array format using ...
3
votes
0answers
118 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 ...
2
votes
1answer
458 views

Problem with pushButton handling - pyqgis

I have made a pushButton - new window relation. Now, when I'm trying to 'link' methods with pushButtons in new window they don't react. Here is what I wrote in metod, which opens new window in ...
1
vote
1answer
5k views

Find out if checkbox checked - pyqgis

I'm new to pyqgis and I'm not sure how can I find out if checkbox is checked and according to the result do different things in another method? I know how to do it in theory, but if someone can show ...