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

QVariant conversion to QScriptValue is recursive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.0
    • 4.6.3, 4.7.0
    • Qt Script
    • None
    • Linux (Debian - testing - 32)
    • 20143e765b627ba2f8ab77ea9b842dd1549f19f3

    Description

      QVariant conversion to QScriptValue unwrap an internal QVariant value. Behavior is correct and documented. In most cases it is nice feature, but problems start when a QVariant contains a QVariant. I believe that QVariant value should be unwrap at most one time.

      So this code returns true and it is ok:
      return QScriptValue(123) == qScriptValueFromVariant(QVariant(123))

      Now, this code returns true but it is wrong:
      QVariant tmp1(123);
      QVariant tmp2(QMetaType::QVariant, &tmp);
      return QScriptValue(123) == qScriptValueFromVariant(tmp2)
      qScriptValueFromVariant(tmp2) should return a QScriptValue that contains a QVariant that contains an int(123). So qScriptValueFromVariant(tmp2).isVariant() should be true.

      Attachments

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

        Activity

          People

            nierob Nierob
            nierob Nierob
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes