diff options
author | Xavier Hallade <xavier.hallade@intel.com> | 2016-02-12 10:46:39 +0100 |
---|---|---|
committer | Xavier Hallade <xavier.hallade@intel.com> | 2016-02-12 10:46:39 +0100 |
commit | 61a58641089b07b23910c94c677e262388039fb9 (patch) | |
tree | 48fa2bdae749e5cfb831b902924ae46942f5b862 /tracker-rs/imagewidget.cpp | |
parent | 652bdad279f7769523d3c6faa609448028907256 (diff) |
tracker/rs: cleaned up preview widget setup and deletetion.
Diffstat (limited to 'tracker-rs/imagewidget.cpp')
-rw-r--r-- | tracker-rs/imagewidget.cpp | 9 |
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()); } |