Qt: multithreaded icon resize

This commit is contained in:
Megamouse 2019-07-27 14:37:54 +02:00
parent 6867fc5f06
commit 5b59c18dcc
6 changed files with 237 additions and 199 deletions

View file

@ -17,6 +17,7 @@
#include <set>
#include <regex>
#include <QtConcurrent>
#include <QDesktopServices>
#include <QHeaderView>
#include <QMenuBar>
@ -1601,11 +1602,16 @@ void game_list_frame::RepaintIcons(const bool& fromSettings)
}
}
for (auto& game : m_game_data)
QList<int> indices;
for (int i = 0; i < m_game_data.size(); ++i)
indices.append(i);
QtConcurrent::blockingMap(indices, [this](int& i)
{
auto game = m_game_data[i];
QColor color = getGridCompatibilityColor(game->compat.color);
game->pxmap = PaintedPixmap(game->icon, game->hasCustomConfig, game->hasCustomPadConfig, color);
}
});
Refresh();
}