Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13052

Suggestion: Static equivalents of functions such as QChar::isDigit()

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 5.0.0 Beta 1
    • None
    • None
    • MSVC8 SP1, Windows XP SP2

    Description

      It would be nice to have static equivalents of functions in QChar such as isDigit(), isHighSurrogate(), isLetter(), isLetterOrNumber(), isLowSurrogate(), isLower(), isMark(), isNull(), isNumber(), isPrint(), isPunct(), isSpace(), isSymbol(), isTitleCase(), isUpper() and hasMirrored ().

      I'm thinking of something like this:

      static bool QChar::isDigit(const QChar c)
      {
        return c.isDigit();
      }
      

      This you could use the functions as predicates with STL algorithms like this:

      std::remove_if(sep.begin(), sep.end(), QChar::isDigit);
      

      I know it's easy to do this yourself, but it'd be nice to have in the Qt framework per default.

      A function QString::erase(iterator begin(), iterator end()) would be very helpful as well, to actually erase the "removed" elements.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            marcbf Marc-Berco Fuhr
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes