sending image one class to another class
when sending the image from one class to another class application is crashing..
Code..
Code:
if(http_id == id && http->lastResponse().statusCode() == 200)
{
QCache<QString,QPixmap>imageCache;
image.loadFromData(imagedata);
imageCache.insert(requestByEntry.key(id),&image);
Form f;
f.set(*imageCache[URL]);
buffer->close();
}
Code:
void Form
::set( const QPixmap image
) {
m_ui->label->setPixmap(image);
this->show();
}
Re: sending image one class to another class
You are storing a pointer to a local object that gets destroyed when you leave the block of code. Store objects instead of pointers to them.
QWaitCondition: Destroyed while threads are still waiting
Hi
When i am running my application , In console i am getting
QWaitCondition: Destroyed while threads are still waiting
Then application is automatically closed..
I am using http links in my code..
if i use the QmessageBox ,that time is not showing , and application is not closed..
Code:
m_ui->setupUi( this );
m_ui->blockbutton->hide();
m_ui->callbutton->hide();
m_ui->followbutton->hide();
m_ui->retweetbutton->hide();
//QMessageBox::information(0,"get image function",QString("url link got"));
m_ui->userName->setText(""+str);
m_ui->userStatus->setHtml(""+str2);
m_ui->label->setPixmap(image);
//m_ui->userImage->setPixmap(image);
m_ui->label->setMouseTracking(true);
m_ui->label->installEventFilter(this);
m_ui
->callbutton
->setIcon
(QIcon("../Image/all.png"));
m_ui
->blockbutton
->setIcon
(QIcon("../Image/65.png"));
m_ui
->followbutton
->setIcon
(QIcon("../Image/follow.png"));
m_ui
->retweetbutton
->setIcon
(QIcon("../Image/68.png"));
if i disable the message box that time application is closed
Re: QWaitCondition: Destroyed while threads are still waiting
Do you use threads in your application?
Re: sending image one class to another class
No, I didn't use the threads..
Recently I used thead in above mentioned function..
QThread::wait(5000);
But nothing happened...