mgurbuz
13th July 2007, 11:05
Hi All,
I'm having some trouble using the QLabel->SetPixmap
method in Windows. My application has a label and I am trying to add a pixmap on it. The pixmap is located under Resource Files picture.qrc.
The following code is the simplest example of what I'm doing:
void AModule::openRDialog()
{
QPixmap pmap(720,840);
QString iconstr = ":picture//A.png";
pmap.load(iconstr,"PNG",Qt::ColorOnly);
mDialog->ui.i90label->setPixmap(pmap);
mDialog->exec();
}
When I run the application all I could see is empty gray picture on the label.
If I put png file outside the Resources file and delete the picture.qrc
and give the new path name as
QString iconstr = "C://libraries//MODULE//A.png";
I could see the pixmap on the label. But this time,
I can't carry this exe to another machine without the png file.
How could I solve this problem? Any help will be appriciated.
I'm having some trouble using the QLabel->SetPixmap
method in Windows. My application has a label and I am trying to add a pixmap on it. The pixmap is located under Resource Files picture.qrc.
The following code is the simplest example of what I'm doing:
void AModule::openRDialog()
{
QPixmap pmap(720,840);
QString iconstr = ":picture//A.png";
pmap.load(iconstr,"PNG",Qt::ColorOnly);
mDialog->ui.i90label->setPixmap(pmap);
mDialog->exec();
}
When I run the application all I could see is empty gray picture on the label.
If I put png file outside the Resources file and delete the picture.qrc
and give the new path name as
QString iconstr = "C://libraries//MODULE//A.png";
I could see the pixmap on the label. But this time,
I can't carry this exe to another machine without the png file.
How could I solve this problem? Any help will be appriciated.