Skip to main content
6 votes

Definitive list of QGIS multiprocessing tools?

Thread safety QGIS Processing algorithms can be thread-safe or not. According to the docs, the latter are : [...] algorithms which manipulate the current project, layer selections, or with ...
Germán Carrillo's user avatar
6 votes

Using QObject inside thread in PyQGIS

By taking and simplifying the PyQGIS Cookbook example, here is an example : from time import sleep from qgis.core import QgsApplication, QgsTask from PyQt5.QtCore import pyqtSignal class MyTask(...
J. Monticolo's user avatar
  • 15.9k
6 votes
Accepted

Sharing class variables across thread (QgsTasks) with pyQGIS

Here is working example. I have modified your code a bit. Because both your tasks have much the same function (to run a processing algorithm and return a result layer) I would prefer to only create ...
Ben W's user avatar
  • 23.1k
4 votes
Accepted

Setting up thread with busy progress indicator or GIF in PyQGIS

As in my answer in the post you linked, I create a QgsTask MyTask with a layer parameter. I just adapt the content of your method buffering in the run method of the QgsTask. I defined 2 signals (...
J. Monticolo's user avatar
  • 15.9k
3 votes
Accepted

Missing Outputs with ArcPy RasterToASCII and ThreadPoolExecutor

Multithreading and ArcPy is a topic that comes up from time to time, usually on Esri Community. I believe part of my answer from Does arcpy support multithreading? - Esri Community a few years ago is ...
bixb0012's user avatar
  • 2,449
3 votes
Accepted

Conditional signals in QgsTask managing algorithm output

Try the example below. Sorry, your code was a bit of a mess, I basically tried to make it functional in the quickest way that I could. I suggest to now study the code and do your own research and self ...
Ben W's user avatar
  • 23.1k
3 votes
Accepted

QGIS loading a layer every 5 seconds (Threading)

The watchFile option, as mentioned in the documentation should be added to the uri string. This is an example of how to add the option to your uri string: uri = "file:///C:/Users/User/Desktop/...
Techie_Gus's user avatar
  • 2,150
3 votes
Accepted

Will core functions in QGIS exploit multi-threading?

I think that the answer for QGIS 3.0 may be found in this recent conversation posted in Nabble: Will Processing in QGIS 3 support parallelization? Citing Nyall Dawson: If you're after ...
mgri's user avatar
  • 16.3k
2 votes
Accepted

pyqgis threading - Exception when using QgsTask.fromFunction

It could be that you are missing a few self, try to change def test_run(task, wait_time): to def test_run(self, task, wait_time): and def test_completed(exception, result=None): to def test_completed(...
axel_ande's user avatar
  • 2,084
2 votes

QGIS plugin multithreading and loading memory layers

The worker thread should not interfere with the GUI. Make the worker thread as isolated / independent as possible - it should only interact with the GUI thread using signals. You can use a signal to ...
Håvard Tveite's user avatar
2 votes
Accepted

QgsTask: finished-function isn't executed

i found the same question on the right sidebar. (QGIS QgsTaks finished and completed never called) It says that QGIS tasks in plugins are broken, because the finished() and completed() functions are ...
bennetr's user avatar
  • 71
1 vote

GIF freezes when QGIS plugin runs

The task manager must be returned from QgsApplication.taskManager() function. So in the function called pipeline you should do this. def pipeline(self): # mgr = QgsTaskManager() mgr = ...
Mayo's user avatar
  • 4,050
1 vote

QgsVectorLayer creation in Qthread (PyQt)

Ok I'll give up, I tried everything I can think of. I deleted the object, I send the deleteLater signal to the metaObject of the task and so on. Nothing seems to work. I used QThreads, QgsTasks as ...
TheGrudge's user avatar
  • 423
1 vote

QGIS loading a layer every 5 seconds (Threading)

Complementing answer of Techie_Gus, you can activate option "Refresh Layer in interval(Seconds)" in CSV layer properties -> rendering menu.
Marco Reliquias's user avatar
1 vote

Using PyQGIS to create images from the QGIS print composer each showing a different layer?

This code seems to work for me: from PyQt4.QtCore import * from PyQt4.QtGui import * outputFolder = "C:/Users/fsc/Documents/Temp/" layers = iface.legendInterface().layers() settings = iface....
mgri's user avatar
  • 16.3k

Only top scored, non community-wiki answers of a minimum length are eligible