How to clone QJSEngine?
-
wrote on 4 May 2024, 19:13 last edited by
Given the instance of QJSEngine, how to create new instance with the same state?
-
wrote on 7 May 2024, 02:48 last edited by
@Merssedes I am not a QJSEngine user, but you cannot clone a QObject (by design). You would have to create a new object and manually configure it to match. I do not see a simple way to achieve this.
-
@Merssedes I am not a QJSEngine user, but you cannot clone a QObject (by design). You would have to create a new object and manually configure it to match. I do not see a simple way to achieve this.
-
You can create several instances but you cannot copy them. Though AFAIK, there's usually no reason to have more than one. What is your use case ?
-
You can create several instances but you cannot copy them. Though AFAIK, there's usually no reason to have more than one. What is your use case ?
wrote on 7 May 2024, 19:58 last edited by@SGaist Multithreading with requirement of no interlocking. Because QJSEngine is not thread safe, the only way I see for now is to clone original prepared instance for each worker thread. Anything else requires syncronisation between threads, which means interlocking.
5/5