I implemented layers in my painting application.
Each layer has a thumbnail preview.
I want the thumbnail of a layer to only show the items that belong to that layer.
Right now I call scene->render()
that renders all items to the thumbnail. How can I select only items that have a certain parent?
QSize size = QSize(scene_->width(), scene_->height());
QImage *thumbnail = new QImage(size, QImage::Format_ARGB32);
thumbnail->fill(Qt::transparent); // Start all pixels transparent
QPainter imagePainter(thumbnail);
imagePainter.setRenderHint(QPainter::Antialiasing);
scene_->render(&imagePainter);
imagePainter.end();
The code above renders all times of the scene, but this is not what I want.