-QVariant NickViewFilter::icon(const QModelIndex &index) const {
- if(!_showUserStateIcons)
- return QVariant();
-
- if(index.column() != 0)
- return QVariant();
-
- QModelIndex source_index = mapToSource(index);
- NetworkModel::ItemType itemType = (NetworkModel::ItemType)sourceModel()->data(source_index, NetworkModel::ItemTypeRole).toInt();
- switch(itemType) {
- case NetworkModel::UserCategoryItemType:
- {
- int categoryId = sourceModel()->data(source_index, TreeModel::SortRole).toInt();
- if(categoryId <= _opIconLimit)
- return _categoryOpIcon;
- if(categoryId <= _voiceIconLimit)
- return _categoryVoiceIcon;
- return _userOnlineIcon;
+QVariant NickViewFilter::data(const QModelIndex& index, int role) const
+{
+ switch (role) {
+ case Qt::FontRole:
+ case Qt::ForegroundRole:
+ case Qt::BackgroundRole:
+ case Qt::DecorationRole:
+ return GraphicalUi::uiStyle()->nickViewItemData(mapToSource(index), role);
+ default:
+ return QSortFilterProxyModel::data(index, role);