forked from CodElecCz/CameraUIv1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindowDio.cpp
43 lines (33 loc) · 1.16 KB
/
MainWindowDio.cpp
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
#include <QDockWidget>
#include <QTextBrowser>
#include "MainWindow.h"
#include "DioView.h"
#include "ui_MainWindow.h"
void MainWindow::createDioWindow(bool showWindow)
{
QDockWidget *dock = new QDockWidget(tr("Digital IO"), this);
dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
leftDockTabbing.insert(dock->windowTitle(), dock);
dio = new DioView(dock);
dock->setWidget(dio);
// dock->resize(250,400);
addDockWidget(Qt::LeftDockWidgetArea, dock);
if(leftDockTabbing.size()>2)
tabifyDockWidget(leftDockTabbing.values().at(leftDockTabbing.size()-1), leftDockTabbing.values().at(1));
ui->menuTools->addAction(dock->toggleViewAction());
//resize Qt buck
dock->setFloating(true);
dock->hide();
dock->setFloating(false);
if(showWindow)
dock->show();
connect(dio, SIGNAL(addTrace(QString,QColor)), this, SLOT(addTrace(QString,QColor)));
}
void MainWindow::closeDio()
{
if(dio)
{
disconnect(dio, SIGNAL(addTrace(QString,QColor)), this, SLOT(addTrace(QString,QColor)));
dio->DioClose();
}
}