Added message handler to direct qmessages to cout/cerr