Char array[6] to QString and display it
How can I convert a char array[6] to QString and use it for display.
Example:
char array[0] = FF,
char array[1] = FF,
char array[2] = FF,
char array[3] = FF,
char array[4] = FF,
char array[5] = FF
Use this char array, convert it to QString.
Help me out for such conversion.
Thanks & Regards,
Arun.
Re: Char array[6] to QString and display it
Quote:
Originally Posted by
arunvv
How can I convert a char array[6] to QString and use it for display.
Example:
char array[0] = FF,
char array[1] = FF,
char array[2] = FF,
char array[3] = FF,
char array[4] = FF,
char array[5] = FF
Use this char array, convert it to QString.
Help me out for such conversion.
Thanks & Regards,
Arun.
I am sorry but is this c++ ? Probably you mean
Code:
char array[6];
array[0] = 0xFF,....
There is constructor for QString which constructs using "C" string.(null terminated of course)
Re: Char array[6] to QString and display it
You can use QString::QString ( QChar ch ) and operator+=() for that. However, You are not using the correct C++ for asking problem. Which is already shown by Mr. GOPALA KRISHNA.
Re: Char array[6] to QString and display it
Thanks for your reply.
I am using C++. So what function I need to use, if there is no function, how can i convert array of characters to QString.
Thanks & Regards,
Arun.
Re: Char array[6] to QString and display it
Did you try ...reading QString docs?
Re: Char array[6] to QString and display it
I read QString Docs, But I don't see any thing which converts array to QString.
Please let me know how to convert it.
Thanks,
Arun
Re: Char array[6] to QString and display it
Do you know the relation between char[] and char*?
Re: Char array[6] to QString and display it
Thanks to all it solved now.
Re: Char array[6] to QString and display it
char chararray [15];
QString theqstring ("This is a character array");
strcpy (chararray, theqstring.latin1());
Using this u can convert QString to char[]
:)
Re: Char array[6] to QString and display it
hi i am a Qtforum user
i am also suffering from same problem like you
can you tell me how did you solved ur proble
plz..
i need to display hex data array(char type) in QLabel
waiting for ur reply
thanks in advance
Re: Char array[6] to QString and display it
Quote:
Originally Posted by
arunvv
Thanks to all it solved now.
Hi... Can you please tell me how you solved this issue ??? as i also need to do the same thing....
Re: Char array[6] to QString and display it
What have you actually tried? What do you actually have as input? This thread contains a solution and some hints.