a?adidos los m?todos de remove para las clases "comic flow", ahora ya se puede implementar la funci?n de eliminar c?mics

This commit is contained in:
Luis Ángel San Martín
2013-05-28 12:15:45 +02:00
parent 8ce3579d53
commit ea9d2bd169
7 changed files with 45 additions and 0 deletions

View File

@ -1085,6 +1085,18 @@ void PictureFlow::addSlide(const QPixmap& pixmap)
addSlide(pixmap.toImage());
}
void PictureFlow::removeSlide(int index)
{
int c = d->state->slideImages.count();
if (index >= 0 && index < c)
{
d->state->slideImages.remove(index);
d->state->marks.remove(index);
//TODO remove loaded flags
triggerRender();
}
}
void PictureFlow::setSlide(int index, const QImage& image)
{
if((index >= 0) && (index < slideCount()))

View File

@ -130,6 +130,11 @@ public slots:
*/
void addSlide(const QPixmap& pixmap);
/*!
Removes an existing slide.
*/
void removeSlide(int index);
/*!
Sets an image for specified slide. If the slide already exists,
it will be replaced.

View File

@ -674,6 +674,10 @@ void YACReaderFlowGL::remove(int item)
}
numObjects--;
cfImages = (CFImage*)realloc(cfImages,numObjects*sizeof(CFImage));
loaded.remove(item);
marks.remove(item);
paths.removeAt(item);
}
/*Info*/