File indexing completed on 2024-05-05 03:48:22
0001 /* 0002 File : EquationHighlighter.h 0003 Project : LabPlot 0004 Description : syntax highligher for mathematical equations 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2014 Alexander Semke <alexander.semke@web.de> 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef EQUATIONHIGHLIGHTER_H 0011 #define EQUATIONHIGHLIGHTER_H 0012 0013 #include <QSyntaxHighlighter> 0014 0015 class KTextEdit; 0016 0017 class EquationHighlighter : public QSyntaxHighlighter { 0018 Q_OBJECT 0019 public: 0020 explicit EquationHighlighter(KTextEdit* parent); 0021 void setVariables(const QStringList&); 0022 // void setErrorPosition(int position); 0023 0024 public Q_SLOTS: 0025 void rehighlight(); 0026 0027 protected: 0028 void highlightBlock(const QString& text) override; 0029 0030 // int m_errorPosition; 0031 KTextEdit* m_parent; 0032 QStringList m_variables; 0033 }; 0034 0035 #endif