Hint a size for the delegate

This commit is contained in:
Aleix Pol 2016-11-28 16:27:28 +01:00
parent e72bbfe1d2
commit b1f6204c53

View file

@ -251,6 +251,8 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
//This function gets called lots of times, producing lots of dbus calls. Add a cache? //This function gets called lots of times, producing lots of dbus calls. Add a cache?
switch (role) { switch (role) {
case Qt::SizeHintRole:
return QSize(0, 32);
case IconModelRole: { case IconModelRole: {
QString icon = data(index, IconNameRole).toString(); QString icon = data(index, IconNameRole).toString();
return QIcon::fromTheme(icon); return QIcon::fromTheme(icon);