This is where you should use
```
QIcon icon = item->getIcon();
if (!icon.isNull())
    return icon;
```