QtScript is an ECMA262-compatible implementation of JavaScript. It is the successor of QSA (Qt Script For Applications), but is being phased out in recent Qt versions in favour of Google's V8 engine.
Questions tagged [qtscript]
116 questions
0
votes
1 answer
passing QByteArray in arg with QScriptEngine
i will try to use QScriptEngine to write function to Read Array and write array to change Trame for example with qtscript user.
i have read lot of documentation.
i will try this:
for the moment, i have QByteArray in my software, to check…

anyone
- 1
- 1
0
votes
1 answer
Is there any way to write a file with QtScript?
I want to make an installer with Qt. The configuration of the installer is written in a file named installscript.qs which is qtscript based
I tried to create a QFile inside but it didn't recognize it!
Any ideas???

chatzich
- 1,083
- 2
- 11
- 26
0
votes
1 answer
QT qScriptConnect is not working
QScriptEngine eng;
QScriptEngineDebugger debugger;
debugger.attachTo(&eng);
QScriptValue consoleObj = eng.newQObject(this);
eng.globalObject().setProperty("asd", consoleObj);
QScriptValue handler= eng.evaluate("(function(text) { asd.log('text was…

Nishad
- 23
- 8
0
votes
1 answer
How to register a QMap inside of a QList as a Meta Type in QtScript?
I am looking at having a QList> object passed from my Qt code to a JavaScript file and wondering how to properly handle the qScriptRegisterMetaType portion of the code.
Currently I am looking at having my Script value…

Sasha Demyanik
- 11
- 4
0
votes
1 answer
Javascript object that inherits QWidget
I am doing something in Javascript and Qt, and for my purpose, I need a javascript object that inherits QWidget. So far, I have tried the following:
function Test()
{
QWidget.call(this);
this.button = new QPushButton("test");
…

Lawliet
- 90
- 8
0
votes
1 answer
How to include a Qt Core c++ class for use in QtScript user function in SQLiteStudio 3.1.1?
I'm trying to write a user-defined function within SQLiteStudio (v3.1.1). This function needs to decode a field stored in base64.
I think I can achieve what I want to using the QByteArray class from Qt Core like so:
QByteArray text =…

ConnectSaucer
- 5
- 4
0
votes
1 answer
How do I cast class method to QScriptEngine::FunctionSignature
I want to pass this method:
QScriptValue ScriptProcessContext::construct(QScriptContext * ctx, QScriptEngine *)
{
return this->newInstance();
}
to QScriptEngine::newFunction. I tried the following options:
As in documentation and also this…

Tomáš Zato
- 50,171
- 52
- 268
- 778
0
votes
1 answer
How to iterate over items in QScriptValue which isArray()?
So I have this code:
QScriptValue result(someFunction());
if(result.isArray()) {
{
// Print items in array
}
How can I do it? I tried to convert it to QList but that doesn't work. I considered doing this:
const int length =…

Tomáš Zato
- 50,171
- 52
- 268
- 778
0
votes
1 answer
QScxml ECMAScript Data Model
I am having a look at QScxml ECMAScript Data Model and as I have never used any scripting functionality of Qt I am a bit lost.
I have seen that Qt has different Script engines (QtScript, QJSScript, QQMLEngine) which are all compatible to ECMAScript…

Stefano
- 3,981
- 8
- 36
- 66
0
votes
1 answer
How to convert QVariant to native QtScriptValue (Number, String etc.)
I had some problem with validating values in my QtScript script. The validator function looked like this:
function isValueInvalid(value) {
return typeof value=="undefined" || value == null || value == "" || value == "X";
}
The string "X" is…

Tomáš Zato
- 50,171
- 52
- 268
- 778
0
votes
0 answers
Transition from QtScript to QML/QJSEngine
There is some platform with use of QtScript as the JavaScript interpreter for the description of logic of the application.
Example of a script on JS
var f=new File('/var/www/test1');
f.write('123\n');
f.CopyTo('/var/www/test2');
Object of File is…

alexander_8901
- 41
- 6
0
votes
1 answer
Design C++ method that accepts variable number arguments passed from QtScript
I am learning QtScript and wrote several trivial examples. The mapping is straightforward if I limit arguments to simple types.
I now want to be able to pass variable number of arguments from QtScript to the C++ class, such as
Myobject.add(1, 2, 3,…

cuteCAT
- 2,251
- 4
- 25
- 30
0
votes
2 answers
Chaining constructors in JavaScript
I'm trying to implement some kind of class hierarchy in JavaScript. I
think I understood the prototype chain, but I still have to sort out the
constructor-chaining. Following David Flanagan's Definitive Guide,
I wrote
function DerivedClass()
{
…

Edgar Bonet
- 3,416
- 15
- 18
0
votes
1 answer
Setting QScriptValue-local values prior to evaluating
Is it possible, in Qt 4.8, from the C++ side, to set QScriptValue-local values in a QScriptEngine?
For example, let's say I have:
QScriptEngine engine;
engine.globalObject().setProperty("glob", 1000);
// ???: Set loc to, say, 42.
QScriptValue expr1…

Jason C
- 38,729
- 14
- 126
- 182
0
votes
1 answer
Sockets comunication between QTScript and Python
I'm trying to communicate an external python script with a C++ program that allows qt-scripting. The goal its to partially control the C++ program (using its qtscript api functions) from python code.
I know how to create a basic socket server/client…

hasielhassan
- 3
- 3