Skip to content

How to block python running using PythonQt #187

@NessajHu

Description

@NessajHu

There is a part of python script as follows, these functions call C++ functions.

GenerateMesh()
CloseProject()

GenerateMesh start external QProcess to do real task, then return immediatly. It's async. There is another function reciving QProcess::finished signal to do some other work.
CloseProject closes the program.
This design has a fatal problem. GenerateMesh is async, CloseProject is invoked, at this point, the child process is not finished.
A possible solution is move all python operation to subthread, and make GeneratorMesh synchronous. but other function do a lot of UI operation.
Is there a proper way to block or pause python running?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions