fixes in order for it to work on Qt GUI