Miam-Player  0.8.0
A nice music player
StarDelegate Class Reference

The StarDelegate class is used to draw stars for ratings. More...

#include <stardelegate.h>

Inheritance diagram for StarDelegate:

Public Types

enum  EditMode { Editable, NoStarsYet, ReadOnly }
 

Public Member Functions

 StarDelegate (Playlist *playlist, QMediaPlaylist *parent=0)
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
void setEditorData (QWidget *editor, const QModelIndex &index) const
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 

Static Public Attributes

static int maxStarCount = 5
 

Protected Member Functions

bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
 

Detailed Description

The StarDelegate class is used to draw stars for ratings.

Member Enumeration Documentation

Enumerator
Editable 
NoStarsYet 
ReadOnly 

Constructor & Destructor Documentation

StarDelegate::StarDelegate ( Playlist playlist,
QMediaPlaylist *  parent = 0 
)

Member Function Documentation

QWidget * StarDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  ,
const QModelIndex &  index 
) const

Redefined.

bool StarDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
protected
void StarDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Redefined.

void StarDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

Redefined.

void StarDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

Redefined.

QSize StarDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Redefined.

Member Data Documentation

int StarDelegate::maxStarCount = 5
static

The documentation for this class was generated from the following files: