31 lines
645 B
C++
31 lines
645 B
C++
#include "champrow.h"
|
|
|
|
ChampRow::ChampRow(QListWidget* parent) : QListWidgetItem(parent) {
|
|
}
|
|
|
|
ChampRow::~ChampRow() {
|
|
}
|
|
|
|
void ChampRow::setChamp(const DataDragon::ChampData& cd, QPixmap icon) {
|
|
setText(QString::fromStdString(cd.name));
|
|
champid = cd.key;
|
|
this->icon = icon;
|
|
setIcon(QIcon(icon));
|
|
|
|
#define QS(A) arg(QString::fromStdString(A))
|
|
setToolTip(QWidget::tr("Champion: %1\nType: %2\nTitle: %3\nID: %4").QS(cd.name).QS(cd.partype).QS(cd.title).arg(cd.key));
|
|
#undef QS
|
|
}
|
|
|
|
QString ChampRow::getChamp() const {
|
|
return text();
|
|
}
|
|
|
|
uint32_t ChampRow::getChampID() const {
|
|
return champid;
|
|
}
|
|
|
|
QPixmap ChampRow::getIcon() {
|
|
return icon;
|
|
}
|