Switching to linux for development of pglab.
Switched from qmake to cmake. Code changes to make it compile.
This commit is contained in:
parent
dd9906dbd8
commit
04723a289b
142 changed files with 124 additions and 83 deletions
35
pglab/SqlSyntaxHighlighter.h
Normal file
35
pglab/SqlSyntaxHighlighter.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef SQLSYNTAXHIGHLIGHTER_H
|
||||
#define SQLSYNTAXHIGHLIGHTER_H
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
#include <QTextFormat>
|
||||
#include <unordered_set>
|
||||
#include "util.h"
|
||||
|
||||
using t_SymbolSet = std::unordered_set<QString>;
|
||||
|
||||
class PgTypeContainer;
|
||||
|
||||
class SqlSyntaxHighlighter : public QSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SqlSyntaxHighlighter(QTextDocument *parent = nullptr);
|
||||
~SqlSyntaxHighlighter();
|
||||
|
||||
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;
|
||||
|
||||
t_SymbolSet m_typeNames;
|
||||
};
|
||||
|
||||
#endif // SQLSYNTAXHIGHLIGHTER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue