-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
executable file
·66 lines (50 loc) · 1.21 KB
/
mainwindow.cpp
File metadata and controls
executable file
·66 lines (50 loc) · 1.21 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
58
59
60
61
62
63
64
65
66
#include "mainwindow.h"
#include <QAction>
#include <QMenuBar>
#include <QMessageBox>
#include <QStatusBar>
#include <QToolBar>
#include "iozone/iozone_event.h"
#include "iozone/iozone_widget.h"
#include "postmark/postmark_widget.h"
#include "postmark/postmark_event.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QTabWidget * tabwidget = new QTabWidget(this);
setCentralWidget(tabwidget);
widget1 = new iozoneWidget(this);
widget2 = new postmarkWidget(this);
//QIcon icon1(":/icons/iozone_tab.png");
tabwidget->addTab(widget1, "Iozone");
//QIcon icon2(":/icons/postmark.png");
tabwidget->addTab(widget2, "Postmark");
this->resize(860, 680);
this->setWindowTitle("DiskTest");
}
MainWindow::~MainWindow()
{
}
bool MainWindow::event(QEvent *e)
{
if (e->type() == ioZoneEvent::ioZoneEventType)
{
widget1->myEventHandle(e);
if (e->isAccepted())
{
return true;
}
}
else if (e->type() == postmarkEvent::postmarkEventType)
{
widget2->myEventHandle(e);
if (e->isAccepted())
{
return true;
}
}
else
{
return QMainWindow::event(e);
}
}