wgtcodeeditor.h 566 B

12345678910111213141516171819202122232425262728
  1. #ifndef WGTCODEEDITOR_H
  2. #define WGTCODEEDITOR_H
  3. #include <QPlainTextEdit>
  4. class WgtCodeEditor : public QPlainTextEdit
  5. {
  6. Q_OBJECT
  7. public:
  8. WgtCodeEditor(QWidget *parent = 0);
  9. void lineNumberAreaPaintEvent(QPaintEvent *event);
  10. int lineNumberAreaWidth();
  11. protected:
  12. void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
  13. private slots:
  14. void updateLineNumberAreaWidth(int newBlockCount);
  15. void highlightCurrentLine();
  16. void updateLineNumberArea(const QRect &, int);
  17. private:
  18. QWidget *lineNumberArea;
  19. };
  20. #endif // WGTCODEEDITOR_H