O
O
Oleg Seledets2018-12-03 21:01:38
Qt
Oleg Seledets, 2018-12-03 21:01:38

How to move a function to a QThread thread?

Hello, in the mainw class there is a function outputExcelReport(), how can it be moved to another thread on a call?
Is it necessary to create a new class for it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2018-12-03
@oleja1ee7

In the case of Qt, one can simply use QtConcurrent::run: doc.qt.io/qt-5/qtconcurrentrun.html

T
Tesla4o, 2018-12-20
@Tesla4o

as an option it is possible.
myfunction().moveToThread(you thread);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question