Hi!
I have QTableView and insert QPixmap and QString using QAbstractTableModel:

Qt Code:
  1. QVariant CurrencyModel::data(const QModelIndex &index, int role) const
  2. {
  3.  
  4. if (!index.isValid())
  5. return QVariant();
  6. if (role == Qt::TextAlignmentRole) {
  7. return int(Qt::AlignBottom);
  8. }
  9. else if (role == Qt::DisplayRole) {
  10. sz=5*index.row();
  11. QString amount = currencyAt(index.column()+sz);
  12. return amount;
  13. }
  14. else if (role == Qt::DecorationRole) {
  15. sz=5*index.row();
  16. QPixmap pixmap;
  17. QString amount = currencyAt(index.column()+sz);
  18. qDebug()<<amount;
  19. if(pixmap.isNull()) pixmap.load("radio.jpg");
  20. pixmap.load(amount +".jpg");
  21. pixmap=pixmap.scaled(50, 50, Qt::KeepAspectRatio);
  22. return pixmap;
  23. }
  24. return QVariant();
  25. }
  26. QString CurrencyModel::currencyAt(int offset) const
  27. {
  28. if(offset >= currencyMap.size()) return "";
  29. return (currencyMap.begin() + offset).key();
  30. }
To copy to clipboard, switch view to plain text mode 
Looks like in the picture:
Снимок.png
Pixmap always inserted in left. But need pixmap top, text under the pixmap. How to do that?