I am not sure about details of Qt4, but in Qt3 was quite easy.
You have to inherit a your class from QThread and there override the virtual function run() that is called by the QThread start()method.
An example could be:
Qt Code:
{ private: . . . public: // constructor virtual void run(); //inside this you execute your calculate(int) . . . }To copy to clipboard, switch view to plain text mode
for more details that sure you need, refer to http://doc.trolltech.com/4.3/qthread.html
Anyway, calculate from thread is a bit more complicated and could be a risk, since unxpected terminations could crash your program. Complicated because you have to manage the thread result to send it to your application, with some wrappers.
So I suggest you to well study the thread guide.
Greetings
Bookmarks