Results 1 to 8 of 8

Thread: QString arg

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy QString arg

    I want to use QString to produce something like following:

    This is number 99.
    I should note that i want to be able to change it to the following if needed:
    This_is_number_99.
    or this one:
    This-is-number-99.

    in which spaces are dynamic, so I used this code:
    Qt Code:
    1. QString test=" ";
    2. QMessageBox::information(this,"Testing...",tr("This%1is%1number%199.").arg(test));
    To copy to clipboard, switch view to plain text mode 
    the problem is that, because %1 is followed by another number, it does not work as expected, please someone shows me a way to solve this,

    any help is appreciated.
    Last edited by PLUS; 29th January 2010 at 13:38.

Similar Threads

  1. QString to hex
    By offline in forum Qt Programming
    Replies: 1
    Last Post: 21st December 2009, 12:21
  2. QString help
    By mabeeh in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2008, 21:50
  3. Replies: 4
    Last Post: 31st January 2008, 20:44
  4. QString
    By krishbhala in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 11:31
  5. how to copy part of QString to anothe QString
    By nass in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2007, 19:05

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.