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

Support infrastructure to call properties (primarily setters) directly

    XMLWordPrintable

Details

    • eff73ee3197723eb1f5b35ec39bb496a40ab5343 (qt/qtdeclarative/dev)

    Description

      Going further with QML compiler, we need a way to figure out how to directly call property functions, without involving the meta object system.

      Consider an example:

      Rectangle {
        width: 42
      }
      

      In QML compiler, property setting would be translated into something like:

      this->setProperty("width", 42);
      

      However, in this case we rely on the meta object system to figure out the setter of the property.

      Likely, the direct call is much faster, so having

      this->setWidth(42); // directly call C++ method of "this"
      emit this->witdhChanged(); // optional?
      

      would give better performance, practically allowing the auto-generated code to be as good as human-generated one in certain cases.

      For now, looks like only setters are interesting (and signals?).

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            agolubev Andrei Golubev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes