#ifndef WGTCODEEDITOR_H #define WGTCODEEDITOR_H #include class WgtCodeEditor : public QPlainTextEdit { Q_OBJECT public: WgtCodeEditor(QWidget *parent = 0); void lineNumberAreaPaintEvent(QPaintEvent *event); int lineNumberAreaWidth(); protected: void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private slots: void updateLineNumberAreaWidth(int newBlockCount); void highlightCurrentLine(); void updateLineNumberArea(const QRect &, int); private: QWidget *lineNumberArea; }; #endif // WGTCODEEDITOR_H