Qt UI: small code refactoring.