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 aQProcess
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 frozenTo achieve what you require, use
QProcess.start()
to launch the child process asynchronously, and connect the corresponding signalsstarted()
andfinished()
. See the notes in the documentation for some details to consider.
Post a Comment for "Qt: Qpushbutton Is Blocked By Child Process"