Qt: Reload icons and tooltips when game list rows change (#3609)

This commit is contained in:
Davide Pesavento
2025-11-03 22:43:47 -05:00
committed by GitHub
parent 520502dab0
commit e91db67c79
2 changed files with 6 additions and 4 deletions

View File

@@ -1506,7 +1506,7 @@ void GameList::AddPlayedTimeForSerial(const std::string& serial, std::time_t las
}
if (!changed_indices.empty())
Host::OnGameListEntriesChanged(std::span<const u32>(changed_indices.begin(), changed_indices.end()));
Host::OnGameListEntriesChanged(changed_indices);
}
void GameList::ClearPlayedTimeForSerial(const std::string& serial)

View File

@@ -476,7 +476,9 @@ void GameListModel::coverLoaded(const std::string& path, const QImage& image, fl
void GameListModel::rowsChanged(const QList<int>& rows)
{
const QList<int> roles_changed = {Qt::DisplayRole};
QList<int> roles_changed{Qt::DisplayRole, Qt::ToolTipRole};
if (m_show_game_icons)
roles_changed.append(Qt::DecorationRole);
// try to collapse multiples
size_t start = 0;
@@ -1526,8 +1528,8 @@ public:
m_animation_timer.stop();
}
emit m_model->dataChanged(m_model->index(m_source_row, GameListModel::Column_Icon),
m_model->index(m_source_row, GameListModel::Column_Icon), {Qt::DecorationRole});
const QModelIndex mi = m_model->index(m_source_row, GameListModel::Column_Icon);
emit m_model->dataChanged(mi, mi, {Qt::DecorationRole});
}
void pauseAnimation()