String from sign
-
wrote on 10 Jun 2011, 12:34 last edited by
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 -
wrote on 10 Jun 2011, 12:51 last edited by
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!
-
wrote on 10 Jun 2011, 12:53 last edited by
Yes, but i need find string from sign, no count of string
-
wrote on 10 Jun 2011, 13:17 last edited by
Could you please explain more clearly what you are trying to do? I am not clear from your original post.
-
wrote on 10 Jun 2011, 13:37 last edited by
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 -
wrote on 10 Jun 2011, 13:44 last edited by
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?
-
wrote on 10 Jun 2011, 13:44 last edited by
Please post a small sample of the data and explain clearly what you wish to do with it.
-
wrote on 10 Jun 2011, 13:51 last edited by
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");@ -
wrote on 10 Jun 2011, 14:23 last edited by
Are you looking for:
@c1.blockNumber()@ -
wrote on 10 Jun 2011, 14:54 last edited by
Thank you, this is that I was searching
1/10