pgLab/pglab/SqlSyntaxHighlighter.h
eelke 1792f42dac Improved working of BackupDialog
- improved layout
- automatically switch to output component when start is clicked
- coloured output for succes/error message
- highlighter for pg_dump output that highlights error lines

Note: all output of pg_dump goes to stderr because stdout is reserved for output of the backup data.
2019-08-23 09:43:48 +02:00

34 lines
768 B
C++

#ifndef SQLSYNTAXHIGHLIGHTER_H
#define SQLSYNTAXHIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QTextFormat>
#include "catalog/PgKeywordList.h"
#include "util.h"
class PgTypeContainer;
class SqlSyntaxHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
SqlSyntaxHighlighter(QTextDocument *parent = nullptr);
~SqlSyntaxHighlighter() override;
void setTypes(const PgTypeContainer& types);
protected:
void highlightBlock(const QString &text) override;
private:
QTextCharFormat m_keywordFormat;
QTextCharFormat m_commentFormat;
QTextCharFormat m_quotedStringFormat;
QTextCharFormat m_typeFormat;
QTextCharFormat m_quotedIdentifierFormat;
QTextCharFormat m_parameterFormat;
t_SymbolSet m_typeNames;
};
#endif // SQLSYNTAXHIGHLIGHTER_H