mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 15:04:40 -04:00
added retina icons for YACReader
This commit is contained in:
61
YACReaderLibrary/db/reading_list_model.h
Normal file
61
YACReaderLibrary/db/reading_list_model.h
Normal file
@ -0,0 +1,61 @@
|
||||
#ifndef READING_LIST_MODEL_H
|
||||
#define READING_LIST_MODEL_H
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QModelIndex>
|
||||
#include <QVariant>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
class LabelItem;
|
||||
class SpecialListItem;
|
||||
class ReadingListItem;
|
||||
class ReadingListSeparatorItem;
|
||||
|
||||
class ReadingListModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ReadingListModel(QObject *parent = 0);
|
||||
|
||||
//QAbstractItemModel methods
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const;
|
||||
QModelIndex index(int row, int column,
|
||||
const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
|
||||
//Convenience methods
|
||||
void setupModelData(QString path);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void deleteItem(const QModelIndex & mi);
|
||||
|
||||
private:
|
||||
void setupModelData(QSqlQuery &sqlquery, ReadingListItem *parent);
|
||||
|
||||
//Special lists
|
||||
QList<SpecialListItem *> specialLists;
|
||||
|
||||
//Label
|
||||
QList<LabelItem *> labels;
|
||||
|
||||
//Reading lists
|
||||
ReadingListItem * rootItem; //
|
||||
QMap<unsigned long long int, ReadingListItem *> items; //lists relationship
|
||||
|
||||
//separators
|
||||
ReadingListSeparatorItem * separator1;
|
||||
ReadingListSeparatorItem * separator2;
|
||||
|
||||
QString _databasePath;
|
||||
|
||||
};
|
||||
|
||||
#endif // READING_LIST_MODEL_H
|
Reference in New Issue
Block a user