Results 1 to 6 of 6

Thread: Hex Conversion

  1. #1
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Hex Conversion

    Hai

    I have a String its in Hex format like..[3F].
    How to convert this String to Hex?..





    pl suggest me

    suree
    Bangalore..

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hex Conversion


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

    umulingu (4th March 2010)

  4. #3
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Hex to Float Conversion

    Hai

    I have a QString in Hex Format. I want to convert into float.

    how to do this?

    i tried something

    Qt Code:
    1. QString strA="0x3F4CCCCD";
    2. float valueA;
    3. valueA=strA.toFloat(true);
    4. qDebug("%f",valueA);
    To copy to clipboard, switch view to plain text mode 

    I am geting 0.

    pl help me


    suree
    Bangalore

  5. #4
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hex Conversion

    Thanks for ur reply


    I got solution .


    suree
    Bangalore

  6. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hex to Float Conversion

    QByteArray::fromHex
    QByteArray::toFloat
    Also, take out time to seearch in assistant. It really helps. Most of the questions can be answered by going through assistant and Qt demos

  7. #6
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hex to Float Conversion

    If you do not see the results you expect, you may have an incorrect byte order.

Similar Threads

  1. conversion problem
    By Petr_Kropotkin in forum General Programming
    Replies: 4
    Last Post: 27th February 2010, 00:46
  2. difficulty in conversion
    By mohanakrishnan in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2009, 10:31
  3. int to String Conversion
    By aj2903 in forum Qt Programming
    Replies: 4
    Last Post: 4th December 2009, 22:43
  4. Reg - Conversion of Qt3 to Qt4
    By suresh in forum Qt Programming
    Replies: 10
    Last Post: 28th August 2006, 23:10
  5. conversion of color
    By Stephano in forum Qt Programming
    Replies: 5
    Last Post: 22nd May 2006, 11:56

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.