summaryrefslogtreecommitdiffhomepage
path: root/tracker-rs/ftnoir_tracker_rs.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/ftnoir_tracker_rs.cpp
parent652bdad279f7769523d3c6faa609448028907256 (diff)
tracker/rs: cleaned up preview widget setup and deletetion.
Diffstat (limited to 'tracker-rs/ftnoir_tracker_rs.cpp')
-rw-r--r--tracker-rs/ftnoir_tracker_rs.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tracker-rs/ftnoir_tracker_rs.cpp b/tracker-rs/ftnoir_tracker_rs.cpp
index d8d12210..99c5e9d0 100644
--- a/tracker-rs/ftnoir_tracker_rs.cpp
+++ b/tracker-rs/ftnoir_tracker_rs.cpp
@@ -26,6 +26,8 @@ void RSTracker::configurePreviewFrame()
if(mImageWidget!=nullptr || mPreviewFrame==nullptr)
return;
+ mPreviewFrame->show();
+
mImageWidget = new ImageWidget(mPreviewFrame);
mImageWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
@@ -35,19 +37,20 @@ void RSTracker::configurePreviewFrame()
QLayout* layout = new QStackedLayout();
mPreviewFrame->setLayout(layout);
-
layout->addWidget(mImageWidget);
+
+ mImageWidget->show();
}
void RSTracker::start_tracker(QFrame* previewFrame)
{
mPreviewFrame = previewFrame;
- mTrackerWorkerThread.start(QThread::HighPriority);
-
configurePreviewFrame();
startPreview();
+
+ mTrackerWorkerThread.start(QThread::HighPriority);
}
void RSTracker::startPreview(){
@@ -55,7 +58,7 @@ void RSTracker::startPreview(){
}
void RSTracker::updatePreview(){
- if(mImageWidget->isEnabled())
+ if(mImageWidget!=nullptr && mImageWidget->isEnabled())
mImageWidget->setImage(mTrackerWorkerThread.getPreview());
}
@@ -107,6 +110,9 @@ void RSTracker::data(double *data)
RSTracker::~RSTracker() {
stopPreview();
+ if(mImageWidget!=nullptr)
+ delete mImageWidget;
+
if (mPreviewFrame!=nullptr && mPreviewFrame->layout()!=nullptr)
delete mPreviewFrame->layout();