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
QtWS25 Last Chance

javascript decorators in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 275 Views
  • 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 26 Mar 2020, 02:20 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;
    }
    }

    J 1 Reply Last reply 26 Mar 2020, 02:30
    0
    • G G P Ranjan
      26 Mar 2020, 02:20

      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;
      }
      }

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 26 Mar 2020, 02:30 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

      1/2

      26 Mar 2020, 02:20

      • Login

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