Results 1 to 2 of 2

Thread: how to get last character of QLineEdit

  1. #1
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Question how to get last character of QLineEdit

    Hello,
    I am trying to make a hyperterminal like program..

    I am getting the data from QLineEdit and sending it through serial port...

    The way i thoght was that: i connected textChanged signal of QLineEdit to send function....

    But in every key stroke, send function sends whole QlineEdit again...
    i wanna get the last character of QLineEdit and just send it; but i couldn't find a way to get the last character...Any idea hoe can i do that?

    Or should i use another approach for this hyperterminal like program...

    input like:

    hello world

    gives output otherside:

    h
    he
    hel
    hell
    hello
    hello
    hello w
    hello wo
    hello wor
    hello worl
    hello world

    i want just:

    hello world

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to get last character of QLineEdit

    Just get the rightmost character from that QString.

Similar Threads

  1. Problem Euro Sign with QLineEdit
    By Kubil in forum Qt Programming
    Replies: 1
    Last Post: 24th August 2007, 04:56
  2. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 01:25
  3. Character from argument disappears
    By Pepe in forum Qt Programming
    Replies: 13
    Last Post: 19th June 2007, 23:48
  4. QLineEdit lost focus
    By codebehind in forum Newbie
    Replies: 5
    Last Post: 4th May 2007, 16:02
  5. QAction shortcuts from QLineEdit
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 15:43

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.