Nowadays, we can run or test a script from the command line using –run or –test.
The one missing piece would be to be able to initialize the dialog from the command line, particularly useful for testing.
Script Dialog use widget name to access data from QML, for example a QLineEdit named fileName will be accessed using data.fileName from QML. We could use a similar mechanism to initialize data. I'm thinking of something like that:
Nowadays, we can run or test a script from the command line using
–run
or–test
.The one missing piece would be to be able to initialize the dialog from the command line, particularly useful for testing.
Script Dialog use widget name to access data from QML, for example a
QLineEdit
namedfileName
will be accessed usingdata.fileName
from QML. We could use a similar mechanism to initialize data. I'm thinking of something like that:ie passing either a json fileName or a string that can be interpreted as a json file.
That would mean:
ScriptDialogItem::initialize(json)
to initialize the dialog from a jsonScriptRunner::runQml
if it's a ScriptDialog, pass the json to itFinally, once everything is done, add a test: