diff --git a/codeeditor.h b/codeeditor.h new file mode 100644 index 0000000000000000000000000000000000000000..a00c5498672acf76664e60d9967eccf11fb53131 --- /dev/null +++ b/codeeditor.h @@ -0,0 +1,28 @@ +#ifndef CODEEDITOR_H +#define CODEEDITOR_H + +#include +#include + +class CodeEditor : public QPlainTextEdit +{ + Q_OBJECT +public: + CodeEditor(QWidget *parent = 0); + + void lineNumberAreaPaintEvent(QPaintEvent* event); + int lineNumberAreaWidth(); + +protected: + void resizeEvent(QResizeEvent* event) override; + +private slots: + void updateLineNumberAreaWidth(int newBlockCount); + void highlightCurrentLine(); + void updateLineNumberArea(const QRect& rect, int dy); + +private: + QWidget *lineNumberArea; +}; + +#endif // CODEEDITOR_H \ No newline at end of file