2015-12-06 15:11:47 -05:00
|
|
|
#ifndef RSSYNTAXHIGHLIGHTER_H
|
|
|
|
#define RSSYNTAXHIGHLIGHTER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSyntaxHighlighter>
|
|
|
|
#include <QTextEdit>
|
|
|
|
|
|
|
|
class RsSyntaxHighlighter : public QSyntaxHighlighter
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-12-12 20:01:06 -05:00
|
|
|
Q_PROPERTY(QColor textColorQuote READ textColorQuote WRITE setTextColorQuote)
|
|
|
|
|
2015-12-06 15:11:47 -05:00
|
|
|
public:
|
|
|
|
RsSyntaxHighlighter(QTextEdit *parent = 0);
|
2015-12-12 20:01:06 -05:00
|
|
|
QColor textColorQuote() const { return quotationFormat.foreground().color(); };
|
2015-12-06 15:11:47 -05:00
|
|
|
|
|
|
|
protected:
|
2015-12-06 20:49:56 -05:00
|
|
|
void highlightBlock(const QString &text);
|
2015-12-06 15:11:47 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
QTextCharFormat quotationFormat;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2015-12-12 20:01:06 -05:00
|
|
|
void setTextColorQuote(QColor textColorQuote);
|
|
|
|
|
2015-12-06 15:11:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RSSYNTAXHIGHLIGHTER_H
|