-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatlab_widget.cpp
More file actions
executable file
·57 lines (47 loc) · 1.67 KB
/
matlab_widget.cpp
File metadata and controls
executable file
·57 lines (47 loc) · 1.67 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
57
#include "matlab_widget.hpp"
MatlabWidget::MatlabWidget(QWidget *parent):QWidget(parent){
// Initialize tab views
proView = nullptr;
log = new LogView();
general = new GeneralViewMA(log);
core = new CoreMA(this, general, log);
QObject::connect(general, &GeneralViewMA::run, core, &CoreMA::runMatlab);
tabView = new QTabWidget();
tabView->addTab(general, "General");
tabView->addTab(log, "Log History");
switchButton = new QPushButton("Switch to Python Version");
QObject::connect(switchButton, &QPushButton::clicked, this, &MatlabWidget::closeWindow);
infoButton = new QToolButton();
infoButton->setIcon(style()->standardIcon(QStyle::SP_FileDialogInfoView));
infoButton->setStyleSheet("border-radius: 13px");
QObject::connect(infoButton, &QPushButton::clicked, this, &MatlabWidget::infoClicked);
QGridLayout *layout = new QGridLayout();
layout->addWidget(tabView, 0, 0, 5, 5);
layout->addWidget(infoButton, 5, 3, Qt::AlignRight);
layout->addWidget(switchButton, 5, 4, Qt::AlignRight);
setLayout(layout);
setWindowTitle("CellTrack_GUI -- Matlab");
resize(800, 650);
}
void MatlabWidget::closeEvent(QCloseEvent *event) {
QWidget::closeEvent(event);
}
void MatlabWidget::closeWindow() {
createView(2);
close();
}
void MatlabWidget::infoClicked() {
QDialog *dialog;
switch (tabView->currentIndex()) {
case 0:
dialog = new HelperWidget("ma_general");
break;
case 1:
dialog = new HelperWidget("log");
break;
default:
dialog = new HelperWidget("");
break;
}
dialog->exec();
}