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. Script engine - porting from Qt5 to Qt6 issues

Script engine - porting from Qt5 to Qt6 issues

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 363 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.
  • Y Offline
    Y Offline
    Yuri8724
    wrote on last edited by
    #1

    Hello everyone,

    I am trying to port a program from Qt5 to Qt6, and I am encountering some issues with the scripting system. Currently, the program uses QScriptEngine and exposes both custom types and C++ standard types to the engine using qScriptRegisterMetaType.

    I have switched to QJSEngine, and most functionalities are working fine. However, I am unable to expose my custom types since the qScriptRegisterMetaType method no longer exists.
    I checked the documentation and found some forum posts discussing this issue, but there don’t seem to be any solutions.

    https://forum.qt.io/topic/143674/porting-from-qtscript-to-qjsengine-setscriptclass-and-toscriptvalue-and-fromscriptvalue-functions
    https://forum.qt.io/topic/24368/custom-c-types-and-qjsengine

    Is there any alternative to qScriptRegisterMetaType, or a way to manually expose custom types?

    Thanks,
    Yuri

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jammin44fm
      wrote on last edited by
      #2

      Hi Yuri,

      I'm one of the posters you mentioned above.
      Sadly the solution I eventually went with was to use quickjs as our javascript engine which gives much more control over the java script environment and allowed me to create/control the plumbing around using c++ types within the javascript environment.

      Sorry i dont have any other help for you.

      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