-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
exifinfo.cpp
89 lines (76 loc) · 2.55 KB
/
exifinfo.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/** @file exifinfo.cpp
* Soubor s tridou ExifInfo dedici ze trify QDockWidget pro zobrazeni seznamu metadat fotografie
*/
#include "exifinfo.h"
ExifInfo::ExifInfo(QWidget* parent)
: QDockWidget(parent)
{
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
this->setWindowTitle(tr("EXIF Info"));
tw = new QTreeWidget;
setVisible(false);
tw->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
tw->setHeaderLabels(QStringList() << tr("parameter") << tr("value"));
tw->setSelectionMode(QAbstractItemView::NoSelection);
this->setWidget(tw);
QBrush base("#F8FFFF");
QBrush altBase("#EEFFFF");
QStringList labels = labelNames();
for (int i = 0; i < labels.length(); i++) {
QTreeWidgetItem* twtmp = new QTreeWidgetItem(tw);
twtmp->setText(0, labels.at(i));
twtmp->setBackground(0, i % 2 ? base : altBase);
twtmp->setBackground(1, i % 2 ? base : altBase);
tw->setIndentation(0);
itemsList.append(twtmp);
}
}
QStringList ExifInfo::labelNames()
{
QStringList labelsNames;
labelsNames << tr("Picture name")
<< tr("Path to file")
<< tr("Date and time")
<< tr("Latitude")
<< tr("Longitude")
<< tr("Altitude")
<< tr("Direction")
<< tr("Pitch")
<< tr("Roll")
<< tr("Destination Latitude")
<< tr("Destination Longitude")
<< tr("Camera make")
<< tr("Camera model")
<< tr("Exposure time")
<< tr("Exposure Bias")
<< tr("Exposure Program")
<< tr("Resolution")
<< tr("Flash")
<< tr("F-number (F-stop)")
<< tr("Metering mode")
<< tr("ISO speed")
<< tr("Focal length")
<< tr("Exif comment");
return labelsNames;
}
void ExifInfo::retranslateUi()
{
tw->setHeaderLabels(QStringList() << tr("parameter") << tr("value"));
QStringList labels = labelNames();
for (int i = 0; i < labels.length() && i < itemsList.length(); i++) {
itemsList.at(i)->setText(0, labels.at(i));
}
}
void ExifInfo::setNewInfo(QStringList exifList)
{
while (exifList.length() < itemsList.length()) {
exifList.append("");
}
for (int i = 0; i < exifList.length() && i < itemsList.length(); i++) {
itemsList.at(i)->setText(1, exifList.at(i));
}
}
QSize ExifInfo::sizeHint()
{
return QSize(900, 1000);
}