The LibraryItemDelegate class.
More...
#include <libraryitemdelegate.h>
|
| LibraryItemDelegate (LibraryTreeView *libraryTreeView, QSortFilterProxyModel *proxy) |
|
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
|
virtual QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override |
|
| MiamItemDelegate (QSortFilterProxyModel *proxy) |
|
|
virtual void | drawAlbum (QPainter *painter, QStyleOptionViewItem &option, QStandardItem *item) const override |
|
virtual void | drawArtist (QPainter *painter, QStyleOptionViewItem &option, QStandardItem *item) const override |
|
virtual void | drawDisc (QPainter *painter, QStyleOptionViewItem &option, QStandardItem *item) const override |
|
virtual void | drawTrack (QPainter *painter, QStyleOptionViewItem &option, QStandardItem *track) const override |
|
void | paintCoverOnTrack (QPainter *painter, const QStyleOptionViewItem &option, const QStandardItem *track) const |
|
void | paintText (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rectText, const QString &text, const QStandardItem *item) const |
|
void | drawLetter (QPainter *painter, QStyleOptionViewItem &option, QStandardItem *item) const |
|
void | paintRect (QPainter *painter, const QStyleOptionViewItem &option) const |
|
void | paintText (QPainter *p, const QStyleOptionViewItem &opt, const QRect &rectText, const QString &text, const QStandardItem *item) const |
|
The LibraryItemDelegate class.
- Author
- Matthieu Bachelier
- Copyright
- GNU General Public License v3
§ LibraryItemDelegate()
LibraryItemDelegate::LibraryItemDelegate |
( |
LibraryTreeView * |
libraryTreeView, |
|
|
QSortFilterProxyModel * |
proxy |
|
) |
| |
|
explicit |
§ displayIcon
void LibraryItemDelegate::displayIcon |
( |
bool |
b | ) |
|
|
slot |
§ drawAlbum()
void LibraryItemDelegate::drawAlbum |
( |
QPainter * |
painter, |
|
|
QStyleOptionViewItem & |
option, |
|
|
QStandardItem * |
item |
|
) |
| const |
|
overrideprotectedvirtual |
Albums have covers usually.
XXX: reload cover with high resolution when one has increased coverSize (every 64px)
Implements MiamItemDelegate.
§ drawArtist()
void LibraryItemDelegate::drawArtist |
( |
QPainter * |
painter, |
|
|
QStyleOptionViewItem & |
option, |
|
|
QStandardItem * |
item |
|
) |
| const |
|
overrideprotectedvirtual |
XXX: paint articles like ", the" in gray? Could be nice
Implements MiamItemDelegate.
§ drawDisc()
void LibraryItemDelegate::drawDisc |
( |
QPainter * |
painter, |
|
|
QStyleOptionViewItem & |
option, |
|
|
QStandardItem * |
item |
|
) |
| const |
|
overrideprotectedvirtual |
§ drawTrack()
void LibraryItemDelegate::drawTrack |
( |
QPainter * |
painter, |
|
|
QStyleOptionViewItem & |
option, |
|
|
QStandardItem * |
track |
|
) |
| const |
|
overrideprotectedvirtual |
XXX: create an option to display stars right to the text, and fade them if text is too large
Reimplemented from MiamItemDelegate.
§ paint()
void LibraryItemDelegate::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
overridevirtual |
§ paintCoverOnTrack()
void LibraryItemDelegate::paintCoverOnTrack |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QStandardItem * |
track |
|
) |
| const |
|
protected |
§ paintText()
void LibraryItemDelegate::paintText |
( |
QPainter * |
p, |
|
|
const QStyleOptionViewItem & |
opt, |
|
|
const QRect & |
rectText, |
|
|
const QString & |
text, |
|
|
const QStandardItem * |
item |
|
) |
| const |
|
protected |
Check if color needs to be inverted then paint text.
§ sizeHint()
QSize LibraryItemDelegate::sizeHint |
( |
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
overridevirtual |
Redefined to always display the same height for albums, even for those without one.
§ updateCoverSize
void LibraryItemDelegate::updateCoverSize |
( |
| ) |
|
|
slot |
The documentation for this class was generated from the following files: