def handleMessage(self, msg_type, desc, identifier, loc): #QMessageBox.information(None, "Error", desc + " Ident: " + identifier.toString() + " Line: " + QString(str(loc.line()))) from metatoolsviewer import MetatoolsViewer message_type = {0:'Debug', 1:'Warning', 2:'Critical', 3:'Fatal'} if msg_type > 1: self.errorOccured = True desc.replace('<p>', '') desc.replace('</p>', '') desc.replace("<body>", "<head><style>.XQuery-keyword, .XQuery-type {color: red;} infolabel {color: blue; text-weight: bold; text-size: 14px}</style></head><body>") #add styles desc.replace("<body>", "<infolabel>Problem type: </infolabel>%s <br/><infolabel>Problem line: </infolabel>%s <br/><infolabel>Problem description: </infolabel>" % (message_type[msg_type], loc.line())) #add info dlg = MetatoolsViewer() dlg.resize(dlg.width(), 200) dlg.setHtml(desc) dlg.setWindowTitle(self.windowTitle) dlg.exec_()