Repository navigation
Expand file tree
/
Copy pathshow_hdr.cpp
More file actions
73 lines (56 loc) · 2.66 KB
/
Copy pathshow_hdr.cpp
File metadata and controls
73 lines (56 loc) · 2.66 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
67
68
69
70
71
72
73
#include "show_hdr.h"
hdrwindow::hdrwindow(QWidget *w_parent)
{
mainwindow = (MainWindow *)w_parent;
// zkouska
//qDebug() << "test primeho spojeni: " << mainwindow->foo;
//int bar = mainwindow->getFoo();
//qDebug() << "test spojeni pres getter: " << bar;
//Measurement HDR = mainwindow->HDR; // prime spojeni + deklarace
//Measurement HDR = mainwindow->getHDR(); //funguje, ale zrejme, kdyz je vytvoreny setter, tak ani nemusim volat getter
//qDebug() << HDR.id;
myfont = new QFont;
myfont->setFamily("Tahoma");
myfont->setPixelSize(21);
//QApplication::setFont(*myfont); // changes it everywhere
QTextCodec *codec = QTextCodec::codecForName("Windows-1250");
AboutDialog = new QDialog;
AboutDialog->setMinimumSize(640, 480);
AboutDialog->setGeometry(300, 250, 640, 480);
AboutDialog->setWindowTitle("Patient info");
AboutDialog->setModal(true);
AboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
AboutDialog->setSizeGripEnabled(true);
QLabel *label[7];
label[0] = new QLabel (QString("ID: %1").arg(mainwindow->signal.measurement.id));
QString name = codec->toUnicode(mainwindow->signal.measurement.name);
label[1] = new QLabel (QString("Name: %1").arg(name));
QString doctor = codec->toUnicode(mainwindow->signal.measurement.doctor);
label[2] = new QLabel (QString("Doctor: %1").arg(doctor));
QString technician = codec->toUnicode(mainwindow->signal.measurement.technician);
label[3] = new QLabel (QString("Technician: %1").arg(technician));
label[4] = new QLabel (QString("Sex: %1").arg(mainwindow->signal.measurement.sex));
QDateTime qtime = decode_date_time(mainwindow->signal.measurement.start_date, mainwindow->signal.measurement.start_hour);
//qDebug() << ctime(&epoch);
//qDebug() << qtime;
label[5] = new QLabel (QString("Start time: %1").arg(qtime.toString("dd. MM. yyyy hh:mm")));
label[6] = new QLabel (QString("Recorder name: %1").arg(mainwindow->signal.recorder_info.name));
pushButton1 = new QPushButton;
QString close = codec->toUnicode("Zavøít");
pushButton1->setText(close);
//TO DO: simplify this layout
hlayout1 = new QHBoxLayout;
hlayout1->insertStretch(0, 100);
hlayout1->addWidget(pushButton1);
vlayout1 = new QVBoxLayout;
for (int i=0;i<7;i++) {
label[i]->setFont(*myfont);
vlayout1->addWidget(label[i]);
}
//vlayout1->setStretchFactor(textedit1, 100);
vlayout1->addLayout(hlayout1);
//vlayout1->setStretchFactor(hlayout1, 0);
AboutDialog->setLayout(vlayout1);
QObject::connect(pushButton1, SIGNAL(clicked()), AboutDialog, SLOT(close()));
AboutDialog->exec();
}