String from sign
-
Hello, I have QPlainTextEdit there is any position, for example 12, how to know which line (block) is a position of
Thanks in advance
Except counting signs \ in - this method is very long -
You can everytime you append text to the QPlainTextEdit count the "\n" characters. So you know always how many lines you have! So you don't have to count the lines again!
-
Yes, but i need find string from sign, no count of string
-
Could you please explain more clearly what you are trying to do? I am not clear from your original post.
-
I have somi position, for example 125
I have a text in the QPlainTextEdit
QPlainTextEdit have a strings(text from start to \n)
I need find string where situated sign number 125 -
I don't get it. What does it mean position 125? Is it the number of words in t a special line or is it the column of this line?
-
Please post a small sample of the data and explain clearly what you wish to do with it.
-
http://hostingkartinok.com/image/01201106/a78462eb23699b873f41a07a84794da1.png
@ QTextCursor c1 = plainTextEdit->document()->find(QRegExp("\{ *\}"));
if (!c1.isNull())
listWidget->addItem("empty stylesheet {it's empty!} in " + /number of string/ + " string");@ -
Are you looking for:
@c1.blockNumber()@ -
Thank you, this is that I was searching