Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. javascript decorators in QML
Qt 6.11 is out! See what's new in the release blog

javascript decorators in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 362 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    G P Ranjan
    wrote on last edited by
    #1

    Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
    Is it considered an ECMA-6 feature?

    Eg :-

    @log
    function HelloWorld() {
    return "Hello world"
    }

    where function log(wrapped) {
    return function() {
    console.log('Starting');
    const result = wrapped.apply(this, arguments);
    console.log('Finished');
    return result;
    }
    }

    JKSHJ 1 Reply Last reply
    0
    • G G P Ranjan

      Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
      Is it considered an ECMA-6 feature?

      Eg :-

      @log
      function HelloWorld() {
      return "Hello world"
      }

      where function log(wrapped) {
      return function() {
      console.log('Starting');
      const result = wrapped.apply(this, arguments);
      console.log('Finished');
      return result;
      }
      }

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @G-P-Ranjan said in javascript decorators in QML:

      Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
      Is it considered an ECMA-6 feature?

      Qt 5.12 supports ECMAScript 7.

      However, it looks like Decorators are still in the Proposal stage, not yet part of the standard: https://github.com/tc39/proposal-decorators

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved