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

[Reg] Dynamic C++ property overrides JS property

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 4.6.0
    • Qt Script
    • None

      #include <QtCore>
      #include <QtScript>
      
      int main(int argc, char **argv)
      {
          QCoreApplication app(argc, argv);
          QScriptEngine eng;
          QScriptValue o = eng.newQObject(&app);
          o.setProperty("x", 42);
          app.setProperty("x", 123);
          qWarning() << o.property("x").toInt32();
          return 0;
      }
      

      With Qt 4.5, the above program prints "42" (value of the JS property); with 4.6, it prints "123" (value of the dynamic C++ property).

        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:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes