Skip to content

Commit c14e6ca

Browse files
committedJan 9, 2018
Most c++ algorithms can run safely in background threads
1 parent 70785f8 commit c14e6ca

File tree

92 files changed

+269
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+269
-6
lines changed
 

‎python/plugins/processing/gui/AlgorithmDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pprint import pformat
2929
import time
3030

31-
from qgis.PyQt.QtCore import QCoreApplication
31+
from qgis.PyQt.QtCore import QCoreApplication, Qt
3232
from qgis.PyQt.QtWidgets import QMessageBox, QPushButton, QSizePolicy, QDialogButtonBox
3333
from qgis.PyQt.QtGui import QColor, QPalette
3434

@@ -241,14 +241,14 @@ def on_complete(ok, results):
241241
feedback.pushInfo('')
242242

243243
self.cancelButton().setEnabled(False)
244+
244245
self.finish(ok, results, context, feedback)
245246

246247
if self.algorithm().flags() & QgsProcessingAlgorithm.FlagCanRunInBackground:
247248
task = QgsProcessingAlgRunnerTask(self.algorithm(), parameters, context, feedback)
248249
task.executed.connect(on_complete)
249250
QgsApplication.taskManager().addTask(task)
250251
else:
251-
self.setWindowModality(Qt.ApplicationModal)
252252
ok, results = execute(self.algorithm(), parameters, context, feedback)
253253
on_complete(ok, results)
254254

‎src/3d/processing/qgsalgorithmtessellate.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ QString QgsTessellateAlgorithm::displayName() const
3131
return QObject::tr( "Tessellate" );
3232
}
3333

34+
QgsProcessingAlgorithm::Flags QgsTessellateAlgorithm::flags() const
35+
{
36+
return QgsProcessingFeatureBasedAlgorithm::flags() | QgsProcessingAlgorithm::FlagCanRunInBackground;
37+
}
38+
3439
QStringList QgsTessellateAlgorithm::tags() const
3540
{
3641
return QObject::tr( "3d,triangle" ).split( ',' );

0 commit comments

Comments
 (0)