summaryrefslogtreecommitdiff
path: root/src/editor.h
blob: 8d092a9ad26aa9e0a2c058f54a33bc09f5e937b0 (plain)
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
#include <QObject>
#include <QString>
#include <QWidget>
#include <QWheelEvent>
#include <QScrollBar>

#include <QTextEdit>
class Editor : public QTextEdit
{
	Q_OBJECT
public:
	Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); }
	void setPlainText(const QString &text);
public slots:
	void zoomIn();
	void zoomOut();
	void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); }
	void setContentModified(bool y) { document()->setModified(y); }
	bool isContentModified() { return document()->isModified(); }
	void indentSelection();
	void unindentSelection();
	void commentSelection();
	void uncommentSelection();
private:
	void wheelEvent ( QWheelEvent * event );
};
contact: Jan Huwald // Impressum