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

QCollator::SetIgnorePunctuation has no effect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 Beta, 5.9.1
    • 5.3.1
    • None
    • Mac OS X 10.8.5
      Qt 5.3.1 Clang64
    • 26fd805f500acfdcf730f2488a66e18c72d0ff9a

    Description

      QCollator::compare with only punctuation character as diff doesn't return 0 when ignorePunctuation is true.

      #include <QString>
      #include <QCollator>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QString a("aa");
          QString b("a.a");
          Q_ASSERT(b.at(1).isPunct());
          QCollator comp;
          comp.setIgnorePunctuation(false);
          Q_ASSERT(comp.compare(a,b) != 0);
          comp.setIgnorePunctuation(true);
          Q_ASSERT(comp.compare(a,b) == 0); //fails
      }
      

      Attachments

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

        Activity

          People

            laknoll Lars Knoll
            e0150566 Janne Koskinen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes