Fixed compile error and added zoomIn/zoomOut slots

git-svn-id: http://svn.clifford.at/openscad/trunk@503 b57f626f-c46c-0410-a088-ec61d464b74c
stl_dim
kintel 2010-04-03 03:05:20 +00:00
parent b699cbd859
commit 8aad5e448f
4 changed files with 16 additions and 5 deletions

View File

@ -88,10 +88,6 @@ private slots:
void actionReload();
private slots:
void editIndent();
void editUnindent();
void editComment();
void editUncomment();
void pasteViewportTranslation();
void pasteViewportRotation();
void hideEditor();

View File

@ -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); }

View File

@ -25,6 +25,7 @@
#include "highlighter.h"
#include "openscad.h" // extern int parser_error_pos;
#ifdef _QCODE_EDIT_
Highlighter::Highlighter(QDocument *parent)
#else

View File

@ -3,6 +3,10 @@
#include <QSyntaxHighlighter>
#ifdef _QCODE_EDIT_
#include "qdocument.h"
#endif
class Highlighter : public QSyntaxHighlighter
{
public: