Adding new functionality to CodeEditor example
Solved
General and Desktop
-
I've seen example of creating line numbers using QPlainTextEdit from here. But now i also want to draw lines between strings. My idea was to override
CodeEditor::paintEvent()
. So the question is: can i call -QPlainTextEdit::paintEvent()
fromCodeEditor::paintEvent()
to saveQPlainTextEdit::paintEvent()
functionality and then draw lines in it?
If not, what is the best way to achieve this? -
@Khamza
You are not supposed to just callpaintEvent()
from somewhere else, it's designed to be called during actual painting. If you override a basepaintEvent()
you can (and should) indeed call the base implementation from there. -
4/4