I have QTextEdit "textbox".
I want to do this:
Somebody is writing something in this QTextEdit "textbox". next he is clicking button, program is taking line by line text from QTextEdit and program throwing line by line to the list text which somebody have written , next program is sorting lines of text and program is showing sorted lines of text in QTextEdit.
I made it that:
int end = cursor.position();
int start = cursor.position();
for(int i=start; i<end; i=cursor.position())
{
line=........ ? // <- I must take here present line of text
list.push_back(line);
}
QStringList list;
QString line;
QTextCursor cursor(textbox->textCursor());
cursor.movePosition(QTextCursor::End);
int end = cursor.position();
cursor.movePosition(QTextCursor::Start);
int start = cursor.position();
for(int i=start; i<end; i=cursor.position())
{
line=........ ? // <- I must take here present line of text
list.push_back(line);
cursor.movePosition(QTextCursor::Down);
cursor.movePosition(QTextCursor::StartOfLine);
}
To copy to clipboard, switch view to plain text mode
Is it ok ? It is something new for me. How can I take all present line of text to throw it to the list ?
Bookmarks