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. What syntax exactly is supported for JS resources imported from QML?
Forum Updated to NodeBB v4.3 + New Features

What syntax exactly is supported for JS resources imported from QML?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 289 Views 1 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.
  • Stefan Monov76S Offline
    Stefan Monov76S Offline
    Stefan Monov76
    wrote on last edited by Stefan Monov76
    #1

    This isn't really a Qt Quick question, it's a QML question but this seemed the most fitting subforum.

    I used to think that, when you import a JS resource from QML, this JS file can contain only standard JS code. Then I came across 2 exceptions:

    • the .import statement
    • the property keyword (in JS), which seems to be only used in code-behind files and apparently adds a property to the QML component that imports the JS

    What other "extensions" are there in JS when imported from QML, as compared with standard JS?

    And I'd like these two, as well as any other extensions to the JS language, described in full (e.g. with a link to the docs). For example, what's the difference between declaring a global JS variable with and without the property keyword?

    1 Reply Last reply
    0

    • Login

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