mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 08:34:38 +03:00
script highlighter has been fixed
This commit is contained in:
parent
bed346552e
commit
022b80613b
@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
|||||||
|
|
||||||
LIMEREPORT_VERSION_MAJOR = 1
|
LIMEREPORT_VERSION_MAJOR = 1
|
||||||
LIMEREPORT_VERSION_MINOR = 5
|
LIMEREPORT_VERSION_MINOR = 5
|
||||||
LIMEREPORT_VERSION_RELEASE = 68
|
LIMEREPORT_VERSION_RELEASE = 69
|
||||||
|
|
||||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||||
|
@ -175,15 +175,15 @@ void ScriptHighlighter::highlightBlock(const QString& text)
|
|||||||
|
|
||||||
bool ScriptHighlighter::isKeyWord(const QString& word)
|
bool ScriptHighlighter::isKeyWord(const QString& word)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < KEYWORDS_COUNT-1; ++i){
|
return m_keywords.contains(word);
|
||||||
if (QLatin1String(keywords[i]) == word) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptHighlighter::ScriptHighlighter(QTextDocument* parent):
|
ScriptHighlighter::ScriptHighlighter(QTextDocument* parent):
|
||||||
QSyntaxHighlighter(parent)
|
QSyntaxHighlighter(parent)
|
||||||
{
|
{
|
||||||
|
for(int i=0; i<KEYWORDS_COUNT; ++i){
|
||||||
|
m_keywords.insert(keywords[i]);
|
||||||
|
}
|
||||||
|
|
||||||
if ( isColorDark(QPalette().background().color())){
|
if ( isColorDark(QPalette().background().color())){
|
||||||
m_formats[NumberFormat].setForeground(Qt::darkBlue);
|
m_formats[NumberFormat].setForeground(Qt::darkBlue);
|
||||||
|
@ -43,6 +43,8 @@ protected:
|
|||||||
QTextCharFormat m_formats[FormatsCount];
|
QTextCharFormat m_formats[FormatsCount];
|
||||||
bool isKeyWord(const QString& word);
|
bool isKeyWord(const QString& word);
|
||||||
void createParentheisisInfo(const char& literal, TextBlockData *data, const QString& text);
|
void createParentheisisInfo(const char& literal, TextBlockData *data, const QString& text);
|
||||||
|
private:
|
||||||
|
QSet<QString> m_keywords;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user