1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef SOURCECODEVIEW_H |
5 | #define SOURCECODEVIEW_H |
6 | |
7 | #include <QDir> |
8 | #include <QHash> |
9 | #include <QPlainTextEdit> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class SourceCodeView : public QPlainTextEdit |
14 | { |
15 | Q_OBJECT |
16 | public: |
17 | SourceCodeView(QWidget *parent = 0); |
18 | void setSourceContext(const QString &fileName, const int lineNum); |
19 | |
20 | public slots: |
21 | void setActivated(bool activated); |
22 | |
23 | private: |
24 | void showSourceCode(const QString &fileName, const int lineNum); |
25 | |
26 | bool m_isActive; |
27 | QString m_fileToLoad; |
28 | int m_lineNumToLoad; |
29 | QString m_currentFileName; |
30 | |
31 | QHash<QString, QString> fileHash; |
32 | }; |
33 | |
34 | QT_END_NAMESPACE |
35 | |
36 | #endif // SOURCECODEVIEW_H |
37 |