-
Notifications
You must be signed in to change notification settings - Fork 1
/
utilities.h
43 lines (33 loc) · 1007 Bytes
/
utilities.h
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
#ifndef UTILITIES_H
#define UTILITIES_H
#include <QList>
#include <QString>
#include <QChar>
#include <QSyntaxHighlighter>
#include <QTextBrowser>
#include <QRegExp>
const QString DEFAULT_AFR_TABLE_FILEPATH = ":/AFR_TABLE.csv";
const QString DEFAULT_LABEL_LIST_FILEPATH = ":/LABEL_LIST.csv";
const QString DEFAULT_LOGO_FILEPATH = ":/SupermileageLogo.png";
bool loadCSV(QString filename, QList<QList<QString>>& allFields);
double mean(QVector<double> in);
class Highlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
Highlighter(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
private:
struct HighlightingRule
{
QRegExp pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QRegExp delimiterExpression;
QTextCharFormat delimiterFormat;
QRegExp fieldExpression;
QTextCharFormat fieldFormat;
};
#endif // UTILITIES_H