From QPixmap doc:
Returns true if the pixmap was successfully loaded; otherwise returns false.
if (qimg.load(filename)) //if this warning is NOT printed, it means the image is NOT loaded - you need to add '!' to the if statement.
qWarning("Failed to load target image");
QPixmap qimg;
if (qimg.load(filename)) //if this warning is NOT printed, it means the image is NOT loaded - you need to add '!' to the if statement.
qWarning("Failed to load target image");
To copy to clipboard, switch view to plain text mode
you should also test against isNull(), to be on the safe side.
Bookmarks