I'm working on a code editor for GLSL in Qt and I'm having problems with showing the line numbers of a QTextEdit. I undestand the example from Qt Code Editor Example but this part
QTextBlock block = firstVisibleBlock();
int blockNumber = block.blockNumber();
int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top();
int bottom = top + (int) blockBoundingRect(block).height();
doesn't really combine well with a QTextEdit given the fact that I don't have the firstBisibleBlock, blockBoundingGeometry and blockBoundingRect methods. I know the blocks are kept in a QTextDocument but that class doesn't have these methods either.
I tried searching for an example but every time someone asks this question he is directed to that same link.
Could anyone help me?
Thanks