This way item is redrawn when current item changes.
// picture where all the rendering happens and which will be cached
QPixmap pix;
- QString key = title + artist + artUrl;
+ QString key = title + artist + artUrl
+ + QString( index.data( PLModel::IsCurrentRole ).toInt() );
if(QPixmapCache::find( key, pix ))
{
// cool, we found it in the cache
QFont f; f.setBold( true ); return QVariant( f );
}
}
+ else if( role == IsCurrentRole ) return QVariant( isCurrent( index ) );
return QVariant();
}
friend class PLItem;
public:
+ enum {
+ IsCurrentRole = Qt::UserRole
+ };
+
PLModel( playlist_t *, intf_thread_t *,
playlist_item_t *, QObject *parent = 0 );
~PLModel();