Pass the directory as an argument instead. Have you tested what happens when this is removed? Does Qt Designer still run OK?