-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.hpp
More file actions
30 lines (24 loc) · 767 Bytes
/
common.hpp
File metadata and controls
30 lines (24 loc) · 767 Bytes
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
#ifndef TEXTUREMAPPERCQT_COMMON_HPP
#define TEXTUREMAPPERCQT_COMMON_HPP
#include <QtCore/QFile>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QTextEdit>
#include <QThread>
QFile *file_log;
QScopedPointer<QFile> buffer_log;
QString hash_from_int(QVariant number) {
return QString("%1").arg(number.toUInt(), 8, 16, QChar('0')).toUpper().prepend("0x");
}
QString int_to_grade(const QVariant &g) {
switch (g.toInt()) {
case -1: return "<font color=\"yellow\">u</font>";
case 0: return "<font>a</font>";
case 1: return "<font color=\"orange\">b</font>";
case 2: return "<font color=\"red\">c</font>";
case 3: return "<font>s</font>";
}
return nullptr;
}
#endif