Even after appending the full path, QImage::Load doesnt work
void MainWindow::listdisplay()
{
QDir dir
("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes");
dir.
setFilter(QDir::Files);
QList<QImage> images;
int sizeW = 20;
int sizeH = 20;
for(int i=0;i<=listfiles.count();i++)
{
QString filename
= listfiles.
at(i
);
QString filepath
= dir.
absoluteFilePath(filename
);
bool x = tmp.load(filepath);
//bool x = tmp.load("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes/Black Hexagon.png");
if(x == true)
{
thumb = (tmp.scaled( 1240, 1480 ).scaled( sizeW, sizeH, Qt::KeepAspectRatio )); //two passes
modl->setData( modl->index( i, 0 ), thumb, Qt::DecorationRole );
}
}
void MainWindow::listdisplay()
{
QDir dir("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes");
dir.setFilter(QDir::Files);
QList<QImage> images;
QImage thumb, tmp;
int sizeW = 20;
int sizeH = 20;
QStringList listfiles = dir.entryList(QStringList()<<"*.png",QDir::Files);
for(int i=0;i<=listfiles.count();i++)
{
QString filename = listfiles.at(i);
QString filepath = dir.absoluteFilePath(filename);
bool x = tmp.load(filepath);
//bool x = tmp.load("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes/Black Hexagon.png");
if(x == true)
{
thumb = (tmp.scaled( 1240, 1480 ).scaled( sizeW, sizeH, Qt::KeepAspectRatio )); //two passes
modl->setData( modl->index( i, 0 ), thumb, Qt::DecorationRole );
}
}
To copy to clipboard, switch view to plain text mode
The images have been taken from MACOS, and the work environment is linux,qt
Is that the issue ?
Bookmarks