Hi, I have a column that displays an image, but it is "cut off" where it is bigger than the cell size. I do not want to make the cell fit the image, just scale down the image, like a thumbnail. I have sub-classed QSqlTableModel and display the image in data() like this:
Qt Code:
  1. if(header == "Image")
  2. {
  3. QString link = QSqlTableModel::data(idx, Qt::DisplayRole).toString();
  4. QPixmap pixmap(link);
  5.  
  6. switch(role)
  7. {
  8. case Qt::DisplayRole:
  9. return QString();
  10. break;
  11. case Qt::DecorationRole:
  12. return pixmap;
  13. break;
  14. case Qt::UserRole:
  15. return link;
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 
Is there some way to get the cell size, so I can return something like pixmap.scaled(cellSize), or find the lesser of scaledToHeigth() and scaledToWidth()? Or am I trying to go this in the wrong place?

I use images in a different column, but I am free to use small enough images that they fit. Ultimately, I plan to use the tool tip to show the image full sized.