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

[Reg] Script instanceof operator generates error when right-hand-side is generated by QScriptEngine::newQMetaObject()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.3
    • 4.6.0
    • Qt Script
    • None
    • Linux-x86_64RHEL5
      gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
    • bee994a655104e3ac9674c8ac25043f79e01c1e7

    Description

      Under Qt4.6.1, the scripting instanceof operator fails with the right-hand-side of the operator is an object created by QScriptEngine::newQMetaObject(). This used to work, as of Qt4.5.2.

      The attached example application demonstrates this problem. If you build and run it, it will bring up the interactive script interpreter example. Then, do the following:

      var a = new A();
      a.sayHello(); // makes sure the underlying slots of C++ type A are exposed.
      print( a instanceof A );

      The last line generates the following error:
      TypeError: Result of expression 'A' [[object QMetaObject]] is not a valid argument for 'instanceof'.

      Attachments

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

        Activity

          People

            kenthans Kent Hansen (Inactive)
            daniel.baker@remcom.com Daniel Baker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes