summaryrefslogtreecommitdiffhomepage
path: root/tracker-rs/imagewidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-rs/imagewidget.cpp')
-rw-r--r--tracker-rs/imagewidget.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tracker-rs/imagewidget.cpp b/tracker-rs/imagewidget.cpp
index 0136c621..63986234 100644
--- a/tracker-rs/imagewidget.cpp
+++ b/tracker-rs/imagewidget.cpp
@@ -16,12 +16,15 @@ ImageWidget::ImageWidget(QWidget *parent) :
void ImageWidget::setImage(const QImage image)
{
- mImage = image;
+ {
+ QMutexLocker lock(&mMutex);
+ mImage = image;
+ }
repaint();
}
void ImageWidget::paintEvent(QPaintEvent*)
{
- QPainter painter(this);
- painter.drawImage(rect(), mImage, mImage.rect());
+ QMutexLocker lock(&mMutex);
+ QPainter(this).drawImage(rect(), mImage, mImage.rect());
}