From cad7d4367895eb8e99137a9a05542738bc2434ed Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Fri, 27 Mar 2009 17:31:58 +0100
Subject: [PATCH] debugger: use QPlainTextEdit instead of QTextEdit for output
 pane

---
 src/plugins/debugger/debuggeroutputwindow.cpp | 14 +++++++-------
 src/plugins/debugger/debuggeroutputwindow.h   |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp
index 37799215354..11b2a1fb0a3 100644
--- a/src/plugins/debugger/debuggeroutputwindow.cpp
+++ b/src/plugins/debugger/debuggeroutputwindow.cpp
@@ -60,11 +60,11 @@ using namespace Debugger::Internal;
 //
 /////////////////////////////////////////////////////////////////////
 
-class DebuggerPane : public QTextEdit
+class DebuggerPane : public QPlainTextEdit
 {
 public:
     DebuggerPane(QWidget *parent)
-        : QTextEdit(parent)
+        : QPlainTextEdit(parent)
     {
         m_clearContentsAction = new QAction(this);
         m_clearContentsAction->setText("Clear contents");
@@ -133,7 +133,7 @@ private:
         else if (ev->modifiers() == Qt::ControlModifier && ev->key() == Qt::Key_R)
             emit clearContentsRequested();
         else
-            QTextEdit::keyPressEvent(ev);
+            QPlainTextEdit::keyPressEvent(ev);
     }
 
     void mouseDoubleClickEvent(QMouseEvent *ev) 
@@ -163,13 +163,13 @@ private:
     void focusInEvent(QFocusEvent *ev)  
     {
         emit statusMessageRequested("Type Ctrl-<Return> to execute a line.", -1);
-        QTextEdit::focusInEvent(ev);
+        QPlainTextEdit::focusInEvent(ev);
     }
 
     void focusOutEvent(QFocusEvent *ev)  
     {
         emit statusMessageRequested(QString(), -1);
-        QTextEdit::focusOutEvent(ev);
+        QPlainTextEdit::focusOutEvent(ev);
     }
 
     QAction *m_commandExecutionAction;
@@ -274,7 +274,7 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp
         const int n = 3000;
         if (line.size() > n)
             line = line.left(n) + " [...] <cut off>";
-        m_combinedText->append(prefix + line);
+        m_combinedText->appendPlainText(prefix + line);
     }
     QTextCursor cursor = m_combinedText->textCursor();
     cursor.movePosition(QTextCursor::End);
@@ -285,7 +285,7 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp
 void DebuggerOutputWindow::showInput(const QString &prefix, const QString &input)
 {
     Q_UNUSED(prefix);
-    m_inputText->append(input);
+    m_inputText->appendPlainText(input);
     QTextCursor cursor = m_inputText->textCursor();
     cursor.movePosition(QTextCursor::End);
     m_inputText->setTextCursor(cursor);
diff --git a/src/plugins/debugger/debuggeroutputwindow.h b/src/plugins/debugger/debuggeroutputwindow.h
index 4f8edbd0d1f..50df8f10177 100644
--- a/src/plugins/debugger/debuggeroutputwindow.h
+++ b/src/plugins/debugger/debuggeroutputwindow.h
@@ -32,7 +32,7 @@
 
 #include <QtGui/QLineEdit>
 #include <QtGui/QSplitter>
-#include <QtGui/QTextEdit>
+#include <QtGui/QPlainTextEdit>
 #include <QtGui/QWidget>
 
 namespace Debugger {
@@ -71,8 +71,8 @@ private slots:
     void onReturnPressed();
 
 private:
-    QTextEdit *m_combinedText;  // combined input/output
-    QTextEdit *m_inputText;     // scriptable input alone
+    QPlainTextEdit *m_combinedText;  // combined input/output
+    QPlainTextEdit *m_inputText;     // scriptable input alone
     QLineEdit *m_commandEdit;
 };
 
-- 
GitLab