mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
QThreadPool::cancel was introduced in Qt5.5, so no cancellation
possible for Qt < 5.5 Moral of the story: if you run outdated libraries, you can't expect full functionality from your apps ;)
This commit is contained in:
parent
5216220872
commit
9b763741b8
@ -83,9 +83,14 @@ void QgsTask::run()
|
||||
|
||||
void QgsTask::cancel()
|
||||
{
|
||||
mShouldTerminate = true;
|
||||
#if QT_VERSION < 0x050500
|
||||
//can't cancel with qt < 5.5
|
||||
return;
|
||||
#else
|
||||
|
||||
mShouldTerminate = true;
|
||||
QThreadPool::globalInstance()->cancel( this );
|
||||
|
||||
if ( mStatus == Queued || mStatus == OnHold )
|
||||
{
|
||||
// immediately terminate unstarted jobs
|
||||
@ -100,6 +105,7 @@ void QgsTask::cancel()
|
||||
{
|
||||
subTask.task->cancel();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void QgsTask::hold()
|
||||
@ -694,7 +700,9 @@ bool QgsTaskManager::cleanupAndDeleteTask( QgsTask *task )
|
||||
}
|
||||
else
|
||||
{
|
||||
#if QT_VERSION >= 0x050500
|
||||
QThreadPool::globalInstance()->cancel( task );
|
||||
#endif
|
||||
if ( isParent )
|
||||
{
|
||||
//task already finished, kill it
|
||||
|
Loading…
x
Reference in New Issue
Block a user