PDA

View Full Version : QTextCursor



bismitapadhy
18th June 2009, 12:41
1. QTextCursor QTextDocument::find ( const QString & subString, const QTextCursor & cursor, FindFlags options = 0 ) const

Returns a cursor with the match selected if subString was found; otherwise returns a null cursor.

How can we check that the cursor is a null cursor or the cursor of the selected substring.
if(cursor) ---giving error.

shentian
18th June 2009, 12:46
Use QTextCursor::isNull:




QTextCursor cursor = textDocument->find( /* ... */ );
if (!cursor.isNull())
{
// text found!
}