-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdiffdialog.h
More file actions
97 lines (75 loc) · 2.36 KB
/
Copy pathdiffdialog.h
File metadata and controls
97 lines (75 loc) · 2.36 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef DIFFDIALOG_H
#define DIFFDIALOG_H
#include <QDialog>
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
#include <QStringList>
#include <QTableWidget>
#include <QRegularExpression>
#include <QSyntaxHighlighter>
#include <QtCore>
#include <QtGui>
#include <QScrollBar>
#include <QFileDialog>
#include <QMessageBox>
#include <QProcess>
namespace Ui {
class diffDialog;
}
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 commentStartExpression;
QRegExp commentEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat classFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat multiLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat numberFormat;
QTextCharFormat functionFormat;
};
class diffDialog : public QDialog
{
Q_OBJECT
public:
explicit diffDialog(QWidget *parent = 0, QString filename1 = 0, QString filename2 = 0);
~diffDialog();
private slots:
void on_connectButton_clicked();
void on_deleteButton_clicked();
void on_exportButton_clicked();
void on_tableView_doubleClicked(const QModelIndex &index);
void on_tableView_2_doubleClicked(const QModelIndex &index);
private:
Ui::diffDialog *ui;
QStandardItemModel *model1;
QStandardItemModel *model2;
QStandardItemModel *modelListRules;
void readFilesToLineList(QTextStream &in, QList<QStringList> &list);
void writeTxtDataToModel(QStandardItemModel *module, QList<QStringList> &list);
int getColumnByRegExp(QStandardItemModel *module, QRegExp &re);
void setAndConfigureView(QTableView *tabView, QStandardItemModel *module);
void createConfigureAndSetRuleView(QTableView *tabView);
void autoMapSuggestions();
void syncFileNamesToScroll(QStandardItemModel *inModel1, QStandardItemModel *inModel2);
void populateColumnIdentifyersByReExp();
Highlighter *highlighter;
QString fileNameOne;
QString fileNameTwo;
int shaColumn1, fileNameColumn1, lineColumn1, shaColumn2, fileNameColumn2, lineColumn2 = -1;
QMap<int, int> autoMap;
};
#endif // DIFFDIALOG_H