| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef HISTORYITEMMODEL_H |
| 21 |
#define HISTORYITEMMODEL_H |
| 22 |
|
| 23 |
#include <QAbstractListModel> |
| 24 |
#include "Library/LibraryData.h" |
| 25 |
|
| 26 |
class LibraryManager; |
| 27 |
|
| 28 |
class HistoryListModel : public QAbstractListModel |
| 29 |
{ |
| 30 |
Q_OBJECT |
| 31 |
public: |
| 32 |
HistoryListModel(LibraryManager* lib, QObject *parent = 0); |
| 33 |
~HistoryListModel(); |
| 34 |
|
| 35 |
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const; |
| 36 |
bool canFetchMore(const QModelIndex &) const; |
| 37 |
void fetchMore(const QModelIndex &); |
| 38 |
|
| 39 |
int rowCount(const QModelIndex &) const; |
| 40 |
|
| 41 |
|
| 42 |
Qt::DropActions supportedDropActions() const; |
| 43 |
Qt::DropActions supportedDragActions() const; |
| 44 |
Qt::ItemFlags flags(const QModelIndex &index) const; |
| 45 |
|
| 46 |
|
| 47 |
public slots: |
| 48 |
void onHistoryChanged(); |
| 49 |
private: |
| 50 |
LibraryManager *mLibrary; |
| 51 |
int mChildren; |
| 52 |
int mHistorySize; |
| 53 |
|
| 54 |
}; |
| 55 |
|
| 56 |
#endif |