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

Throw exception when trying to read or write non-existing QObject properties

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • Some future release
    • 4.3.2
    • Qt Script
    • None

      Consider a call exposed to the QScriptEngine, with the following property:

      Q_PROPERTY(QString name READ getName)

      Then consider the following script, in which the second assignment will leave the value of theBadName undefined, with no indication to the script writer that nameFoo is not a valid property:

      var theName = myObj.name;

      var theBadName = myObj.nameFoo;

      Thus, it would be nice if an exception was thrown if a property is attempted read, which does not exist. This could for example be a QObjectWrapOption.

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

            kenthans Kent Hansen (Inactive)
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes