I want to force closing Qgis project (QgsTask) in some point
NOTE:
QgsProject.instance().clear() # NOT WORKINGQgsTaskManager().cancelAll() # NOT WORKING
QgsTask.cancel() # NOT WORKING
task.canCancel() # FALSE
project = QgsProject.instance()
project.clear() # NOT WORKING
QgsTaskManager().cancelAll() # NOT WORKING
tasks = QgsApplication.taskManager().activeTasks()
for task in tasks:
print (task.canCancel()) # False
print (task.description()) # Loading “C:/Users/User/Desktop/some_project.qgs”
print (task.flags()) # <qgis._core.QgsTask.Flags object at 0x000002330527E4C8>
task.cancel() # NOT WORKING
Is there any way to force closing project or task or change flag QgsTask.CanCancel to True ?