Display loading gif while lengthy function is running in parallel.
-
wrote on 3 Jun 2022, 08:14 last edited by
I have a loading gif named
loading.gif
.
I want to display this gif in a label using QMovie, while a function namedextractMeta()
that takes some time to execute is running in parallel. Then I want this gif to disappear as soon as theextraxtMeta()
function completed execution.
How can I do so?
I have read that QConcurrent might be a possible solution, but I am having trouble understanding how to implement this. -
I have a loading gif named
loading.gif
.
I want to display this gif in a label using QMovie, while a function namedextractMeta()
that takes some time to execute is running in parallel. Then I want this gif to disappear as soon as theextraxtMeta()
function completed execution.
How can I do so?
I have read that QConcurrent might be a possible solution, but I am having trouble understanding how to implement this.hi @BigBen
thats only possible, as long as your long running function does not modify Ui-elements
but yes, QtConcurrent is one of the possible options to use
let me link you to my git repo
https://github.com/DeiVadder/QtThreadExamplethat covers all (Qt) ways of parallelisation, and should give you a good starting point
1/2