QTApplication problem fix. Called as few as possible