Results 1 to 4 of 4

Thread: conversion from bytearray to int produce zero

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: conversion from bytearray to int produce zero

    What's about
    Qt Code:
    1. bool ok;
    2. QByteArray ba = QByteArray::fromHex("ffdecb7002");
    3. qWarning() << ba.toHex();
    4. qWarning() << ba.mid(2,1).toHex() << ba.mid(2,1).toHex().toInt(&ok, 16);
    To copy to clipboard, switch view to plain text mode 
    gives
    "ffdecb7002"
    "cb" 203
    ..or say what you expect.

  2. The following user says thank you to Lykurg for this useful post:

    daemonna (12th August 2010)

Similar Threads

  1. Replies: 10
    Last Post: 25th April 2010, 22:59
  2. Replies: 1
    Last Post: 1st October 2009, 20:28
  3. Read ByteArray
    By kewlcode in forum Qt Programming
    Replies: 19
    Last Post: 5th April 2009, 10:41
  4. How to dynamiclly produce the tab by QT/E?
    By xxthink in forum Qt Programming
    Replies: 1
    Last Post: 27th September 2008, 22:08
  5. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13

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.