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

QJsonObject to QAssociativeIterable conversion fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.12.0, 5.13.0
    • None

      The following code crashes in it.size()

      QJsonObject obj {
          { QStringLiteral("foo"), QStringLiteral("bar") }
      };
          
      QVariant v(obj);
          
      if (v.canConvert<QVariantHash>()) {
          auto it = v.value<QAssociativeIterable>();
          it.size();
          qDebug() << "Didn't crash";
      }
      

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

            nierob Nierob
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes