/** @brief Add an image to the grid. * * @param image The image to add. * @param caption The caption to use. * * @return The ImageView which was added. The ImageGrid retains ownership. */ ImageView* const ImageGrid::AddImage( const QImage& image, const QString& caption, int id ) { m_zoom = 1.0; const size_t imageNum = m_imageViews.size(); ImageView* newImageView = new ImageView( this, id ); newImageView->setObjectName( QString( "imageView%1" ).arg( imageNum ) ); newImageView->setAutoFillBackground( false ); newImageView->SetImage( image ); static const bool PRESERVE_ASPECT_RATIO = true; newImageView->SetPreserveAspectRatio( PRESERVE_ASPECT_RATIO ); newImageView->SetCaption( caption ); m_imageViews.push_back(ImageViewPtr(newImageView)); ReflowImages(); return newImageView; }