no i used the correct file name with a proper url(I used the same url to load an icon into a qlistwidget and it worked) . I used the setFileName function of qimage reader.I am pasting the code for u to look.
#include <QImageReader>
#include <stdio.h>
int main(int argc,char* argv[])
{
imageRead->setFileName("/home/srihari/CompaqCity.jpg");
bool b;
b=imageRead->canRead();
if(b)
{
printf("true\n");
}
else
printf("false\n");
int value=imageRead->error();
printf("%d",value);
}
#include <QImageReader>
#include <stdio.h>
int main(int argc,char* argv[])
{
QImageReader *imageRead=new QImageReader();
imageRead->setFileName("/home/srihari/CompaqCity.jpg");
bool b;
b=imageRead->canRead();
if(b)
{
printf("true\n");
}
else
printf("false\n");
int value=imageRead->error();
printf("%d",value);
}
To copy to clipboard, switch view to plain text mode
Bookmarks