Some working code ...
Qt Code:
  1. void Dialog::beforeInsertFoto(QSqlRecord &record)
  2. {
  3. //prepare data dor id - generated key
  4. record.setValue("id", generateId("foto"));
  5.  
  6. //prepare data for name - get it form the label in the ui
  7. record.setValue("name", ui->fileNameLabel->text());
  8.  
  9. //prepare data for image - get it from the label in the ui
  10. QImage currentImage = ui->foto->pixmap()->toImage();
  11. QByteArray bytes;
  12. QBuffer buffer(&bytes);
  13. buffer.open(QIODevice::WriteOnly);
  14. currentImage.save(&buffer, "PNG");
  15. record.setValue("image", bytes);
  16. }
  17.  
  18. void Dialog::insertNewRecord()
  19. {
  20. int row = modeloFoto->rowCount();
  21. modeloFoto->insertRow(row);
  22. modeloFoto->submitAll();
  23.  
  24. }
  25.  
  26. void Dialog::getCurrentRecord()
  27. {
  28. //get image filename
  29. QModelIndex index = vistaFoto->currentIndex();
  30. ui->fileNameLabel->setText(modeloFoto->data(modeloFoto->index(index.row(), foto_name),0).toString());
  31.  
  32. //get image
  33. QVariant currentImage = modeloFoto->data(modeloFoto->index(index.row(), foto_image),0);
  34. QByteArray bytes = currentImage.toByteArray();
  35. QImage image;
  36. image.loadFromData(bytes);
  37. ui->foto->setPixmap(QPixmap::fromImage(image));
  38. }
To copy to clipboard, switch view to plain text mode 

I was stuck in this final lines and the loadFromData helped.
Now i can exchange png and other data between objects in the ui/my model and view / MySql database.
Just posting in case somebody needs this and for comments on optimizing this code.

Thanks