summaryrefslogtreecommitdiffhomepage
path: root/tracker-rs/imagewidget.cpp
diff options
context:
space:
mode:
authorXavier Hallade <xavier.hallade@intel.com>2016-02-12 10:46:39 +0100
committerXavier Hallade <xavier.hallade@intel.com>2016-02-12 10:46:39 +0100
commit61a58641089b07b23910c94c677e262388039fb9 (patch)
tree48fa2bdae749e5cfb831b902924ae46942f5b862 /tracker-rs/imagewidget.cpp
parent652bdad279f7769523d3c6faa609448028907256 (diff)
tracker/rs: cleaned up preview widget setup and deletetion.
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());
}