Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QTextCursor QTextDocument::find ( const QString subString,
int  position = 0,
FindFlags  options = 0 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Finds the next occurrence of the string, subString, in the document. The search starts at the given position, and proceeds forwards through the document unless specified otherwise in the search options. The options control the type of search performed.

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

If the position is 0 (the default) the search begins from the beginning of the document; otherwise it begins at the specified position.

Definition at line 963 of file qtextdocument.cpp.

References QRegExp::setCaseSensitivity(), and QRegExp::setPatternSyntax().

Referenced by find().

{
    QRegExp expr(subString);
    expr.setPatternSyntax(QRegExp::FixedString);
    expr.setCaseSensitivity((options & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);

    return find(expr, from, options);
}


Generated by  Doxygen 1.6.0   Back to index