18#ifndef SRC_WIDGETS_PLAYLISTICONVIEW_H
19#define SRC_WIDGETS_PLAYLISTICONVIEW_H
21#include <QAbstractItemView>
23class PlaylistIconView :
public QAbstractItemView
27 PlaylistIconView(QWidget *parent);
28 void resetMultiSelect();
29 void setIconRole(
int role);
30 void setElideMode(Qt::TextElideMode mode) { m_elideMode = mode; }
32 QRect visualRect(
const QModelIndex &index)
const Q_DECL_OVERRIDE;
33 void scrollTo(
const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
34 QModelIndex indexAt(
const QPoint &point)
const Q_DECL_OVERRIDE;
35 QModelIndex moveCursor(CursorAction cursorAction,
36 Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
37 int horizontalOffset() const Q_DECL_OVERRIDE;
38 int verticalOffset() const Q_DECL_OVERRIDE;
39 bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
40 void setSelection(const QRect &rect,
41 QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
42 QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
43 void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE;
45 void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
46 bool event(QEvent *event) Q_DECL_OVERRIDE;
47 void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
48 void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
49 void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
50 void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
51 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
52 void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
53 void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
54 void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
56 void rowsInserted(const QModelIndex &parent,
int start,
int end) Q_DECL_OVERRIDE;
57 void rowsAboutToBeRemoved(const QModelIndex &parent,
int start,
int end) Q_DECL_OVERRIDE;
58 void dataChanged(const QModelIndex &topLeft,
59 const QModelIndex &bottomRight,
60 const QVector<
int> &roles = QVector<
int>()) Q_DECL_OVERRIDE;
66 void selectionChanged(const QItemSelection &selected,
67 const QItemSelection &deselected) Q_DECL_OVERRIDE;
71 QAbstractItemView::DropIndicatorPosition position(const QPoint &pos,
73 const QModelIndex &index) const;
74 QRect _visualRect(const QModelIndex &index) const;
77 QPoint m_draggingOverPos;
79 bool m_isToggleSelect{
false};
80 bool m_isRangeSelect{
false};
81 QModelIndex m_pendingSelect;
83 Qt::TextElideMode m_elideMode{Qt::ElideMiddle};