hi,
i tried the approach using the qt resource system u mentioned and it worked instantly. oh yeah, i also gave the isnull fn a try... also very useful...
so thx a million 4 ur help
oh well yeah.. if someone else is ever going to have the same problem.... this way u can display the pic...
#include <QApplication>
#include <QLabel>
#include <QPixmap>
int main(int argc, char *argv[])
{
label->setPixmap(image);
if(image.isNull()){
label->setText("null pic");
}
label->show();
return app.exec();
}
#include <QApplication>
#include <QLabel>
#include <QPixmap>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel();
QPixmap image(":/bild.bmp");
label->setPixmap(image);
if(image.isNull()){
label->setText("null pic");
}
label->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
but u need to create a resource file and mention there ur picture.... in my case... bild.bmp... oh yeah.... and also u need to mention ur resource file in your project file... sounds really more depressing than it is.... if u use qt creator.... things are even done for u... just create a new res file... and select there the stuff u want to have.... then u can just use it the :/ way shown in the code... the rest ll be done for u...
enjoy
Bookmarks