Hello.
I want to set a new thread to compute. Because compute costs a lot of time so I want to set a new thread. But when I use
var thread = new QThread();
The console tell me that "Can't find variable: QThread".
How should I do to realize it?
Thank you very much.
fang_h_y
How to use QThread in ECMAScript code?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: How to use QThread in ECMAScript code?
Some of the Qt API (including QThread) is not available for scripts. This likely means it would cause problems.
Re: How to use QThread in ECMAScript code?
Hello,andrew
Is there anyway way to solve this problem? I want to do some function that spend a lot of time in other thread. If realize the function in GUI thread, it will block the GUI thread.
Look forward your reply
fang_h_y
Is there anyway way to solve this problem? I want to do some function that spend a lot of time in other thread. If realize the function in GUI thread, it will block the GUI thread.
Look forward your reply
fang_h_y
Re: How to use QThread in ECMAScript code?
You could call QCoreApplication.processEvents(); in your loop to keep the GUI responsive.