[code] Implement syntax highlighting in PythonTextArea

This commit is contained in:
Romain Goyet
2018-06-04 14:09:20 +02:00
committed by EmilieNumworks
parent a514f2a6be
commit 29cacbc44f
2 changed files with 142 additions and 43 deletions

View File

@@ -15,8 +15,10 @@ public:
protected:
class ContentView : public TextArea::ContentView {
public:
ContentView(KDText::FontSize fontSize);
void drawRect(KDContext * ctx, KDRect rect) const override;
ContentView(KDText::FontSize fontSize) : TextArea::ContentView(fontSize) {}
void clearRect(KDContext * ctx, KDRect rect) const override;
void drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn) const override;
KDRect dirtyRectFromCursorPosition(size_t index, bool lineBreak) const override;
};
private:
const ContentView * nonEditableContentView() const override { return &m_contentView; }