summaryrefslogtreecommitdiff
path: root/src/editor.h
blob: 115801de08eb5f60a853d91b3d12316c386bcdc0 (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
#ifdef _QCODE_EDIT_
#include <qeditor.h>
class Editor : public QEditor
#else
#include <QTextEdit>
class Editor : public QTextEdit
#endif
{
public:
#ifdef _QCODE_EDIT_
	Editor(QWidget *parent) : QEditor(parent) {}
	QString toPlainText() const { return text(); }
	void setPlainText(const QString& text) { setText(text); }  
#else
	Editor(QWidget *parent) : QTextEdit(parent) {}
	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();
#endif
};
contact: Jan Huwald // Impressum