ScriptConsole: Move from Debugger to QmlJSTools

The console is now a part of qmljstools plugin. The console
appears as an output pane. A dummy QScriptEngine evaluates
expressions when a declarative debug session is not in
progress. During a debug session, the expressions are
evaluated by the debug services.

Task-Number: QTCREATORBUG-7402

Change-Id: Ic2eeac44fb335c706be03b89f8672b0356efe984
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Aurindam Jana
2012-10-04 14:54:59 +02:00
committed by hjk
parent 614bb33589
commit 9ac25a2932
54 changed files with 1779 additions and 1872 deletions

View File

@@ -0,0 +1,45 @@
#ifndef QMLCONSOLEEDIT_H
#define QMLCONSOLEEDIT_H
#include "qmljsinterpreter.h"
#include <QTextEdit>
#include <QModelIndex>
namespace QmlJSTools {
namespace Internal {
class QmlConsoleEdit : public QTextEdit
{
Q_OBJECT
public:
QmlConsoleEdit(const QModelIndex &index, QWidget *parent);
QString getCurrentScript() const;
protected:
void keyPressEvent(QKeyEvent *e);
void contextMenuEvent(QContextMenuEvent *event);
void focusOutEvent(QFocusEvent *e);
signals:
void editingFinished();
protected:
void handleUpKey();
void handleDownKey();
void replaceCurrentScript(const QString &script);
private:
QModelIndex m_historyIndex;
QString m_cachedScript;
QImage m_prompt;
int m_startOfEditableArea;
QmlJSInterpreter m_interpreter;
};
} // QmlJSTools
} // Internal
#endif // QMLCONSOLEEDIT_H