I think you shall check the return value of the pixmap()
function.
const QPixmap* pixmap = ui.Picture->pixmap();
if ( pixmap )
{
QImage image( pixmap->toImage() );
}
Maybe you just called the function when the image was not set and that caused the exception.