Results 1 to 3 of 3

Thread: Text before editting on QLineEdit

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Text before editting on QLineEdit

    Hi,

    I have a QLineEdit with the Signal "editFinished" connected to a Slot. Into the Slot I want to get the text that the QLineEdit was containing before editting it and the new editted text. Is there anyway to get the text before editting it?

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Text before editting on QLineEdit

    you can try to catch
    Qt Code:
    1. void QLineEdit::textEdited ( const QString & text )
    To copy to clipboard, switch view to plain text mode 
    then do
    Qt Code:
    1. void QLineEdit::undo ()
    To copy to clipboard, switch view to plain text mode 
    then get the text and then do
    Qt Code:
    1. void QLineEdit::redo ()
    To copy to clipboard, switch view to plain text mode 

    maybe there is better way to realize this approach.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Text before editting on QLineEdit

    Hi,

    I have used a variable to sotre actual values.

    Thanks,
    Òscar Llarch i Galán

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. QLineEdit shadow text disappear on first entry
    By dentharg in forum Qt Programming
    Replies: 1
    Last Post: 6th July 2008, 17:40
  3. QLineEdit text() crash - Qt3
    By user_mail07 in forum Qt Programming
    Replies: 7
    Last Post: 10th June 2008, 09:42
  4. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  5. Changing text colour of QLineEdit qss file
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 4th April 2008, 05:28

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.