Display a QAbstractMessageHandler message on a QTextEdit widget.



  • Hi,
    I would like to debug the result of an XML file validation (against an XML schema) by displaying the messages generated by
    QAbstractMessageHandler on QTextEdit instance instead of using the console. By default the QXmlSchemaValidator write the message on the console (stderr) using some HTML/CSS colors and styles. for example :

    @Error XSDError in file:///home/issam/pfe/project/unnamed.pnml, at line 2, column 69: No definition for element pnml available.
    @

    FODC0002 is coloured in red, line and column numbers in blue, pnml word in blue ....

    But when i use the QTextEdit the message is displayed without colors, only the black is used !

    The raw message is :
    @
    "<html ><body><p>No definition for element <span class='XQuery-keyword'>pnml</span> available.</p></body></html>"
    @

    How to display the message on QTextEdit as it was displayed on the terminal ?

    Thanks in advance. :)



  • try this:

    http://qt-project.org/doc/qt-4.8/qtextedit.html

    qtextEdit.insertHtml(erro_report);


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.