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

QVariant doesn't compare QStringList properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.0
    • Core: Other
    • None

    Description

      When there are two QVariants with QStringList inside, comparison operators doesn't work as expected.

      A simple example:

      QStringList l1, l2;
      
      l1 << "";
      l2 << "33" << "434";
      
      QVariant v1(l1), v2(l2);
      
      const bool vl = v1 < v2;
      const bool vg = v1 > v2;
      const bool veq = v1 == v2;
      

      Whatever is placed to l1 and l2, result always says v1 > v2 (vg is true, others are false).

      5.6.2
      ("") ("33", "434") >
      ("33", "434") ("") >
      ("33", "434") ("33", "434") ==
      

      See "Core: QDebug and comparison operator support metatypes." 49d984b48c815ac27300ad49c1125501e3e6623c https://codereview.qt-project.org/#/c/51590/

      Attachments

        For Gerrit Dashboard: QTBUG-54893
        # Subject Branch Project Status CR V

        Activity

          People

            nierob Nierob
            kicer Michał Walenciak
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes