Add iconScaledPixmap() convenience functions.

This commit is contained in:
Felix Geyer 2016-01-24 18:45:10 +01:00
parent 1f33e6f044
commit 38245aa2a9
4 changed files with 33 additions and 0 deletions

View file

@ -143,6 +143,24 @@ QPixmap Group::iconPixmap() const
}
}
QPixmap Group::iconScaledPixmap() const
{
if (m_data.customIcon.isNull()) {
// built-in icons are 16x16 so don't need to be scaled
return databaseIcons()->iconPixmap(m_data.iconNumber);
}
else {
Q_ASSERT(m_db);
if (m_db) {
return m_db->metadata()->customIconScaledPixmap(m_data.customIcon);
}
else {
return QPixmap();
}
}
}
int Group::iconNumber() const
{
return m_data.iconNumber;