aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljstools/qmlconsoleedit.h
diff options
context:
space:
mode:
authorAurindam Jana <[email protected]>2012-10-04 14:54:59 +0200
committerhjk <[email protected]>2012-10-05 11:03:01 +0200
commit9ac25a293252a1196dad29b493add514459777a6 (patch)
tree12b2e4aa58a7f310d0596bd067f458356ad58dea /src/plugins/qmljstools/qmlconsoleedit.h
parent614bb33589aa1fade05cd1b6b32b3acc848f2fd8 (diff)
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 <[email protected]> Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/qmljstools/qmlconsoleedit.h')
-rw-r--r--src/plugins/qmljstools/qmlconsoleedit.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/plugins/qmljstools/qmlconsoleedit.h b/src/plugins/qmljstools/qmlconsoleedit.h
new file mode 100644
index 00000000000..749ed8ef0ad
--- /dev/null
+++ b/src/plugins/qmljstools/qmlconsoleedit.h
@@ -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