Results 1 to 8 of 8

Thread: QByteArray to QString

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Question QByteArray to QString

    hi
    how to convert QByteArray to QString

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QByteArray to QString

    Search for "QByteArray" in QString docs.
    J-P Nurmi

  3. #3
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: QByteArray to QString

    yes it is possible to convert QString to QByteArray

    QByteArray block(string.toAscii());

    but i want QByteArray to QString

    i have searched for QString in QByteArray docs but not found any solution

  4. #4
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QByteArray to QString

    Look closer.

    QString myString(myByteArray); constructor QString(const QByteArray &ba)

    or you can use QString::fromAscii() etc.

  5. The following 3 users say thank you to durbrak for this useful post:

    azalea (23rd January 2017), babu198649 (6th December 2007), tablebubble (21st April 2011)

  6. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QByteArray to QString

    Quote Originally Posted by jpn View Post
    Search for "QByteArray" in QString docs.
    Quote Originally Posted by babu198649 View Post
    i have searched for QString in QByteArray docs
    I guess I should've used reverse psychology or something...
    J-P Nurmi

  7. #6
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: QByteArray to QString

    ok thanks jpn any have i got solution

  8. #7
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QByteArray to QString

    Quote Originally Posted by jpn View Post
    I guess I should've used reverse psychology or something...
    Maybe the text in his locale is right to left .

  9. #8
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: QByteArray to QString

    thank u durbrak it worked

Similar Threads

  1. How to get QByteArray from QString in Qt3
    By joseph in forum Qt Programming
    Replies: 2
    Last Post: 5th September 2007, 10:23
  2. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 21:47
  3. Replies: 5
    Last Post: 16th March 2007, 09:18
  4. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 18:59
  5. [SOLVED] Widget plugin ... how to ?
    By yellowmat in forum Newbie
    Replies: 10
    Last Post: 29th January 2006, 21:41

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.