diff options
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 +}; |