Hi, caduel. Thank you for your reply.
I get a image byte-array and the array size via own class.
Above code skipped own class for brief explanation.
MyClass* mc = new MyClass();//This class get images(i.e. jpeg or png) from tcp/ip network.
/*use automatic variable for QPixmap instance*/
#if 0
p.loadFromData(mc->getArray(), mc->getArraySize());//N.G. complile error.
#endif
/*use new operator for QPixmap instance.
This code works.
*/
p->loadFromData(mc->getArray(), mc->getArraySize());//OK.
MyClass* mc = new MyClass();//This class get images(i.e. jpeg or png) from tcp/ip network.
/*use automatic variable for QPixmap instance*/
#if 0
QPixmap p();//OK
p.loadFromData(mc->getArray(), mc->getArraySize());//N.G. complile error.
QLabel* icon = new QLabel(p);
#endif
/*use new operator for QPixmap instance.
This code works.
*/
QPixmap* p = new QPixmap();//OK
p->loadFromData(mc->getArray(), mc->getArraySize());//OK.
QLabel* icon = new QLabel(*p);//
To copy to clipboard, switch view to plain text mode
Hi, aamer4yu. Thank you for your reply.
I do not have such function...
But, I want to try your way : QPixmap p;
Later date, I will report this try result. Thank you.
In my enbedded environment, if possible, I want to avoid dynamic memory alloc(new and malloc).
Bookmarks