3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
349 stars 30 forks source link

Qt 5.14 deprecates Qt Script #103

Closed claudeha closed 3 years ago

claudeha commented 4 years ago

https://wiki.qt.io/New_Features_in_Qt_5.14 (near the bottom)

I don't know if that means it will be removed in 5.15 LTS, or if it will stay until Qt 6 (due end of 2020).

3Dickulus commented 4 years ago

Looks like they plan to drop a few things, hopefully the functionality will be implemented elsewhere because being able to add ECMAScript easily to a program is a very cool option and I would hate to let it go... may get stuck at 5.14 for a while :-/

3Dickulus commented 4 years ago

https://lists.qt-project.org/pipermail/interest/2015-March/015971.html

The deprecation is just the label that reflects reality for QtScript. There is no work being done on the module actively.

The focus will now be to get the missing features in place in QJSEngine.

So what I understand is that the goodies in QScript are migrating to QJSEngine need to look into that...

3Dickulus commented 4 years ago

from Qt Docs...

QJSValue QJSEngine::globalObject() const By default, the Global Object contains the built-in objects that are part of ECMA-262, such as Math, Date and String. Additionally, you can set properties of the Global Object to make your own extensions available to all script code. Non-local variables in script code will be created as properties of the Global Object, as well as local variables in global code.

Script Exceptions evaluate() can throw a script exception (e.g. due to a syntax error). If it does, then evaluate() returns the value that was thrown (typically an Error object). Use QJSValue::isError() to check for exceptions.

For detailed information about the error, use QJSValue::toString() to obtain an error message, and use QJSValue::property() to query the properties of the Error object. The following properties are available:

  • name
  • message
  • fileName
  • lineNumber
  • stack

...so it looks like the same engine but no builtin graphic trace/debugger, still reports the meaningful stuff if an exception is thrown. Doesn't look like a big problem at this point, essentially some different include names and function names?

3Dickulus commented 4 years ago

oh, reminder Shift+F6 allows binding an fqs to the F6 key that will then execute if F6 is pressed by itself.

3Dickulus commented 3 years ago

checked out Qt Code review Feb/06/2021 and work is still being done on qt/qtscript, Qt 5.15, it seems to be transitioning to QJS so Im sure the functionality will remain just the name is changing.

see https://codereview.qt-project.org/q/status:open