diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-12-26 19:53:20 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-12-26 19:53:20 +0100 |
commit | 41c30cdf376730a68fcda69b57b1139f143a5543 (patch) | |
tree | a109688cfa7d7a946d6a5268e484e220ed994af5 /src/codeeditor.h | |
parent | 1d1b1e025087fc99702beb14d70ead9291ed6470 (diff) |
Fix indentation and code-style.
Diffstat (limited to 'src/codeeditor.h')
-rw-r--r-- | src/codeeditor.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/codeeditor.h b/src/codeeditor.h index 1f0274a..a470a52 100644 --- a/src/codeeditor.h +++ b/src/codeeditor.h @@ -39,9 +39,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#ifndef __CODEEDITOR_H__ -#define __CODEEDITOR_H__ +#pragma once #include <QPlainTextEdit> #include <QObject> @@ -53,11 +51,12 @@ class QWidget; class LineNumberArea; -class CodeEditor : public QPlainTextEdit +class CodeEditor + : public QPlainTextEdit { Q_OBJECT - public: +public: CodeEditor(QWidget *parent = 0); void lineNumberAreaPaintEvent(QPaintEvent *event); @@ -67,7 +66,7 @@ protected: void resizeEvent(QResizeEvent *event); public slots: - void runningLine(int lineno); + void runningLine(int lineno); private slots: void updateLineNumberAreaWidth(int newBlockCount); @@ -76,28 +75,29 @@ private slots: private: QWidget *lineNumberArea; - int lineNumber; + int lineNumber; }; - -class LineNumberArea : public QWidget +class LineNumberArea + : public QWidget { public: - LineNumberArea(CodeEditor *editor) : QWidget(editor) { + LineNumberArea(CodeEditor *editor) : QWidget(editor) + { codeEditor = editor; } - QSize sizeHint() const { + QSize sizeHint() const + { return QSize(codeEditor->lineNumberAreaWidth(), 0); } protected: - void paintEvent(QPaintEvent *event) { + void paintEvent(QPaintEvent *event) + { codeEditor->lineNumberAreaPaintEvent(event); } private: CodeEditor *codeEditor; }; - -#endif/*__CODEEDITOR_H__*/ |