-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustomwidgets.h
71 lines (53 loc) · 1.25 KB
/
customwidgets.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
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
#ifndef CUSTOMWIDGETS_H
#define CUSTOMWIDGETS_H
#include <QObject>
#include <QWidget>
#include <QtGui>
#include <QtCore>
#include <QtGlobal>
#include <QPlainTextEdit>
#include "CustomColor.h"
#if defined(_WIN32) || defined(_WIN64)
#define NEWLINE "\r\n"
#elif defined(__APPLE__)
#define NEWLINE "\n"
#elif defined(__linux__)
#define NEWLINE "\n"
#else
#define NEWLINE "\n"
#endif
/**
* @brief The CustomFileBrowser class
*/
class CustomFileBrowser: public QWidget
{
Q_OBJECT
private:
private slots:
void clicked_browse_();
public:
CustomFileBrowser(QWidget *parent_=nullptr);
};
/**
* @brief The FastLogViewer class
*/
class FastLogViewer: public QPlainTextEdit
{
Q_OBJECT
private:
unsigned int maxLineCount_ = 50000;
unsigned int refrashRate_;
QList<QString> bufferedLines;
QTimer *updateTimer_;
unsigned int getMaximumLine_() const;
void setMaximumLine_(unsigned int lineCount);
public:
FastLogViewer(QWidget *parent_=nullptr);
void setMaximumLine(unsigned int lineCount);
void setRefreshRate(unsigned int refreshRate);
void addRaw(const QString &newRaw);
void addRaw(const QList<QString> &newRaws);
void updateContent();
void clearContent();
};
#endif // CUSTOMWIDGETS_H