refactor
try fixing qt gui stop responding problem