Questions tagged [pyqt]

PyQt provides bindings for Qt 2 and Qt 3.

Filter by
Sorted by
Tagged with
2
votes
1answer
813 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' ...
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 ...
2
votes
1answer
695 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
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 ...
2
votes
1answer
355 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....
2
votes
2answers
360 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 ...
2
votes
2answers
615 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....
2
votes
1answer
472 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 ...
2
votes
1answer
276 views

QGis QDir remove directory problem

I am currently developing a QGis plugin and I need to create and remove directories and I use PyQt. I don't know if my problem comes from PyQt or QGis. So my program creates folders, that works all ...
2
votes
2answers
3k views

PyQT: QFileDialog keeps on opening window after clicking on cancel or ok

I use to write QGis plugins, which is based on PyQT. I use to create QButtons and connect their click to a function that itself calls a QFileDialog. For example: def doOpenFile(self): fname =...
2
votes
1answer
466 views

use qgis api in qtcreator

i have a college project that searches content in map. I did all instruction written in this site: http://kartoza.com/how-to-build-and-debug-qgis-with-qtcreator then built my sample project. this is ...
2
votes
1answer
433 views

QGIS plugin problem, can't reach objects in a Qt-based Stacked Widget

I am creating a plugin for QGIS but am having trouble with the Qt components. I have used Plugin Builder and Qt designer to create all necessary files for the plugin. I want to use a QStackedWidget ...
2
votes
1answer
942 views

How do I properly import python sklearn to QGIS PyQt plugin?

I'm somewhat new to python and QGIS plugin development. I've created a plugin structure for QGIS using the Plugin Builder on QGIS and I've added some controls to the gui and managed to update the ...
2
votes
1answer
12k views

How to get value and store it in a variable from a line edit or text edit in pyQT?

How to get value and store it in a variable (in main python plugin) from a line edit or text edit box that were created in QT designer ?
2
votes
1answer
577 views

How to write a custom canvas item for SVG marker by subclassing QgsMapCanvasItem in QGIS?

I want to subclass QgsMapCanvasItem for SVG marker in QGIS, I looked up a similar topic in stackexchange and QGIS mailing list, I found that this is similar to mine, I did exactly what @Nathan W did. ...
2
votes
1answer
453 views

Using QGIS modules in standalone application with PySide?

I want to make small standalone application using PySide and QGIS Python modules to display satellite images and do standard GIS operations, like creating new a shapefile and placing polygons or ...
2
votes
1answer
76 views

In what ways has QGIS 2.x API changed making Plugin Builder Tutorial invalid?

I am working on the QGIS workshop Tutorial for QGIS Plugin Builder and notice that it is for QGIS 1.1. As this seems like a popular tutorial, in general, what are some areas of this tutorial that need ...
2
votes
1answer
58 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 ...
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 ...
2
votes
0answers
140 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
0answers
321 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
0answers
56 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
0answers
34 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
0answers
311 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
1answer
544 views

Toolbar button with drop down menu

I want to create my own Toolbar with a Toolbar button which has a drop down menu: The following code works fine in the QGIS console: from qgis.core import Qgis from PyQt5.QtWidgets import QToolBar,...
2
votes
0answers
50 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
0answers
130 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
0answers
459 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
0answers
108 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
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, ...
2
votes
1answer
208 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 ...
2
votes
0answers
302 views

Problem using processing.runandload() [closed]

I'm writing a QGIS plugin using PyQGIS and I have a weird problem. When executing following line of code: processing.runandload("qgis:createpointsalonglines", r"Clipped", 1, 1, 0, r"memory:nodes") ...
2
votes
1answer
2k views

How to solve SIP installation error?

I'm new to Python, and am trying to install Qt/PyQt for PyQGIS. I downloaded the PyQt and SIP packages, and tried to install them but have run into errors. Installing SIP: As far as I can tell, ...
2
votes
1answer
87 views

QGIS - how to retrieve information on features during editing [duplicate]

I am developing a QGIS plugin that allows me to draw QgsPoints on a vector layer. When drawing, I toggle QGIS's edit mode. In some cases, the last drawn point needs to be deleted. In order to do this, ...
2
votes
0answers
262 views

QPyNullVariant not recognized outside of QGIS [duplicate]

I'm getting an error about an operation involving a QPyNullVariant: TypeError: unsupported operand type(s) for *: 'QPyNullVariant' and 'float' I wanted to put a check into my code to skip these ...
2
votes
0answers
182 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
0answers
1k 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
0answers
208 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
0answers
257 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
0answers
682 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
1answer
60 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.
1
vote
1answer
213 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 ...
1
vote
1answer
350 views

PyQGIS plugin doesn't work layer list combo box

I want to create a simple QGIS plugin with a simple combo box with list from my layers in _ _init_ _ : legendInterface = self.iface.legendInterface() listLayerName = [i.name() for i in ...
1
vote
2answers
355 views

Access actions of ToolbarMenu/PanelMenu using PyQGIS

For a Python plugin I need to remove/disable some UI elements so that they can't be accessed by the user. Thus, I removed the respective actions, toolbars and menus from the interface. However, in ...
1
vote
1answer
1k views

Capturing mouse movement on QgsMapCanvas?

I have a python app that uses QgsMapCanvas as map display. I put it inside a QWidget, which is then inside another control. The problem is that there seems to be no way of tracking mouse move event on ...
1
vote
1answer
2k views

Popup menu on Mapcanvas right-click

I would like to have a pop-up menu when right-clicking the MapCanvas (the identifyFeatures tool does it...) Could anybody give me a starting point on how to achieve this?
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 ...
1
vote
1answer
1k views

Layer properties dialog in my QGIS plugin [closed]

I am developing a plugin which should display some information like geometry of the layer, feature count etc. Now those are currently displayed in QMessageBox.information. I want it to be displayed ...
1
vote
1answer
314 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....
1
vote
1answer
507 views

pyqgis correct activate signal for combo box list

I am a pyqgis user and I am trying to create a QGIS plugin where that plugin have two tabs widgets and two combo box where first combo box have a list from layers and second combo box have list of ...