Results 1 to 3 of 3

Thread: std string to QString error

  1. #1
    Join Date
    May 2010
    Posts
    46
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default std string to QString error

    Hi,
    i have a problem..
    I would convert a standard string to QString but i can't use the function Qstring test.fromStdString();

    How i can convert my standard string whitouth using this function?

    Thanks, bye

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: std string to QString error

    Try this:
    Qt Code:
    1. QString converted = QString((const char*)str.c_str());
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Zlatomir for this useful post:

    zoz (30th May 2010)

  4. #3
    Join Date
    May 2010
    Posts
    46
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: std string to QString error

    Thankyou very much!!!

Similar Threads

  1. How to convert from QString to string ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 1st December 2010, 01:50
  2. string (pascal) to QString QT? how
    By triperzonak in forum Newbie
    Replies: 0
    Last Post: 24th November 2008, 04:06
  3. Qstring vs string
    By cbarmpar in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2008, 21:23
  4. std::string to QString
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2008, 03:56
  5. std::string to QString?
    By Backslash in forum Newbie
    Replies: 4
    Last Post: 1st August 2007, 15:50

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.