Results 1 to 10 of 10

Thread: QDataStream >>QByteArray [was QByteArray resize not working?!]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    107
    Thanks
    36
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QDataStream >>QByteArray [was QByteArray resize not working?!]

    Hi

    I have this piece of code:

    Qt Code:
    1. records >> sPacket.size_app_payload; // == 15
    2. sPacket.app_payload.resize( sPacket.size_app_payload );
    3.  
    4. printf("Application Payload array size: %d\r\n", sPacket.app_payload.size() );
    To copy to clipboard, switch view to plain text mode 

    the
    Qt Code:
    1. sPacket.size_app_payload
    To copy to clipboard, switch view to plain text mode 
    returns 15

    the
    Qt Code:
    1. sPacket.app_payload.size()
    To copy to clipboard, switch view to plain text mode 
    returns 0 !!!

    Unless I'm finally going mad or short of spotting something very obvious this is weird!

    TIA,
    Pedro.
    Last edited by pdoria; 24th July 2009 at 16:42.

Similar Threads

  1. resize of QMessageBox not working?
    By Sheng in forum Qt Programming
    Replies: 2
    Last Post: 13th November 2008, 14:25
  2. Replies: 2
    Last Post: 22nd January 2008, 16:10
  3. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  4. QDomElement to QByteArray ?
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 2nd May 2006, 17:01
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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.