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

[REG 5.15->6.0] QAssociativeIterable wraps returned values in QVariant

XMLWordPrintable

    • 2d0a5f7a014d1b84d5701d835aa28f1a047fbff5 (qt/qtbase/dev)

      Given this code:

      
      #include <QtCore/QDebug>
      #include <QtCore/QAssociativeIterable>
      #include <QtCore/QVariant>
      #include <QtCore/QMap>
      
      int main(int, char**)
      {
          auto container = QVariantMap();
      
          container["one"] = 1;
      
          auto containerVariant = QVariant::fromValue(container);
          auto iter = containerVariant.value<QAssociativeIterable>();
          auto f = iter.constFind("one");
          auto value = iter.value("one");
          qDebug() << value;
      
          return 0;
      }
      
      

      we get this output:

      QVariant(QVariant, QVariant(int, 1))
      

      but we expect:

      QVariant(int, 1)
      

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

            ulherman Ulf Hermann
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes