[Qt-interest] How to change std::vector<char> to QString?

donglongchao donglongchao at 163.com
Mon Dec 14 08:42:51 CET 2009


Hi,

Help!I am using a shared library in which there is a function who return a std::vector<char>.I want to assign it to a QString object to show it on my GUI.But I do not know how to do it.Is there any constructor/member function in QString to do this?Or is there any constructor/member function in std::vector<char> to change itself into a char* or sth like that so that I can use it as a parameter in QString's constructor/member function to do this?I search the document but find nothing.If there is no,do I have to pull each element of the std::vector<char> out and then push them into my QString to do this?While I do not like this method very much.:-(.So,please point me the right direction and a better approach.Thanks a lot in advance.

Longchao

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091214/29d658e1/attachment.html 


More information about the Qt-interest-old mailing list