[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kppp
From:       Laurent Montel <montel () kde ! org>
Date:       2005-09-01 18:30:13
Message-ID: 1125599413.175594.22014.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 455944 by mlaurent:

Use QTextEdit now


 M  +13 -11    loginterm.cpp  
 M  +2 -2      loginterm.h  


--- trunk/KDE/kdenetwork/kppp/loginterm.cpp #455943:455944
@@ -36,11 +36,11 @@
 #include <QVBoxLayout>
 #include <QGridLayout>
 #include <QKeyEvent>
-
+#include <QTextCursor>
 extern KPPPWidget *p_kppp;
 
 LoginMultiLineEdit::LoginMultiLineEdit(QWidget *parent, const char *name)
-  : Q3MultiLineEdit(parent, name)
+  : QTextEdit(parent, name)
 {
 }
 
@@ -51,20 +51,24 @@
 
 
 void LoginMultiLineEdit::insertChar(unsigned char c) {
-  Q3MultiLineEdit::insert(QString(c));
+  insertPlainText(QString(c));
   p_kppp->debugwindow->addChar(c);
 }
 
 
 void LoginMultiLineEdit::myreturn() {
-  Q3MultiLineEdit::home();
+    textCursor().movePosition( QTextCursor::Start );
 }
 
 
 void LoginMultiLineEdit::mynewline() {
+    textCursor().movePosition( QTextCursor::End );
+    insertPlainText(QString("\n"));
+
+#if 0
   Q3MultiLineEdit::end(FALSE);
   Q3MultiLineEdit::newLine();
-
+#endif
     p_kppp->debugwindow->addChar('\n');
 }
 
@@ -86,13 +90,11 @@
   if(((int)c != 13) && ((int)c != 10) && ((int)c != 8))
     insertChar(c);
 
-  if((int)c == 8)
-    backspace();
-  if((int)c == 127)
-    backspace();
-  if((int)c == 10)
+  if((int)c == 8 || ( int )c == 127)
+      textCursor().deleteChar ();
+  else if((int)c == 10)
     mynewline();
-  if((int)c == 13)
+  else if((int)c == 13)
     myreturn();
 }
 
--- trunk/KDE/kdenetwork/kppp/loginterm.h #455943:455944
@@ -2,13 +2,13 @@
 #define _LOGINTERM_H_
 
 #include <qdialog.h>
-#include <q3multilineedit.h>
+#include <qtextedit.h>
 #include <qapplication.h>
 #include <qtimer.h>
 //Added by qt3to4:
 #include <QKeyEvent>
 
-class LoginMultiLineEdit : public Q3MultiLineEdit {
+class LoginMultiLineEdit : public QTextEdit {
 
   Q_OBJECT
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic