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. Using a javascript file from several QML files

Using a javascript file from several QML files

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.4k 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.
  • F Offline
    F Offline
    Faid
    wrote on 5 Dec 2011, 22:21 last edited by
    #1

    I'd like to use the same instance of a javascript game logic file from several QML files, so I suppose I should import it once in my main QML and refer to it somehow (as discussed in "this thread":http://www.developer.nokia.com/Community/Discussion/showthread.php?223175-Troubles-setting-js-global-variables-from-QML-file). How do I do that though? In the main QML file I can refer to the javascript file by the string after "as" in the import statement. That does not work for the other files, I just get a "ReferenceError: Can't find variable". How can I make them aware of the javascript logic?

    1 Reply Last reply
    0

    1/1

    5 Dec 2011, 22:21

    • Login

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