//
// imagedelegate.cpp - Qt Model/View rendering class
//
-// by James L. Hammons
+// by James Hammons
// (C) 2010 Underground Software
//
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
//
// Who When What
// --- ---------- -------------------------------------------------------------
// This is crappy. We really should have a properly scaled image ready to go so we
// don't get Qt's default ugly looking fast scaling...
+
#warning "!!! FIX !!! Need to create properly scaled down cart/label images!"
-// unsigned long i = index.model()->data(index, Qt::DisplayRole).toUInt();
-#if 0
- unsigned long i = index.model()->data(index, Qt::DisplayRole).toUInt();
- QString filename = index.model()->data(index, Qt::EditRole).toString();
- QImage label = index.model()->data(index, Qt::DecorationRole).value<QImage>();
-#else
+//We've got the carts, now just need to do the labels...
+
unsigned long i = index.model()->data(index, FLM_INDEX).toUInt();
QString filename = index.model()->data(index, FLM_FILENAME).toString();
QImage label = index.model()->data(index, FLM_LABEL).value<QImage>();
-#endif
QString nameToDraw;
if (i == 0xFFFFFFFF) // Not found...
}
else
nameToDraw = romList[i].name;
-#if 0
- if (role == Qt::DecorationRole)
- return list.at(index.row()).label;
- else if (role == Qt::DisplayRole)
- return (uint)list.at(index.row()).dbIndex;
- else if (role == Qt::EditRole)
- return list.at(index.row()).filename;
-#endif
-// if (romList[i].file[0] == 0)
if (label.isNull())
{
// painter->drawPixmap(option.rect.x()+14, option.rect.y()+50, 433/2, 203/2, QPixmap(":/res/label-blank.png"));