-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSLVideoDialog.cpp
More file actions
56 lines (39 loc) · 1.23 KB
/
SLVideoDialog.cpp
File metadata and controls
56 lines (39 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "SLVideoDialog.h"
#include "ui_SLVideoDialog.h"
#include <QSettings>
SLVideoDialog::SLVideoDialog(const QString &title, QWidget *parent) : QDialog(parent),ui(new Ui::SLVideoDialog){
ui->setupUi(this);
//this->setWindowFlags(Qt::Window);
// Set window title
this->setWindowTitle(title);
// Create QDockWidget like action associated with dialog
action = new QAction(title, this);
action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), this, SLOT(setVisible(bool)));
}
// QDockWidget like, return a checkable action in sync with visibility
QAction* SLVideoDialog::toggleViewAction(){
return action;
}
void SLVideoDialog::showImageCV(cv::Mat image){
if(!action->isChecked())
return;
ui->videoWidget->showFrameCV(image);
}
void SLVideoDialog::showImageSeqCV(std::vector<cv::Mat> imageSeq){
if(!action->isChecked())
return;
cv::Mat image;
cv::hconcat(imageSeq, image);
ui->videoWidget->showFrameCV(image);
}
void SLVideoDialog::showEvent(QShowEvent *){
if(!action->isChecked())
action->setChecked(true);
}
void SLVideoDialog::closeEvent(QCloseEvent *){
action->setChecked(false);
}
SLVideoDialog::~SLVideoDialog(){
delete ui;
}