create propper signal/slot approach for separating gui and non-gui operation. try to revise your havy-compution algorithm.