Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QScriptEngine vs. QJSEngine?
Forum Updated to NodeBB v4.3 + New Features

QScriptEngine vs. QJSEngine?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 5.3k 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.
  • S Offline
    S Offline
    saraiza
    wrote on last edited by
    #1

    I am working on an internal windows desktop application/tool and I want to make it scriptable. It looks like currently there are at least two ways in Qt to do this. The scripts generated by users will be simple, and I will need to inject custom objects into the scripting environment for the user to manipulate.

    Both engines seem to do the same thing, except that QScriptEngine has the QScriptEngineAgent which might let me add a script debugging feature to the system.

    On the other hand, the documentation for QScriptEngine says that Qt Commercial users must honor the LGPL for it. We are using Digia's version, so does that mean I should avoid QScriptEngine?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      QScriptEngine uses JavaScriptCore, which is LGPL (QJSEngine uses V8, which is BSD).

      So I assume that this passage tells you that even if you are a commercial customer, which allows you to release your code related to Qt under any license, you still will have to release code related to QScriptEngine - as it uses JavaScriptCore - under the terms of the LGPL

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        QScriptEngine is the old boy from Qt4. QJSEngine is based on v8 -(that's where the LGPL requirement comes from)- and was introduced in Qt5.

        No need to avoid it, as long as you don't break LGPL (you need to take a closer look at the license yourself, but in short it means you should not link that code statically + you have to publish any changes you make to that code. Your app can have any license you wish).

        (Z(:^

        1 Reply Last reply
        0
        • S Offline
          S Offline
          saraiza
          wrote on last edited by
          #4

          If I never actually ship/release code with scripting support, does it matter which one I use? (this is an internal tool)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            saraiza
            wrote on last edited by
            #5

            Ok, so I may use either in this case. I still don't know how to figure out which one makes more sense for my application, they both seem to be the same thing to me.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              I would say QJSEngine, if it has all that you need. Being based on v8 is a huge advantage in performance. AFAIK it does lack some of the convenience APIs QScriptEngine has.

              (Z(:^

              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