From 724c672170707ef2c9580283e4dd9b77dfcf4eac Mon Sep 17 00:00:00 2001 From: Nicolas Ulrich Date: Thu, 13 May 2021 22:06:36 +0200 Subject: [PATCH] Make sure we run on correct thread. Reverts previous change --- lib/zpointcloud/src/zpointcloudlistmodel.cpp | 25 ++++++++------------ 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/zpointcloud/src/zpointcloudlistmodel.cpp b/lib/zpointcloud/src/zpointcloudlistmodel.cpp index 03642854..e766ae01 100644 --- a/lib/zpointcloud/src/zpointcloudlistmodel.cpp +++ b/lib/zpointcloud/src/zpointcloudlistmodel.cpp @@ -70,27 +70,20 @@ ZPointCloudListModel::ZPointCloudListModel(QObject *parent) // this, &ZPointCloudListModel::beginRemoveColumns); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsAboutToBeMoved, - this, &ZPointCloudListModel::rowsAboutToBeMoved, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsAboutToBeMoved); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsAboutToBeRemoved, - this, &ZPointCloudListModel::rowsAboutToBeRemoved, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsAboutToBeRemoved); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsAboutToBeInserted, - this, &ZPointCloudListModel::rowsAboutToBeInserted, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsAboutToBeInserted); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsMoved, - this, &ZPointCloudListModel::rowsMoved, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsMoved); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsRemoved, - this, &ZPointCloudListModel::rowsRemoved, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsRemoved); QObject::connect(m_p, &ZPointCloudListModelPrivate::rowsInserted, - this, &ZPointCloudListModel::rowsInserted, - Qt::QueuedConnection); + this, &ZPointCloudListModel::rowsInserted); QObject::connect(m_p, &ZPointCloudListModelPrivate::dataChanged, - this, &ZPointCloudListModel::dataChanged, - Qt::QueuedConnection); + this, &ZPointCloudListModel::dataChanged); } ZPointCloudListModel::~ZPointCloudListModel() @@ -120,7 +113,9 @@ void ZPointCloudListModel::addPointClouds(const std::vectorappend(list); + QMetaObject::invokeMethod(m_p, [=](){ + m_p->append(list); + }, Qt::QueuedConnection); } int ZPointCloudListModel::rowCount(const QModelIndex &parent) const