Results 1 to 8 of 8

Thread: What is best for concatenating values in QString: arg(...) or +?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: What is best for concatenating values in QString: arg(...) or +?

    There is also a third method:

    Qt Code:
    1. #include <QStringBuilder>
    2.  
    3. QString string = "abc" % QString::number(currFile) % ... ;
    To copy to clipboard, switch view to plain text mode 

    This solution is fastest yet less powerful than when using arg() since the latter is better when using tr() for translations.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    Momergil (3rd April 2014)

Similar Threads

  1. Replies: 6
    Last Post: 1st February 2013, 08:32
  2. How to access QString characters values
    By rdelgado in forum Newbie
    Replies: 7
    Last Post: 15th November 2010, 14:01
  3. Replies: 4
    Last Post: 1st February 2010, 14:21
  4. concatenating path QStrings
    By rbp in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2008, 04:46
  5. Concatenating two binary files
    By nbkhwjm in forum Newbie
    Replies: 13
    Last Post: 23rd April 2007, 03:30

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.