Results 1 to 4 of 4

Thread: How do I append and int to my QString?

  1. #1

    Default Re: How do I append and int to my QString?

    I have to, for each item I add to the list, name it itemN, like:
    item0
    item1
    item2
    ...
    I tried using a counter and using append to add my number to the QString but instead of
    getting a item0, I got a item<weird simbol>

    Please help.


    Added after 11 minutes:


    forget it =p
    found setNum function in the QString
    Last edited by seink; 23rd December 2010 at 13:54.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How do I append and int to my QString?


  3. #3
    Join Date
    May 2015
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I append and int to my QString?

    Thank you you saved my life with the setnum function

  4. #4
    Join Date
    Mar 2015
    Posts
    24
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How do I append and int to my QString?

    string.append(QString::number(num));

Similar Threads

  1. QString::append() weirdness
    By mattc in forum Qt Programming
    Replies: 16
    Last Post: 17th October 2010, 14:02
  2. Append to a XML Document
    By Goldmmbr in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2009, 16:03
  3. Cannot append to QFile using QIODevice::Append
    By philwinder in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2008, 10:09
  4. Need help. can't append chars in QString
    By AcerExtensa in forum Qt Programming
    Replies: 6
    Last Post: 12th June 2008, 11:57
  5. Replies: 4
    Last Post: 31st January 2008, 21:44

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.