Results 1 to 4 of 4

Thread: reading the latest entry text from QplaintextEdit

  1. #1
    Join Date
    Aug 2011
    Location
    bangalore
    Posts
    14
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up reading the latest entry text from QplaintextEdit

    hi, i am trying to implement shell application..presently i am using Qlineedit for command entry and QTextedit for displaying the command output..it is looking ugly ..i want to use QPlaintextEdit for both command entry and display output...can some one please tell me how to do this..

    QPlaintext


    tcl>puts helloworld //command entry
    helloworld //command output
    tcl> // ready for taking next command

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: reading the latest entry text from QplaintextEdit

    What's the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2011
    Location
    bangalore
    Posts
    14
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: reading the latest entry text from QplaintextEdit

    i want read the perticular text from Qtextedit...i just reimplemnted keypressevents my back speace operation is not working properly it is not removing the last letter...

    Qt Code:
    1. void textedit::keyPressEvent(QKeyEvent *e)
    2. {
    3. int key = e->key();
    4. QString str = e->text();
    5.  
    6. //updateCursor();
    7. if ((key == Qt::Key_Return) || (key == Qt::Key_Enter) ) {
    8. qDebug()<<input<<endl;
    9. }
    10. else if ((key == Qt::Key_Backspace) ) {
    11. // remove last letter from the input string
    12. //input.remove(-1,1);
    13. }
    14. else {
    15. insertPlainText(str);
    16. input.insert(-1,str);
    17.  
    18. }
    19.  
    20.  
    21. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by PHANI; 6th February 2012 at 10:28.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: reading the latest entry text from QplaintextEdit

    Doesn't QPlainTextEdit already handle key events by itself?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. multicolor text in QPlainTextEdit
    By mastupristi in forum Qt Programming
    Replies: 5
    Last Post: 14th January 2011, 22:37
  2. Selecting Text QPlainTextEdit
    By smhall316 in forum Newbie
    Replies: 0
    Last Post: 7th December 2010, 21:09
  3. read text from QPlainTextEdit
    By chs in forum Newbie
    Replies: 2
    Last Post: 21st November 2009, 13:07
  4. QPlainTextEdit reload text
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2009, 15:24
  5. QLineEdit shadow text disappear on first entry
    By dentharg in forum Qt Programming
    Replies: 1
    Last Post: 6th July 2008, 18:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.