aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-18 09:35:44 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-18 09:35:44 +0200
commit9db55f741e283d0e52f2cd07090d9403378cd6a5 (patch)
treed2cd522846707e9da3665e72ef01122fececa3f0 /qtmips_gui
parent6fabd7c08a087278a44260335769d0e78aa355ee (diff)
downloadqtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.tar.gz
qtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.tar.bz2
qtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.zip
Rename Highlighter to HighlighterAsm to preare for alternative C highlighter.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/highlighterasm.cpp (renamed from qtmips_gui/highlighter.cpp)6
-rw-r--r--qtmips_gui/highlighterasm.h (renamed from qtmips_gui/highlighter.h)10
-rw-r--r--qtmips_gui/qtmips_gui.pro4
-rw-r--r--qtmips_gui/srceditor.cpp4
-rw-r--r--qtmips_gui/srceditor.h4
5 files changed, 14 insertions, 14 deletions
diff --git a/qtmips_gui/highlighter.cpp b/qtmips_gui/highlighterasm.cpp
index 463bbb3..b996e20 100644
--- a/qtmips_gui/highlighter.cpp
+++ b/qtmips_gui/highlighterasm.cpp
@@ -35,10 +35,10 @@
/* Based on Qt example released under BSD license */
#include "QStringList"
-#include "highlighter.h"
+#include "highlighterasm.h"
#include "instruction.h"
-Highlighter::Highlighter(QTextDocument *parent)
+HighlighterAsm::HighlighterAsm(QTextDocument *parent)
: QSyntaxHighlighter(parent)
{
HighlightingRule rule;
@@ -111,7 +111,7 @@ Highlighter::Highlighter(QTextDocument *parent)
//commentEndExpression = QRegularExpression(QStringLiteral("\\*/"));
}
-void Highlighter::highlightBlock(const QString &text)
+void HighlighterAsm::highlightBlock(const QString &text)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
foreach(const HighlightingRule &rule, highlightingRules)
diff --git a/qtmips_gui/highlighter.h b/qtmips_gui/highlighterasm.h
index 93f1d77..7f27144 100644
--- a/qtmips_gui/highlighter.h
+++ b/qtmips_gui/highlighterasm.h
@@ -34,8 +34,8 @@
******************************************************************************/
/* Based on Qt example released under BSD license */
-#ifndef HIGHLIGHTER_H
-#define HIGHLIGHTER_H
+#ifndef HIGHLIGHTERASM_H
+#define HIGHLIGHTERASM_H
#include <QSyntaxHighlighter>
#include <QTextCharFormat>
@@ -46,12 +46,12 @@ class QTextDocument;
QT_END_NAMESPACE
//! [0]
-class Highlighter : public QSyntaxHighlighter
+class HighlighterAsm : public QSyntaxHighlighter
{
Q_OBJECT
public:
- Highlighter(QTextDocument *parent = 0);
+ HighlighterAsm(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text) override;
@@ -76,4 +76,4 @@ private:
};
//! [0]
-#endif // HIGHLIGHTER_H
+#endif // HIGHLIGHTERASM_H
diff --git a/qtmips_gui/qtmips_gui.pro b/qtmips_gui/qtmips_gui.pro
index 0f8cab0..1be139e 100644
--- a/qtmips_gui/qtmips_gui.pro
+++ b/qtmips_gui/qtmips_gui.pro
@@ -76,7 +76,7 @@ SOURCES += \
hinttabledelegate.cpp \
coreview/minimux.cpp \
srceditor.cpp \
- highlighter.cpp \
+ highlighterasm.cpp \
messagesdock.cpp \
messagesmodel.cpp \
messagesview.cpp
@@ -124,7 +124,7 @@ HEADERS += \
hinttabledelegate.h \
coreview/minimux.h \
srceditor.h \
- highlighter.h \
+ highlighterasm.h \
messagesdock.h \
messagesmodel.h \
messagesview.h
diff --git a/qtmips_gui/srceditor.cpp b/qtmips_gui/srceditor.cpp
index 55f372a..e7502ac 100644
--- a/qtmips_gui/srceditor.cpp
+++ b/qtmips_gui/srceditor.cpp
@@ -40,7 +40,7 @@
#include <QTextBlock>
#include "srceditor.h"
-#include "highlighter.h"
+#include "highlighterasm.h"
void SrcEditor::setup_common() {
QFont font;
@@ -49,7 +49,7 @@ void SrcEditor::setup_common() {
font.setPointSize(10);
setFont(font);
tname = "Unknown";
- highlighter = new Highlighter(document());
+ highlighter = new HighlighterAsm(document());
}
SrcEditor::SrcEditor(QWidget *parent) : Super(parent) {
diff --git a/qtmips_gui/srceditor.h b/qtmips_gui/srceditor.h
index 1fdbb98..02650e5 100644
--- a/qtmips_gui/srceditor.h
+++ b/qtmips_gui/srceditor.h
@@ -38,8 +38,8 @@
#include <QTextEdit>
#include <QString>
+#include <QSyntaxHighlighter>
#include "qtmipsmachine.h"
-#include "highlighter.h"
class SrcEditor : public QTextEdit {
Q_OBJECT
@@ -56,7 +56,7 @@ public:
void setCursorToLine(int ln);
void setFileName(QString filename);
private:
- Highlighter *highlighter;
+ QSyntaxHighlighter *highlighter;
void setup_common();
QString fname;
QString tname;