Results 1 to 4 of 4

Thread: QString.remove() Why not working?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2013
    Posts
    11
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QString.remove() Why not working?

    I've got my slot:

    Qt Code:
    1. void MainWindow::fdelete()
    2. {
    3. ui->lineEdit->text().remove(ui->lineEdit->text().length() , 1);
    4. }
    To copy to clipboard, switch view to plain text mode 

    And i can't figure out, why this is not working? I want to delete the last character on the right. So it has to be the last one added.
    The text().length() should return the amount of characters inside the string, so this should be the position of the last one, am I wrong?

    thanks for answer.

  2. The following user says thank you to Noob for this useful post:


Similar Threads

  1. Replies: 7
    Last Post: 24th September 2012, 07:17
  2. How to remove whitespace in qstring in beginning?
    By Gokulnathvc in forum Newbie
    Replies: 1
    Last Post: 20th August 2012, 08:16
  3. Replies: 2
    Last Post: 11th August 2011, 15:42
  4. Replies: 3
    Last Post: 21st January 2011, 19:40
  5. Replies: 4
    Last Post: 31st January 2008, 20:44

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.