Results 1 to 7 of 7

Thread: QStringlist To QString

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    May 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QStringlist To QString

    Quote Originally Posted by phillip_Qt View Post
    HI All
    CAn any body tell me how to change QStringlist object to QString type.
    my code is QStringList list1 = str.split(".");
    i need to change list1 to Qstring type.
    I tried like this reinterpret_cast<QString>(list1). but giving error.
    THank you all.

    Here is the solution :


    Qt Code:
    1. QStringList strList;
    2. strList << "bird" << "tree" << "water" ;
    3.  
    4. QString str = strList.join(""); // str = "birdtreewater";
    5. str = strList.join(","); // str = "bird,tree,water";
    To copy to clipboard, switch view to plain text mode 
    Last edited by CuteKid; 22nd May 2014 at 23:36.

Similar Threads

  1. QStringList
    By dragon in forum Newbie
    Replies: 2
    Last Post: 8th June 2007, 17:26
  2. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 20:47
  3. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  4. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 08:55
  5. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:10

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.