Hi, I need to save images in an array, but I tried some things, but still not working, need help.
I'm trying to use and set values to a QGraphicsPixmapItem Array (using C++ arrays) and using QList too.
My code here:
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
QPixmap *icon
= new QPixmap(list.
at(biDiArray
[i
][j
]));
//list of a QString image.setPixmap(*icon);
pixmapArray[i*10+j] = image;
}
}
QGraphicsPixmapItem pixmapArray[n*m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
QPixmap *icon = new QPixmap(list.at(biDiArray[i][j])); //list of a QString
QGraphicsPixmapItem image;
image.setPixmap(*icon);
pixmapArray[i*10+j] = image;
}
}
To copy to clipboard, switch view to plain text mode
I tried to use it as QList too, but didn't work.
for(int i=0;i<this->n;i++){
for(int j=0;j<this->m;j++){
this->pixmapItemList.insert(10*i+j,*image);
}
}
for(int i=0;i<this->n;i++){
for(int j=0;j<this->m;j++){
QPixmap *icon = new QPixmap(list.at(mat[i][j]));
QGraphicsPixmapItem *image = new QGraphicsPixmapItem(*icon);
this->pixmapItemList.insert(10*i+j,*image);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks