Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Useless argument 'Caretmode' in function QRegExp::indexIn()

    C++ Gurus
    1
    1
    697
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      robinh3123 last edited by

      Hi, All,

      I just wonder how I can use the 'Caretmode' argument of function "int QRegExp::indexIn ( const QString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) const".

      First, if offset == 0, CaretAtZero, or CaretAtOffset has same meaning, and thus CaretAtZero is not useful. Second, if offset != 0, I should always use CaretAtOffset, since CaretAtZero has no meaning (since we don’t match the string from offset 0.) Yet if I don’t want to use CaretAtOffset, then I can just omit caret from the search pattern. This renders CaretAtOffset useless again.

      I just wonder, is there any actual useful case for the argument ‘CaretAtZero’? Forgive me poor C++: I can not think of any useful case… Could someone please point out some cases for me? Thanks.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post