From e26b248ca1c5c7b9165c560f02ff1d231b71cd96 Mon Sep 17 00:00:00 2001 From: AlexeyPeov <111562626+AlexeyPeov@users.noreply.github.com> Date: Sat, 5 Apr 2025 18:02:32 +0300 Subject: [PATCH] Update entire CImageTreeModel table on compression finish. --- src/MainWindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 07d4ecd..3d2928c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -629,6 +629,16 @@ void MainWindow::startCompression(bool onlyFailed) this->compressionWatcher = new QFutureWatcher(); connect(this->compressionWatcher, &QFutureWatcherBase::finished, this, &MainWindow::compressionFinished); + + connect(this->compressionWatcher, &QFutureWatcherBase::finished, [this] { + + size_t rowCount = this->cImageModel->rowCount(); + + for(size_t i = 0; i < rowCount; ++i) { + this->cImageModel->emitDataChanged(i); + } + }); + connect(this->compressionWatcher, &QFutureWatcherBase::progressValueChanged, this->cImageModel, &CImageTreeModel::emitDataChanged); connect(this->compressionWatcher, &QFutureWatcherBase::progressValueChanged, this, &MainWindow::updateCompressionProgressLabel);