Results 1 to 5 of 5

Thread: qFromLittleEndian returning "double"

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question qFromLittleEndian returning "double"

    Hi!
    What should I do to make qFromLittleEndian return "double" ?
    I know in that in docs there is written that it can return only int...
    Is there any way to get data from memory that are double ?
    THanks

  2. #2
    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: qFromLittleEndian returning "double"

    Try to convert the uchar array to a QByteArray and then use QByteArray::toDouble to get a double.

  3. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qFromLittleEndian returning "double"

    Quote Originally Posted by marcel View Post
    Try to convert the uchar array to a QByteArray and then use QByteArray::toDouble to get a double.
    But what about the endianess problem ?

  4. #4
    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: qFromLittleEndian returning "double"

    Quote Originally Posted by gyre View Post
    But what about the endianess problem ?
    That you will have to implement yourself.

  5. #5
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: qFromLittleEndian returning "double"

    Quote Originally Posted by marcel View Post
    That you will have to implement yourself.
    So if I understood it correctly...I will have to handle the endianess myself and then newly ordered uchar to QByteArray and that convert to Double ? Its not very handy...
    Why shouldnt I just used qFromLittleEndian function ? Its no use ?

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
  •  
Qt is a trademark of The Qt Company.