Niamita
20th January 2012, 12:32
Hi
Might be this question i should not ask but i am not understanding what is wrong with this. I am trying to set a pixmap to a label (here label is my custom label class in which i inherit paintEvent() and mousePressEvent()) , but it is not getting display. I checked whether image is loaded or not , i found that image is loaded correctly.
My code for setting pixmap is
QPixmap image1(":/buttonn.png");
this.setPixmap(QPixmap::fromImage(image1));
if(image1.isNull()){
label->setText("null pic");
}
Thanks.
Might be this question i should not ask but i am not understanding what is wrong with this. I am trying to set a pixmap to a label (here label is my custom label class in which i inherit paintEvent() and mousePressEvent()) , but it is not getting display. I checked whether image is loaded or not , i found that image is loaded correctly.
My code for setting pixmap is
QPixmap image1(":/buttonn.png");
this.setPixmap(QPixmap::fromImage(image1));
if(image1.isNull()){
label->setText("null pic");
}
Thanks.