-
Notifications
You must be signed in to change notification settings - Fork 0
/
widget.cpp
68 lines (35 loc) · 1.04 KB
/
widget.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
44
45
46
47
48
49
#include "widget.h"
#include "func.h"
Widget::Widget(QWidget *parent) : QWidget(parent)
{
setUI();
connect(start, SIGNAL(clicked()), this, SLOT(startAlgorithm()));
}
Widget::~Widget()
{
}
void Widget::setUI() {
srcLabel = new QLabel;
srcImage = new QImage("E:/Yun/proj/qt/hp-sift/lena.tif");
srcLabel->setPixmap(QPixmap::fromImage(*srcImage));
outLabel = new QLabel;
outImage = new QImage(*srcImage);
outLabel->setPixmap(QPixmap::fromImage(*outImage));
QHBoxLayout* hLay1 = new QHBoxLayout;
hLay1->addWidget(srcLabel);
hLay1->addWidget(outLabel);
start = new QPushButton("Start");
timeConsume = new QLineEdit();
QLabel* timeUnit = new QLabel("ms");
QHBoxLayout* hLay2 = new QHBoxLayout;
hLay2->addWidget(start);
hLay2->addWidget(timeConsume);
hLay2->addWidget(timeUnit);
QVBoxLayout* vLay = new QVBoxLayout;
vLay->addLayout(hLay1);
vLay->addLayout(hLay2);
setLayout(vLay);
setAttribute(Qt::WA_DeleteOnClose);
}
void Widget::startAlgorithm() {
}