Results 1 to 2 of 2

Thread: Add nulls to QString

  1. #1
    Join Date
    Jun 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Add nulls to QString

    Hello.

    Qt Code:
    1. QString result;
    2. QString sub;
    3. QString end = "\n";
    4. for (int x = 0; x < 1000; x++)
    5. {
    6. sub = sub.setNum(x);
    7. result = result + sub + end:
    8. }
    To copy to clipboard, switch view to plain text mode 

    result is:
    1
    2
    3
    ..
    999


    I need that result to be with nulls before, like:
    001
    002
    ...
    099
    ...
    999


    How to to this ?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Add nulls to QString


Similar Threads

  1. [pyqt] Can't insert Nulls Using QSqlQuery.execBatch
    By ftnirp in forum Qt Programming
    Replies: 0
    Last Post: 3rd October 2011, 21:07

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.