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. How to replace QScript in QT6
Qt 6.11 is out! See what's new in the release blog

How to replace QScript in QT6

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

    I am trying to build our app using Qt6 on MacOS 13.5.1

    The app was written in Qt5, but on the MacBook I only have macosx11.3 SDK, so had to try buidling using Qt 6.4.2.

    The issue I am having is the error

    Unknown module(s) in QT: script

    I note that QScript is removed from Qt6.

    QScript is used in only a few places in the code. I was wondering how the following would be replaced (not full code, but hope someone can give me pointers here).

    FunctionPlotGraphicsView *view;
    FunctionPlotData plot;
    QScriptValue func;
    QScriptEngine engine;
    QScriptValueList args;
    .
    .
    
    args << qreal_value;
    qreal y = plot->func.call(QscritValue(), args).toNumber();
    
    QScriptValue global = _view->engine.globalObject();
    
    M 1 Reply Last reply
    0
    • T TGRSM

      I am trying to build our app using Qt6 on MacOS 13.5.1

      The app was written in Qt5, but on the MacBook I only have macosx11.3 SDK, so had to try buidling using Qt 6.4.2.

      The issue I am having is the error

      Unknown module(s) in QT: script

      I note that QScript is removed from Qt6.

      QScript is used in only a few places in the code. I was wondering how the following would be replaced (not full code, but hope someone can give me pointers here).

      FunctionPlotGraphicsView *view;
      FunctionPlotData plot;
      QScriptValue func;
      QScriptEngine engine;
      QScriptValueList args;
      .
      .
      
      args << qreal_value;
      qreal y = plot->func.call(QscritValue(), args).toNumber();
      
      QScriptValue global = _view->engine.globalObject();
      
      M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      @TGRSM
      Qt6 has QJSEngine instead
      https://doc.qt.io/qt-6/topics-scripting.html

      1 Reply Last reply
      1

      • Login

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