Skip to content

Commit

Permalink
Send pixmap to main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Mm2PL committed May 1, 2024
1 parent 0aad901 commit f511abb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/moderationactions/ModerationActionModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "controllers/moderationactions/ModerationAction.hpp"
#include "messages/Image.hpp"
#include "util/LoadPixmapLazy.hpp"
#include "util/PostToThread.hpp"
#include "util/StandardItemHelper.hpp"

#include <QIcon>
Expand Down Expand Up @@ -35,7 +36,9 @@ void ModerationActionModel::getRowFromItem(const ModerationAction &item,
{
loadPixmapFromUrlLazy(
(*item.getImage())->url(), [row](const QPixmap &pixmap) {
row[Column::Icon]->setData(pixmap, Qt::DecorationRole);
postToThread([row, pixmap]() {
row[Column::Icon]->setData(pixmap, Qt::DecorationRole);
});
});
}
}
Expand Down

0 comments on commit f511abb

Please sign in to comment.