I selected more than one line.
I am geting the selected content using cursor.selectedText();
I want to check only one line content is selected or more than one line content selected?
How can i check this?
I selected more than one line.
I am geting the selected content using cursor.selectedText();
I want to check only one line content is selected or more than one line content selected?
How can i check this?
Last edited by bismitapadhy; 15th July 2009 at 12:55.
Check for any line endings are in selected text or not.
how to check line end char?
the following code also not working.
Qt Code:
if(cursor.hasSelection ()) selection = cursor.selectedText (); if(selection.contains('\n'))To copy to clipboard, switch view to plain text mode
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
Check '\n', '\r', or their combinations.
Can you tell me, how you are getting the selected text ?
I guess you have to change line wrap and word wrap properties to QTextEdit::NoWrap
I got your problem.
If the selection obtained from an editor spans a line break, the text will contain a Unicode U+2029 paragraph separator character instead of a newline \n character. Use QString::replace() to replace these characters with newlines. enjoy![]()
check this is working:
Qt Code:
To copy to clipboard, switch view to plain text mode
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
bismitapadhy (15th July 2009)
Yepp, thats cool,![]()
Bookmarks