pgLab/pglab/CodeEditor.h
eelke 47ee1857cd Added a gutter and currentline highlighting to the SQL editor.
Currently gutter only shows linenumbers. Code is mostly from http://doc.qt.io/qt-5/qtwidgets-widgets-codeeditor-example.html

There is a little bit included in this commit from a first try to make toobars adept to the current tab.

Code #2
2018-04-08 09:19:32 +02:00

31 lines
539 B
C++

#ifndef CODEEDITOR_H
#define CODEEDITOR_H
#include <QPlainTextEdit>
class CodeEditor : public QPlainTextEdit
{
Q_OBJECT
public:
explicit CodeEditor(QWidget *parent = nullptr);
void gutterAreaPaintEvent(QPaintEvent *event);
int gutterAreaWidth();
protected:
void resizeEvent(QResizeEvent *event) override;
signals:
public slots:
private slots:
void updateGutterAreaWidth(int newBlockCount);
void highlightCurrentLine();
void updateGutterArea(const QRect &, int);
private:
QWidget *gutterArea;
};
#endif // CODEEDITOR_H