mercredi 1 juillet 2015

QPixmap load segmentation fault

I am creating a Qt Console Application on windows 7. I am using Qt 5.3. And currently I have error that make me frustration because of it. Already check on the stackoverflow, but no answers help me.

My problem was when creating a Qpixmap I got error segmentation fault and I don't have any other error information about it.

Here my code :

QString filePath = (directory + xmlReader.attributes().value("relativepath").toString());
QFile _file(filePath);
if (!_file.exists())
{
    qWarning() << "Error : file " << filePath << " does not exist";
    return false;
}

QImageReader imageReader(filePath);
QImage mainImage = imageReader.read();
if(mainImage.isNull())
{
    qWarning() << "Error read image : " << filePath;
    qWarning() << imageReader.errorString();
    return false;
}
QPixmap mainPixmap(QPixmap::fromImage(mainImage));

On the last line of those code that generate the segmentation fault error on my machine. Is there anything i can do to debug this error?

Aucun commentaire:

Enregistrer un commentaire