[SOLVED] Please I need help with QTextBlock::isVisible in QTextEdit
I am writing a simple editor with a line number panel
I want to get the first visible block using this snipet in a slot that is connect to update when the text change and blockCount changed
- int total_line=this->TextEditor->document()->blockCount();
- int line_ctr=0;
but no matter how first_visible_line is always 1 so block.isVisible() return always true .
I want to keep QTextEdit because I will be adding syntaxe coloring using QSyntaxHil..
Otherwise there is QPlainTextEdit::firstVisibleBlock() but I am not sure if QSyntaxHilighter can work on QPlainTextEdit
Please need help.
Thanks in advance
Seems that other people have experienced the same issue [stackoverflow.com]
Btw I think you can simplify your code using something like this:
Of course this will not solve an issue with isVisible() for blocks in QTextEdit if such exists :(