diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-04-03 03:05:14 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-04-03 03:05:14 (GMT) |
commit | 9f582257544a6b81097c5aded4ae912faf112475 (patch) | |
tree | 9568b7871c741d14c1595c259e83fce94fca0a5f /src/editor.h | |
parent | 1fb93c298546a28c4653007ff4a74ab703f73e46 (diff) |
Changes that were supposed to be commited in last commit
git-svn-id: http://svn.clifford.at/openscad/trunk@501 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/editor.h')
-rw-r--r-- | src/editor.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/editor.h b/src/editor.h index c9450ce..115801d 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,7 +1,24 @@ #ifdef _QCODE_EDIT_ #include <qeditor.h> -#define EDITOR QEditor +class Editor : public QEditor #else -#include <QTextEditor> -#define EDITOR QTextEditor +#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 +}; |