2010-04-03 07:05:05 +04:00
|
|
|
#ifdef _QCODE_EDIT_
|
|
|
|
#include <qeditor.h>
|
2010-04-03 07:05:14 +04:00
|
|
|
class Editor : public QEditor
|
2010-04-03 07:05:05 +04:00
|
|
|
#else
|
2010-04-03 07:05:14 +04:00
|
|
|
#include <QTextEdit>
|
|
|
|
class Editor : public QTextEdit
|
2010-04-03 07:05:05 +04:00
|
|
|
#endif
|
2010-04-03 07:05:14 +04:00
|
|
|
{
|
|
|
|
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
|
|
|
|
};
|