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. Use external javascript libraries in my qml canvas.
Forum Updated to NodeBB v4.3 + New Features

Use external javascript libraries in my qml canvas.

Scheduled Pinned Locked Moved QML and Qt Quick
qmlcanvasjavascript
4 Posts 3 Posters 2.3k Views 3 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.
  • ealioneE Offline
    ealioneE Offline
    ealione
    wrote on last edited by
    #1

    Now and then I find some nice javascript libraries like this one.

    Since the qml canvas is so similar to the html canvas then it should be possible to use them in qml.

    Is there any tutorial, example, or other recourse that discusses this matter?

    p3c0P 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Is QtQml JavaScript imports what you are looking for ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ealioneE ealione

        Now and then I find some nice javascript libraries like this one.

        Since the qml canvas is so similar to the html canvas then it should be possible to use them in qml.

        Is there any tutorial, example, or other recourse that discusses this matter?

        p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by p3c0
        #3

        @ealione I doubt that it will work readily with QML. Javascript support in QML is very restricted as compared to that of Web-Browsers. It lacks of certain objects which are mostly used in these web-browsers supported Javascripts.
        You can find more info here:

        • http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html
        • http://doc.qt.io/qt-5/qtqml-javascript-expressions.html
        • http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html#javascript-environment-restrictions

        157

        1 Reply Last reply
        1
        • ealioneE Offline
          ealioneE Offline
          ealione
          wrote on last edited by
          #4

          Hi SGaist,
          I did of curse know about importing and using simple javascript code in my qml tests. But what I was wondering was if it is possible to use the multitude of javascript libraries that are out there, mostly the impressive ones that deal with animations like the one I linked to.

          Thanks for the links p3c0, I believe that by studying them I may be able to port a javascript library to a qml compatible version.

          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