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

[Reg] Undeletable properties can't be deleted from C++

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P4: Low P4: Low
    • None
    • 4.6.0
    • Qt Script
    • None

      QScriptEngine engine;
      QScriptValue object = engine.newObject();
      object.setProperty("undeletableProperty", 42, QScriptValue::Undeletable);
      object.setProperty("undeletableProperty", QScriptValue());
      qWarning() << object.property("undeletableProperty").toString();
      

      With Qt 4.5, the above program prints an empty string (because the property was deleted). Since 4.6, it prints "42" (the attempt to delete the property was ignored).
      We should decide and clarify whether the property attributes only affect property access from the JS side (4.5), or from both JS and C++ (4.6).

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

            kenthans Kent Hansen (Inactive)
            kenthans Kent Hansen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes