evgenM
8th November 2007, 10:01
i have this code
TextEdit::TextEdit()
{
setPlainText("text1\ntext2");
select();
}
//
void TextEdit::select()
{
QTextCursor cursor = textCursor();
while (!cursor.atEnd())
{
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
}
cout <<qPrintable(cursor.selectedText())<<endl;
}
so my text is "text1\ntext2" but function select() return "text1?text2"
'?' it's unprintable Enter?
how to get text in normal mode with '\n' using QTextCursor?
TextEdit::TextEdit()
{
setPlainText("text1\ntext2");
select();
}
//
void TextEdit::select()
{
QTextCursor cursor = textCursor();
while (!cursor.atEnd())
{
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
}
cout <<qPrintable(cursor.selectedText())<<endl;
}
so my text is "text1\ntext2" but function select() return "text1?text2"
'?' it's unprintable Enter?
how to get text in normal mode with '\n' using QTextCursor?