Click here to Skip to main content
13,052,342 members (56,366 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to convert QByteArray to BYTE*?
Posted 8-Mar-11 22:48pm
Updated 9-Mar-11 2:03am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You may use the data member for the purpose (though getting the buffer for write access is really a bad idea):

QByteArray array;
BYTE * pByte = reinterpret_cast<byte*>(;
Gokulnath007 9-Mar-11 8:17am
Thank You.. Thats great.. myself 5 for it..
CPallini 9-Mar-11 8:26am
Anyway, if you really need to write access the buffer, make a copy of it and modify the copy.
SAKryukov 9-Mar-11 15:18pm
OK, 5, proposed as Answer.
CPallini 9-Mar-11 15:46pm
Thank you. Now that we're good friends what about a debate about physics? On the serious side, how can you propose an answer (I'm not able to or, probably missing something...)?
SAKryukov 9-Mar-11 18:44pm
Sorry, could you remind me..? What answer?
CPallini 10-Mar-11 1:43am
You wrote (3rd message above):"OK, 5, proposed as Answer". How did you 'propose'? I cannot find a way to (I'm probably missing something...).
SAKryukov 10-Mar-11 1:51am
Yes, I understand, it's not clear. I used to ask such question myself. Somebody explain me that this is such a tradition. I think myself it does not really serve the purpose. OK, let me do it in my way... see my next comment...
CPallini 10-Mar-11 2:47am
OK, I got it, thank you. :-)
SAKryukov 10-Mar-11 1:52am
I suggest you formally accept this Answer.
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 9 Mar 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100