mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-09-23 08:39:07 +03:00
script highlighter has been fixed
This commit is contained in:
@@ -175,15 +175,15 @@ void ScriptHighlighter::highlightBlock(const QString& text)
|
||||
|
||||
bool ScriptHighlighter::isKeyWord(const QString& word)
|
||||
{
|
||||
for (int i = 0; i < KEYWORDS_COUNT-1; ++i){
|
||||
if (QLatin1String(keywords[i]) == word) return true;
|
||||
}
|
||||
return false;
|
||||
return m_keywords.contains(word);
|
||||
}
|
||||
|
||||
ScriptHighlighter::ScriptHighlighter(QTextDocument* parent):
|
||||
QSyntaxHighlighter(parent)
|
||||
{
|
||||
for(int i=0; i<KEYWORDS_COUNT; ++i){
|
||||
m_keywords.insert(keywords[i]);
|
||||
}
|
||||
|
||||
if ( isColorDark(QPalette().background().color())){
|
||||
m_formats[NumberFormat].setForeground(Qt::darkBlue);
|
||||
|
@@ -43,6 +43,8 @@ protected:
|
||||
QTextCharFormat m_formats[FormatsCount];
|
||||
bool isKeyWord(const QString& word);
|
||||
void createParentheisisInfo(const char& literal, TextBlockData *data, const QString& text);
|
||||
private:
|
||||
QSet<QString> m_keywords;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user