summaryrefslogtreecommitdiff
path: root/src/codeeditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/codeeditor.h')
-rw-r--r--src/codeeditor.h28
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__*/