http://qt-project.org/doc/qt-5.0/qtgui/qpixmap.html#details
Like I mentioned in the answer above, use
bool retVal = QPixmap::load(champ);
Then check the retVal to see what happened.
if(retVal == false)
{
qDebug() << "These are the supported formats:"
<< QImageReader::supportedImageFormats();
if(QFile::exists(champ) == false)
{
qDebug() << "Unable to find file" << champ;
}
}
Also make sure that your QPixmap
isn't going out of scope. So put it as a member function in your header file. Otherwise it may not exist at the end of your constructor.
http://qt-project.org/doc/qt-5.0/qtgui/qimagereader.html#supportedImageFormats
http://qt-project.org/doc/qt-5.0/qtcore/qfile.html#exists
Hope that helps.