Skip to content Skip to sidebar Skip to footer

Qt: Qpushbutton Is Blocked By Child Process

Given the following code button = ... process = QProcess() button.clicked.connect(start_process) def start_process(): # Disable the button button.setEnabled(False) #

Solution 1:

You already answered your question yourself :), so I just summarize it:

  • QProcess.execute (it is static, btw, so no need to create a QProcess object in this case) starts the child process and waits for the child process to finish - while the child process is running, the calling process is blocked and your UI is frozen

  • To achieve what you require, use QProcess.start() to launch the child process asynchronously, and connect the corresponding signals started() and finished(). See the notes in the documentation for some details to consider.

Post a Comment for "Qt: Qpushbutton Is Blocked By Child Process"