Results 1 to 5 of 5

Thread: Convert QString quint8;

  1. #1
    Join Date
    Mar 2008
    Posts
    68
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Convert QString quint8;

    is it possible to convert a QString to quint8?
    if yes how?

  2. #2
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

  3. #3
    Join Date
    Mar 2008
    Posts
    68
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Convert QString quint8;

    i tried the following
    Qt Code:
    1. QString s="N";
    2. quint8 ijk;
    3. bool ok;
    4. ijk=s.toUInt(&ok,10);
    5. cout<<"ijk"<<ijk<<endl;
    To copy to clipboard, switch view to plain text mode 
    the output was
    Qt Code:
    1. ijk
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Convert QString quint8;

    Try this
    ijk=s.toUtf8().at(0);

  5. #5
    Join Date
    Apr 2011
    Posts
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Convert QString quint8;

    i have this problem also...
    how did you solve that? because the solution here does not working.

Similar Threads

  1. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10
  2. convert from qstring to const char *
    By deepa.selvaraj in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2007, 12:33
  3. how to convert int to QString?
    By phillip_Qt in forum Newbie
    Replies: 2
    Last Post: 5th October 2007, 08:07
  4. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  5. Convert wstring to QString.
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2007, 14:18

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.