QImage image = QImage(ui->graphicsView->viewport()->rect().size(), QImage::Format_ARGB32); QPainter p1(&image); ui->graphicsView_header->viewport()->render(&p1); image.save(fileName,fileFormat);
imageLabel->setPixmap(QPixmap::fromImage(img.scaled(this->width(), this->height(), Qt::KeepAspectRatio)));