Qt QAbstractItemModel multithreading

25 Views Asked by At

I plan to do something like this:

    QtConcurrent::map(rowsPool, [this](int nRow) {
        MyDataPtr spData;
        {
            QMutexLocker locker(&gModelMutex);
            const auto modelIndex = pModel->index(nRow, eData1);
            spData = pModel->data(modelIndex, eData2).value<MyDataPtr>();
        }
        ....
    }

Would this be the right approach?

0

There are 0 best solutions below