Qt6: deal with changed QtConcurrent::run API

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-09 17:08:09 -08:00
parent f9b2d4fa25
commit 3321904434

View file

@ -1087,7 +1087,11 @@ void DivePlannerPointsModel::updateDiveProfile()
// Since we're calling computeVariations asynchronously and plan_deco_state is allocated
// on the stack, it must be copied and freed by the worker-thread.
struct deco_state *plan_deco_state_copy = new deco_state(plan_deco_state);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(&DivePlannerPointsModel::computeVariationsFreeDeco, this, plan_copy, plan_deco_state_copy);
#else
QtConcurrent::run(this, &DivePlannerPointsModel::computeVariationsFreeDeco, plan_copy, plan_deco_state_copy);
#endif
#else
computeVariations(plan_copy, &plan_deco_state);
#endif