Define a new message handler for Qt5