Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Useless parameter ’caretMode’ in function "int QRegExp::indexIn ( const QString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) const&
Forum Updated to NodeBB v4.3 + New Features

Useless parameter ’caretMode’ in function "int QRegExp::indexIn ( const QString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) const&

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 642 Views 1 Watching
  • 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 Offline
    R Offline
    robinh3123
    wrote on 11 Sept 2014, 09:03 last edited by
    #1

    Hi, All,

    I just wonder how I can use the Caretmode parameter 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 parameter '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
    0
    • E Offline
      E Offline
      Eddy
      wrote on 13 Sept 2014, 00:34 last edited by
      #2

      I close this one as a duplicate

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0

      2/2

      13 Sept 2014, 00:34

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved