From 9acfff1792cf9aa13d6dc213369ac620a203c22a Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 16:45:26 +1000 Subject: Use ShellMode for creator plugin expression widget. --- tools/qmldebugger/creatorplugin/qmlinspectormode.cpp | 2 +- tools/qmldebugger/standalone/expressionquerywidget.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index a90ca2c..5881cd1 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -385,7 +385,7 @@ void QmlInspectorMode::initWidgets() m_propertiesWidget = new ObjectPropertiesView; m_watchTableView = new WatchTableView(m_watchTableModel); m_frameRateWidget = new CanvasFrameRate; - m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode); + m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::ShellMode); // FancyMainWindow uses widgets' window titles for tab labels m_objectTreeWidget->setWindowTitle(tr("Object Tree")); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.cpp b/tools/qmldebugger/standalone/expressionquerywidget.cpp index 3c4296d..e064189 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.cpp +++ b/tools/qmldebugger/standalone/expressionquerywidget.cpp @@ -42,6 +42,7 @@ ExpressionQueryWidget::ExpressionQueryWidget(Mode mode, QmlEngineDebug *client, m_lineEdit->installEventFilter(this); } else { m_textEdit->installEventFilter(this); + appendPrompt(); } } @@ -55,6 +56,8 @@ void ExpressionQueryWidget::clear() m_textEdit->clear(); if (m_lineEdit) m_lineEdit->clear(); + if (m_mode == ShellMode) + appendPrompt(); } void ExpressionQueryWidget::updateTitle() @@ -99,6 +102,12 @@ void ExpressionQueryWidget::checkCurrentContext() void ExpressionQueryWidget::showCurrentContext() { + if (m_mode == ShellMode) { + // clear the initial prompt + if (m_textEdit->document()->lineCount() == 1) + m_textEdit->clear(); + } + m_textEdit->moveCursor(QTextCursor::End); m_textEdit->setTextColor(Qt::darkGreen); m_textEdit->append(m_currObject.className() -- cgit v0.12