PDA

View Full Version : QTextEdit line number under cursor



mvbhavsar
19th June 2018, 08:11
Hello All,

I have checked many sites for getting line number from QTextEdit where cursor is present, but none of the answers is satisfactory.
Simple ask is get line number if word supplied is present in QTextEdit and if not present then -1 to be returned.
Also, I want to find last line number.


Thanks

Manish

ChrisW67
19th June 2018, 09:30
Define "line number". If a line wraps is it one line or two? Can the user see a line number in their edit?

Uwe Yashwanth
29th June 2018, 04:00
Have you tried using QPlainTextEdit class. It has the Qtextcursor that might just solve your problem.