diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-04-03 03:05:20 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-04-03 03:05:20 (GMT) |
commit | 8aad5e448fd9b4563fa2e9e1d69cdb64017370d8 (patch) | |
tree | 60d4efc52a55a8859ba46b6f6ffe8dfc76ebeecd /src/editor.h | |
parent | b699cbd8596db1c24cf60d4d7fe4b3a025420a19 (diff) |
Fixed compile error and added zoomIn/zoomOut slots
git-svn-id: http://svn.clifford.at/openscad/trunk@503 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/editor.h')
-rw-r--r-- | src/editor.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/editor.h b/src/editor.h index 115801d..6cc7913 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,3 +1,7 @@ +#include <QObject> +#include <QString> +#include <QWidget> + #ifdef _QCODE_EDIT_ #include <qeditor.h> class Editor : public QEditor @@ -6,11 +10,17 @@ class Editor : public QEditor class Editor : public QTextEdit #endif { + Q_OBJECT public: #ifdef _QCODE_EDIT_ Editor(QWidget *parent) : QEditor(parent) {} QString toPlainText() const { return text(); } - void setPlainText(const QString& text) { setText(text); } + void setPlainText(const QString& text) { setText(text); } +public slots: + //void zoomIn() { zoom(1); } + void zoomIn(int n = 1) { zoom(n); } + //void zoomOut() { zoom(-1); } + void zoomOut(int n = 1) { zoom(-n); } #else Editor(QWidget *parent) : QTextEdit(parent) {} void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); } |