#include <QTidyParser.h>
Signals | |
| void | showMessage (const QString &mess) |
| send Messages for QStatusBar | |
| void | showDiagnose (const QString &diag) |
| Tidy Parser Messages. | |
| void | showSingleDiagnose (const QTidy::QTidyDiagnosis &diag) |
| Display Tidy Report Level peer Line. | |
Public Member Functions | |
| QTidyParser (QObject *parent=0, const QString &config=QString()) | |
| const QString | cleanContent (const QString &doc) |
| clean Document Content | |
| const QString | checkContent (const QString &doc) |
| check Syntax for Document Content | |
| void | isXML (bool b=true) |
| force XML parsing | |
| ~QTidyParser () | |
void myClass::setDiagnose ( const QTidy::QTidyDiagnosis &diag ) { switch ( diag.level ) { case TidyBadDocument: { qDebug() << "Invalid Document"; return; } // ... } } void myClass::checkDocument() { QString doc = m_QTextEdit->toPlainText(); QTidy::QTidyParser parser ( this ); connect ( &parser, SIGNAL ( showSingleDiagnose ( const QTidy::QTidyDiagnosis & ) ), this, SLOT ( setDiagnose ( const QTidy::QTidyDiagnosis & ) ) ); if ( ! doc.isEmpty() ) { QString cleaned = parser.cleanContent ( doc ); if ( cleaned.isEmpty() ) return; m_QTextEdit->setContent ( cleaned ); m_QListWidget->clear(); parser.checkContent ( cleaned ); } }
| QTidy::QTidyParser::QTidyParser | ( | QObject * | parent = 0, |
|
| const QString & | config = QString() | |||
| ) |
| parent | Parent Object e.g QTextEdit | |
| config | optional configuration file path |
| QTidy::QTidyParser::~QTidyParser | ( | ) |
| const QString QTidy::QTidyParser::cleanContent | ( | const QString & | doc | ) |
clean Document Content
| doc | Document Content |
| const QString QTidy::QTidyParser::checkContent | ( | const QString & | doc | ) |
check Syntax for Document Content
| doc | Document Content |
| void QTidy::QTidyParser::isXML | ( | bool | b = true |
) |
force XML parsing
| void QTidy::QTidyParser::showMessage | ( | const QString & | mess | ) | [signal] |
send Messages for QStatusBar
| void QTidy::QTidyParser::showDiagnose | ( | const QString & | diag | ) | [signal] |
Tidy Parser Messages.
| void QTidy::QTidyParser::showSingleDiagnose | ( | const QTidy::QTidyDiagnosis & | diag | ) | [signal] |
Display Tidy Report Level peer Line.